forked from Renovamen/playground-macos
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: simplify code, add vscode app
- Loading branch information
Showing
15 changed files
with
292 additions
and
285 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,46 +1,38 @@ | ||
import React from "react"; | ||
import apps from "../configs/apps"; | ||
|
||
export default function Dock({ openWindow, showLaunchpad, setShowLaunchpad }) { | ||
const openApp = (title) => { | ||
setShowLaunchpad(false); | ||
openWindow(title); | ||
export default function Dock({ open, toggleLaunchpad, hidde }) { | ||
const openApp = (id) => { | ||
toggleLaunchpad(false); | ||
open(id); | ||
}; | ||
|
||
return ( | ||
<div | ||
className="dock w-full fixed bottom-0" | ||
style={{ | ||
zIndex: 99999 | ||
zIndex: hidde ? 0 : 99999 | ||
}} | ||
> | ||
<ul className="mx-auto w-max p-2 space-x-2 flex flex-row justify-center justify-between bg-white bg-opacity-20 blur rounded-t-lg shadow-2xl"> | ||
<li | ||
key="dock-launchpad" | ||
onClick={() => setShowLaunchpad(!showLaunchpad)} | ||
> | ||
<li key="dock-launchpad" onClick={() => toggleLaunchpad()}> | ||
<img | ||
className="w-12" | ||
src="icons/launchpad.png" | ||
alt="Launchpad" | ||
title="Launchpad" | ||
/> | ||
</li> | ||
<li key="dock-text" onClick={() => openApp("Notepad")}> | ||
<img | ||
className="w-12" | ||
src="icons/text.png" | ||
alt="Notepad" | ||
title="Notepad" | ||
/> | ||
</li> | ||
<li key="dock-safari" onClick={() => openApp("Safari")}> | ||
<img | ||
className="w-12" | ||
src="icons/safari.png" | ||
alt="Safari" | ||
title="Safari" | ||
/> | ||
</li> | ||
{apps.map((app) => ( | ||
<li key={`dock-${app.id}`} onClick={() => openApp(app.id)}> | ||
<img | ||
className="w-12" | ||
src={app.img} | ||
alt={app.title} | ||
title={app.title} | ||
/> | ||
</li> | ||
))} | ||
<li key="dock-mail"> | ||
<a href="mailto:[email protected]"> | ||
<img | ||
|
@@ -65,22 +57,6 @@ export default function Dock({ openWindow, showLaunchpad, setShowLaunchpad }) { | |
/> | ||
</a> | ||
</li> | ||
<li key="dock-cmd" onClick={() => openApp("Terminal")}> | ||
<img | ||
className="w-12" | ||
src="icons/terminal.png" | ||
alt="Terminal" | ||
title="Terminal" | ||
/> | ||
</li> | ||
<li key="dock-facetime" onClick={() => openApp("FaceTime")}> | ||
<img | ||
className="w-12" | ||
src="icons/facetime.png" | ||
alt="FaceTime" | ||
title="FaceTime" | ||
/> | ||
</li> | ||
</ul> | ||
</div> | ||
); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.