From 94ae812822f657004f4a8aebcd4bc8a89534d4c2 Mon Sep 17 00:00:00 2001 From: LittleSheep Date: Thu, 9 Jan 2025 20:50:42 +0800 Subject: [PATCH] :lipstick: Optimize drawer --- src/components/CapDrawer.tsx | 39 ++++++++++++++++++------------------ 1 file changed, 19 insertions(+), 20 deletions(-) diff --git a/src/components/CapDrawer.tsx b/src/components/CapDrawer.tsx index 7370084..27abaec 100644 --- a/src/components/CapDrawer.tsx +++ b/src/components/CapDrawer.tsx @@ -9,26 +9,29 @@ import { Drawer, Toolbar, Typography, + Link, } from '@mui/material' import { JSX } from 'react' import Image from 'next/image' -import FeedIcon from '@mui/icons-material/Feed' +import ExploreIcon from '@mui/icons-material/Explore' import PhotoLibraryIcon from '@mui/icons-material/PhotoLibrary' -import PolicyIcon from '@mui/icons-material/Policy' -import Link from 'next/link' +import NextLink from 'next/link' +import { useRouter } from 'next/router' interface NavLink { title: string - icon: JSX.Element + icon?: JSX.Element href: string } export function CapDrawer({ width, open, onClose }: { width: number; open: boolean; onClose: () => void }) { + const router = useRouter() + const functionLinks: NavLink[] = [ { - title: 'Posts', - icon: , + title: 'Explore', + icon: , href: '/posts', }, { @@ -41,7 +44,6 @@ export function CapDrawer({ width, open, onClose }: { width: number; open: boole const additionalLinks: NavLink[] = [ { title: 'Terms & Conditions', - icon: , href: '/terms', }, ] @@ -74,29 +76,26 @@ export function CapDrawer({ width, open, onClose }: { width: number; open: boole {functionLinks.map((l) => ( - + - + {l.icon} - + ))} - + {additionalLinks.map((l) => ( - - - - {l.icon} - - - - + + + {l.title} + + ))} - + )