feat: add multiple admin dashboard layout components and update sidebar and navbar
This commit is contained in:
@@ -10,7 +10,7 @@ export const AdminDashboardLayout = (properties: PropsWithChildren) => {
|
||||
<Navbar />
|
||||
<div className="flex">
|
||||
<Sidebar />
|
||||
<div className="min-h-[calc(100dvh-80px)] flex-1">{children}</div>
|
||||
<div className="min-h-[calc(100dvh-80px)] flex-1 p-8">{children}</div>
|
||||
</div>
|
||||
</div>
|
||||
)
|
||||
|
||||
@@ -1,9 +1,13 @@
|
||||
import { Link } from 'react-router'
|
||||
|
||||
import { ChevronDownIcon } from '~/components/icons/chevron-down'
|
||||
import { NotificationIcon } from '~/components/icons/notification'
|
||||
import { useAdminContext } from '~/contexts/admin'
|
||||
import { APP } from '~/data/meta'
|
||||
|
||||
export const Navbar = () => {
|
||||
const { adminProfile } = useAdminContext()
|
||||
|
||||
return (
|
||||
<div className="flex h-20 items-center justify-between border-b border-[#ECECEC] bg-white px-10 py-5">
|
||||
<Link
|
||||
@@ -16,7 +20,14 @@ export const Navbar = () => {
|
||||
className="h-3/4 w-auto sm:h-full"
|
||||
/>
|
||||
</Link>
|
||||
<div>
|
||||
<div className="flex items-center gap-x-8">
|
||||
<div className="flex w-3xs items-center justify-between">
|
||||
<div className="flex items-center">
|
||||
<div className="mr-3 h-8 w-8 rounded-full bg-[#C4C4C4]" />
|
||||
<span className="text-xs">{adminProfile.name}</span>
|
||||
</div>
|
||||
<ChevronDownIcon className="opacity-10" />
|
||||
</div>
|
||||
<NotificationIcon
|
||||
className="text-[#B0C3CC]"
|
||||
showBadge={true}
|
||||
|
||||
@@ -7,13 +7,11 @@ export const Sidebar = () => {
|
||||
return (
|
||||
<div className="flex min-h-[calc(100dvh-80px)] flex-col gap-y-10 overflow-y-auto bg-white p-5">
|
||||
{MENU.map(({ group, items }) => (
|
||||
<div className="flex flex-col">
|
||||
<div
|
||||
key={group}
|
||||
className="px-5 pb-4 text-[#4C5CA0]/50 uppercase"
|
||||
>
|
||||
{group}
|
||||
</div>
|
||||
<div
|
||||
className="flex flex-col"
|
||||
key={group}
|
||||
>
|
||||
<div className="px-5 pb-4 text-[#4C5CA0]/50 uppercase">{group}</div>
|
||||
{items.map(({ title, url, icon: Icon }) => (
|
||||
<NavLink
|
||||
to={url}
|
||||
@@ -36,7 +34,7 @@ export const Sidebar = () => {
|
||||
<span
|
||||
className={twMerge(
|
||||
isActive ? 'text-[#5363AB]' : 'text-[#273240]',
|
||||
'transition-all group-hover/menu:text-[#5363AB]',
|
||||
'text-base transition-all group-hover/menu:text-[#5363AB]',
|
||||
)}
|
||||
>
|
||||
{title}
|
||||
|
||||
Reference in New Issue
Block a user