Skip to content

Commit

Permalink
Refactorisation du composant SideMenu et ajout des données de menu
Browse files Browse the repository at this point in the history
  • Loading branch information
latioms committed May 2, 2024
1 parent cbea774 commit 4fb5890
Show file tree
Hide file tree
Showing 3 changed files with 78 additions and 13 deletions.
13 changes: 0 additions & 13 deletions server/.env.example

This file was deleted.

32 changes: 32 additions & 0 deletions web/app/(CService)/components/SideMenu/index.tsx
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;
46 changes: 46 additions & 0 deletions web/app/(CService)/components/SideMenu/menuData.tsx
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,
},
];

0 comments on commit 4fb5890

Please sign in to comment.