Last active
November 14, 2023 00:51
-
-
Save YasirGaji/d4d8e50b286e2a37ba8ce8737218900e to your computer and use it in GitHub Desktop.
New way to render lists by using the declared static constants
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
import { leftsidebarLinks } from '@/constants'; | |
type INavLink = { | |
imgURL: string; | |
route: string; | |
label: string; | |
}; | |
const LeftSidebar = () => { | |
return ( | |
<nav className='leftsidebar'> | |
<ul className='flex flex-col gap-6'> | |
{leftsidebarLinks.map((link: INavLink) => { | |
return ( | |
<li key={link.label} className='leftsidebar-link'> | |
<NavLink to={link.route}> | |
{link.label} | |
</NavLink> | |
</li> | |
) | |
})} | |
</ul> | |
</nav> | |
) | |
} | |
export default LeftSidebar; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment