From 71aa09ebd70b9f352e3aca8c300ea4b7fcbf9053 Mon Sep 17 00:00:00 2001 From: MikiVL Date: Tue, 5 May 2026 12:54:56 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E4=BE=A7=E8=BE=B9=E6=A0=8F=E7=94=A8?= =?UTF-8?q?=E6=88=B7=E8=8F=9C=E5=8D=95=EF=BC=88=E7=99=BB=E5=BD=95=E7=8A=B6?= =?UTF-8?q?=E6=80=81/=E4=BA=91=E5=AD=98=E5=82=A8/=E7=99=BB=E5=87=BA?= =?UTF-8?q?=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/auth/UserMenu.tsx | 85 ++++++++++++++++++++++++++++++++ 1 file changed, 85 insertions(+) create mode 100644 src/components/auth/UserMenu.tsx diff --git a/src/components/auth/UserMenu.tsx b/src/components/auth/UserMenu.tsx new file mode 100644 index 0000000..a6ad75e --- /dev/null +++ b/src/components/auth/UserMenu.tsx @@ -0,0 +1,85 @@ +import { useState } from 'react' +import { User, LogOut, Cloud, Key } from 'lucide-react' +import { useAppStore } from '../../stores/appStore' +import { LoginModal } from './LoginModal' + +export function UserMenu() { + const { currentUser, logout, syncStatus, syncFromCloud } = useAppStore() + const [showLogin, setShowLogin] = useState(false) + const [showActivate, setShowActivate] = useState(false) + + if (!currentUser) { + return ( + <> + + {showLogin && setShowLogin(false)} />} + + ) + } + + return ( + <> +
+
+
+
+ {currentUser.username[0].toUpperCase()} +
+ + {currentUser.username} + +
+ +
+ + {currentUser.cloudEnabled ? ( + + ) : ( + + )} +
+ + {showActivate && ( + setShowActivate(false)} /> + )} + + ) +}