11import { useEffect , useState } from 'react' ;
22import { Link , useLocation , useNavigate } from 'react-router-dom' ;
3- import { Code2 , User , LogOut , ShieldCheck , Dices , Menu , X , Activity , Hash } from 'lucide-react' ;
3+ import { Code2 , LogOut , ShieldCheck , Dices , Menu , X , Activity , Hash } from 'lucide-react' ;
44import { useAuth } from '../context/AuthContext' ;
55
66export default function Navbar ( ) {
@@ -147,7 +147,12 @@ export default function Navbar() {
147147 < hr className = "border-dark-700 my-2" />
148148 { user ? (
149149 < >
150- < span className = "block px-4 py-2 text-sm text-dark-300" > { user . username } </ span >
150+ < div className = "flex items-center gap-3 px-4 py-2" >
151+ < div className = "w-8 h-8 rounded-full bg-gradient-to-br from-primary-500 to-purple-500 flex items-center justify-center text-white text-xs font-bold shrink-0" >
152+ { user . username . charAt ( 0 ) . toUpperCase ( ) }
153+ </ div >
154+ < span className = "text-sm text-dark-200 font-medium" > { user . username } </ span >
155+ </ div >
151156 { user . role === 'admin' && < Link to = "/admin" onClick = { ( ) => setMobileMenuOpen ( false ) } className = "block px-4 py-2 text-sm text-primary-400" > 管理中心</ Link > }
152157 < button onClick = { ( ) => { logout ( ) ; setMobileMenuOpen ( false ) ; } } className = "block w-full text-left px-4 py-2 text-sm text-dark-400" > 退出登录</ button >
153158 </ >
@@ -165,7 +170,9 @@ export default function Navbar() {
165170 { user ? (
166171 < >
167172 < Link to = "/profile" className = "flex items-center gap-2 text-dark-300 hover:text-white transition-colors" >
168- < User className = "w-4 h-4" />
173+ < div className = "w-7 h-7 rounded-full bg-gradient-to-br from-primary-500 to-purple-500 flex items-center justify-center text-white text-xs font-bold shrink-0" >
174+ { user . username . charAt ( 0 ) . toUpperCase ( ) }
175+ </ div >
169176 < span className = "text-sm font-medium" > { user . username } </ span >
170177 </ Link >
171178 { user . role === 'admin' && ( < >
0 commit comments