|
@@ -1,55 +1,48 @@
|
|
|
-import { Bolt, ChevronRight, IdCard, Key, Lock, Smartphone, SquareArrowRightExit } from "lucide-react";
|
|
|
|
|
|
|
+import { useState } from "react";
|
|
|
|
|
+import { ChangePassword } from "./change-password";
|
|
|
|
|
+import { BindPhone } from "./bind-phone";
|
|
|
|
|
+import { RealName } from "./real-name";
|
|
|
|
|
+import { Agreement } from "../agreement";
|
|
|
|
|
+import SlideBar from "./slide-bar";
|
|
|
|
|
|
|
|
-export default function SlideBar() {
|
|
|
|
|
- return (
|
|
|
|
|
- <>
|
|
|
|
|
- <div className="fixed left-0 top-0 flex h-screen w-[80%] overflow-hidden">
|
|
|
|
|
-
|
|
|
|
|
- <div className="absolute inset-0 z-10 bg-white backdrop-blur-sm"></div>
|
|
|
|
|
|
|
+interface SlideBarIndexProps {
|
|
|
|
|
+ onClose: () => void;
|
|
|
|
|
+}
|
|
|
|
|
|
|
|
- <div className="relative z-20 flex h-full w-full">
|
|
|
|
|
- <div className="flex h-full w-80 flex-col bg-background-light dark:bg-background-dark shadow-2xl">
|
|
|
|
|
|
|
+export default function SlideBarIndex({ onClose }: SlideBarIndexProps) {
|
|
|
|
|
+ const [showChangePassword, setShowChangePassword] = useState(false);
|
|
|
|
|
+ const [showBindPhone, setShowBindPhone] = useState(false);
|
|
|
|
|
+ const [showRealName, setShowRealName] = useState(false);
|
|
|
|
|
+ const [showAgreement, setShowAgreement] = useState<{ title: string; url: string } | null>(null);
|
|
|
|
|
+ const [showSlideBar, setShowSlideBar] = useState(true);
|
|
|
|
|
|
|
|
- <div className="p-6 pb-4 border-b border-slate-200 dark:border-slate-800">
|
|
|
|
|
- <div className="flex">
|
|
|
|
|
- <div className="flex flex-col">
|
|
|
|
|
- <h2 className="text-xl font-bold tracking-tight text-slate-900 dark:text-slate-100">CyberWarrior_99</h2>
|
|
|
|
|
- <p className="text-xs font-medium text-primary bg-primary/10 px-2 py-0.5 rounded-full inline-block mt-1">ID: #8842-X01</p>
|
|
|
|
|
- </div>
|
|
|
|
|
- </div>
|
|
|
|
|
- </div>
|
|
|
|
|
|
|
+ const handleBack = () => {
|
|
|
|
|
+ setShowChangePassword(false);
|
|
|
|
|
+ setShowBindPhone(false);
|
|
|
|
|
+ setShowRealName(false);
|
|
|
|
|
+ setShowAgreement(null);
|
|
|
|
|
+ setShowSlideBar(true);
|
|
|
|
|
+ };
|
|
|
|
|
|
|
|
- <div className="flex-1 overflow-y-auto py-4">
|
|
|
|
|
- <nav className="space-y-2">
|
|
|
|
|
- <p className="px-3 pb-2 text-xs font-semibold uppercase tracking-wider text-slate-400">账户安全</p>
|
|
|
|
|
- <button className="border-b border-slate-200 dark:border-slate-800 flex w-full items-center gap-4 px-3 py-3 text-slate-700 transition-colors hover:bg-primary/10 hover:text-primary dark:text-slate-300 dark:hover:bg-primary/20 dark:hover:text-primary">
|
|
|
|
|
- <span className="material-symbols-outlined"><Smartphone size="16" /></span>
|
|
|
|
|
- <span className="text-[14px] font-bold">修改手机</span>
|
|
|
|
|
- <span className="material-symbols-outlined ml-auto text-slate-300"><ChevronRight size="16" /></span>
|
|
|
|
|
- </button>
|
|
|
|
|
- <button className="border-b border-slate-200 dark:border-slate-800 flex w-full items-center gap-4 px-3 py-3 text-slate-700 transition-colors hover:bg-primary/10 hover:text-primary dark:text-slate-300 dark:hover:bg-primary/20 dark:hover:text-primary">
|
|
|
|
|
- <span className="material-symbols-outlined"><Key size="16" /></span>
|
|
|
|
|
- <span className="text-[14px] font-bold">绑定密码</span>
|
|
|
|
|
- <span className="material-symbols-outlined ml-auto text-slate-300"><ChevronRight size="16" /></span>
|
|
|
|
|
- </button>
|
|
|
|
|
- <button className="border-b border-slate-200 dark:border-slate-800 flex w-full items-center gap-4 px-3 py-3 text-slate-700 transition-colors hover:bg-primary/10 hover:text-primary dark:text-slate-300 dark:hover:bg-primary/20 dark:hover:text-primary">
|
|
|
|
|
- <span className="material-symbols-outlined"><IdCard size="16" /></span>
|
|
|
|
|
- <span className="text-[14px] font-bold">实名认证</span>
|
|
|
|
|
- <span className="material-symbols-outlined ml-auto text-slate-300"><ChevronRight size="16" /></span>
|
|
|
|
|
- </button>
|
|
|
|
|
- </nav>
|
|
|
|
|
- </div>
|
|
|
|
|
- <div className="p-4 border-t border-slate-200 dark:border-slate-800">
|
|
|
|
|
- <button className="flex w-full items-center justify-center gap-2 rounded-xl bg-slate-100 py-3 text-[14px] font-bold text-slate-900 transition-colors hover:bg-red-50 hover:text-red-600 dark:bg-slate-800 dark:text-slate-100 dark:hover:bg-red-900/30 dark:hover:text-red-400">
|
|
|
|
|
- <span className="material-symbols-outlined text-xl"><SquareArrowRightExit size="16" /></span>
|
|
|
|
|
- <span>退出登录</span>
|
|
|
|
|
- </button>
|
|
|
|
|
- <p className="mt-4 text-center text-[10px] text-slate-400">SDK Version {import.meta.env.VITE_SDK_VERSION}</p>
|
|
|
|
|
- </div>
|
|
|
|
|
- </div>
|
|
|
|
|
- <div className="flex-1 cursor-pointer"></div>
|
|
|
|
|
- </div>
|
|
|
|
|
|
|
+ return (
|
|
|
|
|
+ <div className="fixed inset-0 z-[100] flex items-center justify-center bg-black/60 backdrop-blur-sm">
|
|
|
|
|
+ <div className="absolute inset-0" onClick={onClose}></div>
|
|
|
|
|
+ <div className="relative z-110">
|
|
|
|
|
+ {showSlideBar && (
|
|
|
|
|
+ <SlideBar
|
|
|
|
|
+ onChangePassword={() => { setShowChangePassword(true); setShowSlideBar(false); }}
|
|
|
|
|
+ onBindPhone={() => { setShowBindPhone(true); setShowSlideBar(false); }}
|
|
|
|
|
+ onRealName={() => { setShowRealName(true); setShowSlideBar(false); }}
|
|
|
|
|
+ onAgreement={() => { setShowAgreement({ title: '用户协议', url: '/static/user.html' }); setShowSlideBar(false); }}
|
|
|
|
|
+ onPrivacy={() => { setShowAgreement({ title: '隐私政策', url: '/static/ys.html' }); setShowSlideBar(false); }}
|
|
|
|
|
+ onClose={onClose}
|
|
|
|
|
+ />
|
|
|
|
|
+ )}
|
|
|
|
|
+ {showChangePassword && <ChangePassword onBack={handleBack} />}
|
|
|
|
|
+ {showBindPhone && <BindPhone onBack={handleBack} />}
|
|
|
|
|
+ {showRealName && <RealName onBack={handleBack} />}
|
|
|
|
|
+ {showAgreement && <Agreement title={showAgreement.title} url={showAgreement.url} onBack={handleBack} />}
|
|
|
</div>
|
|
</div>
|
|
|
- </>
|
|
|
|
|
|
|
+ </div>
|
|
|
);
|
|
);
|
|
|
}
|
|
}
|