-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Refactorisation du composant SideMenu et ajout des données de menu
- Loading branch information
Showing
3 changed files
with
78 additions
and
13 deletions.
There are no files selected for viewing
This file was deleted.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
'use client'; | ||
import React from 'react'; | ||
import { usePathname } from 'next/navigation'; | ||
import Image from 'next/image'; | ||
import { menuData } from './menuData'; | ||
import { Menu } from '@/types/menu'; | ||
|
||
|
||
const index = () => { | ||
return ( | ||
<div className="flex flex-col w-full px-5 py-3 bg-gray-50 dark:bg-gray-200"> | ||
{menuData.map((menu, index) => ( | ||
<span className='inline-flex hover:bg-gray-100 dark:hover:bg-gray-800 '> | ||
<Image | ||
key={index} | ||
className='text-gray-500 transition duration-75 dark:text-gray-400 group-hover:text-gray-900 dark:group-hover:text-white' | ||
src={`/icons/${menu.icon}.svg`} alt={menu.title} width={20} height={20} | ||
/> | ||
<a | ||
key={menu.id} | ||
href={menu.path} | ||
className="flex items-center p-4 font-light text-gray-900 rounded-lg dark:text-white hover:bg-gray-100 dark:hover:bg-gray-700 group" | ||
> | ||
{menu.title} | ||
</a> | ||
</span> | ||
))} | ||
</div> | ||
); | ||
}; | ||
|
||
export default index; |
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 |
---|---|---|
@@ -0,0 +1,46 @@ | ||
import { Menu } from "@/types/menu"; | ||
|
||
export const menuData: Menu[] = [ | ||
{ | ||
id: 1, | ||
title: "Dashboard", | ||
icon: "dashboard", | ||
path: "/Dashboard", | ||
newTab: false, | ||
}, | ||
{ | ||
id: 2, | ||
title: "Customers", | ||
icon: "people", | ||
path: "/Customers", | ||
newTab: false, | ||
}, | ||
{ | ||
id: 3, | ||
title: "Chat", | ||
icon: "chat", | ||
path: "/chat", | ||
newTab: false, | ||
}, | ||
{ | ||
id: 4, | ||
title: "Email", | ||
icon: "email", | ||
path: "/email", | ||
newTab: false, | ||
}, | ||
{ | ||
id: 5, | ||
title: "Settings", | ||
icon: "settings", | ||
path: "/settings", | ||
newTab: false, | ||
}, | ||
{ | ||
id: 6, | ||
title: "Help", | ||
icon: "help", | ||
path: "/help", | ||
newTab: false, | ||
}, | ||
]; |