-
Notifications
You must be signed in to change notification settings - Fork 27
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
62 additions
and
28 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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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,33 +1,37 @@ | ||
import { useCallback } from "react"; | ||
import { Link, useLocation } from "react-router-dom"; | ||
import { Settings, Home } from "lucide-react"; | ||
|
||
export const NavBar = () => { | ||
const location = useLocation(); | ||
|
||
const getNavLink = useCallback(() => { | ||
if (["/channel", "/"].includes(location.pathname)) { | ||
return <Link to="/settings">Settings</Link>; | ||
return ( | ||
<Link to="/settings"> | ||
<Settings size={20} /> | ||
</Link> | ||
); | ||
} | ||
|
||
if (location.pathname === "/error") { | ||
return <Link to="/">Home</Link>; | ||
return null; | ||
} | ||
|
||
if (location.pathname === "/settings") { | ||
return <Link to="/channel">Channel</Link>; | ||
return <Link to="/channel"> | ||
<Home size={20} /> | ||
</Link>; | ||
} | ||
|
||
}, [location.pathname]) | ||
}, [location.pathname]); | ||
|
||
return ( | ||
<div | ||
data-tauri-drag-region | ||
className="cursor-default rounded-t-md font-bold select-none p-2 bg-zinc-900 text-white" | ||
> | ||
overlayed | ||
<div className="float-right"> | ||
{getNavLink()} | ||
</div> | ||
<div className="float-right">{getNavLink()}</div> | ||
</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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,3 +2,9 @@ | |
@tailwind components; | ||
@tailwind utilities; | ||
|
||
body { | ||
position: fixed; | ||
width: 100%; | ||
height: 100%; | ||
overflow: hidden; | ||
} |
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,9 +1,7 @@ | ||
export const Settings = () => { | ||
return ( | ||
<> | ||
<div className="pt-2 text-3xl"> | ||
settings | ||
</div> | ||
</> | ||
<div className="h-screen pt-2 bg-zinc-800 p-2"> | ||
<h1 className="text-xl pl-2 pt-2 font-bold">Settings</h1> | ||
</div> | ||
); | ||
}; |