-
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.
Add NavBar Component
- Loading branch information
Showing
5 changed files
with
153 additions
and
4 deletions.
There are no files selected for viewing
52 changes: 50 additions & 2 deletions
52
apps/HashRateGame/src/app/(telegram)/app/(main)/_components/NavBar.tsx
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,7 +1,55 @@ | ||
'use client' | ||
import Link from 'next/link' | ||
import { usePathname } from 'next/navigation' | ||
import { FaTasks, FaUserFriends } from 'react-icons/fa' | ||
import { GiMining } from 'react-icons/gi' | ||
import { IoLogoGameControllerA } from 'react-icons/io' | ||
import { MdMenu } from 'react-icons/md' | ||
|
||
export default function NavBar() { | ||
const location = usePathname() | ||
const navItems = [ | ||
{ | ||
name: 'Games', | ||
href: '/games', | ||
icon: <IoLogoGameControllerA className="text-2xl" />, | ||
}, | ||
{ name: 'Tasks', href: '/tasks', icon: <FaTasks className="text-2xl" /> }, | ||
{ | ||
name: 'Mining', | ||
href: '/mining', | ||
icon: <GiMining className="text-2xl" />, | ||
}, | ||
{ | ||
name: 'Friends', | ||
href: '/friends', | ||
icon: <FaUserFriends className="text-2xl" />, | ||
}, | ||
{ name: 'Menu', href: '/menu', icon: <MdMenu className="text-2xl" /> }, | ||
] | ||
|
||
return ( | ||
<div className="bottom-0 left-0 right-0 fixed flex flex-row gap-4 p-4"> | ||
NavBar | ||
<div | ||
className={`bottom-0 left-0 right-0 fixed grid grid-cols-5 grid-rows-1 gap-2 p-2 border-t border-outline`}> | ||
{navItems.map((item) => ( | ||
<div | ||
key={item.name} | ||
className={`flex flex-col items-center justify-center font-[600] text-[12px] gap-1 ${ | ||
location !== `/app${item.href}` | ||
? 'text-on-surface-variant' | ||
: 'text-on-surface' | ||
}`}> | ||
<Link href={`/app${item.href}`}>{item.icon}</Link> | ||
<span | ||
className={`px-3 py-0.5 rounded-full ${ | ||
location !== `/app${item.href}` | ||
? 'text-on-surface-variant' | ||
: 'text-on-surface bg-secondary-container' | ||
}`}> | ||
{item.name} | ||
</span> | ||
</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
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