From a56f098413131366ccf89db1b6c4f14fb376fbfc Mon Sep 17 00:00:00 2001 From: LittleSheep Date: Fri, 3 Jan 2025 22:34:04 +0800 Subject: [PATCH] :sparkles: Complete user center --- src/pages/index.tsx | 2 +- src/pages/users/me.tsx | 36 +++++++++++++++++++++++++++++++++++- 2 files changed, 36 insertions(+), 2 deletions(-) diff --git a/src/pages/index.tsx b/src/pages/index.tsx index ec0ce73..50424bf 100644 --- a/src/pages/index.tsx +++ b/src/pages/index.tsx @@ -3,7 +3,7 @@ import { Container, Typography } from '@mui/material' export default function Home() { return (
- + Welcome to
the Solsynth Capital. diff --git a/src/pages/users/me.tsx b/src/pages/users/me.tsx index ef517c4..93e2ef5 100644 --- a/src/pages/users/me.tsx +++ b/src/pages/users/me.tsx @@ -1,10 +1,15 @@ import { checkAuthenticatedClient, redirectToLogin } from '@/services/auth' import { useUserStore } from '@/services/user' -import { Avatar, Box, Container, Typography } from '@mui/material' +import { Avatar, Box, Button, Container, Typography } from '@mui/material' import { getAttachmentUrl } from '@/services/network' import { useEffect } from 'react' import Image from 'next/image' +import LogoutIcon from '@mui/icons-material/Logout' +import LaunchIcon from '@mui/icons-material/Launch' +import Link from 'next/link' +import { deleteCookie } from 'cookies-next/client' + export default function UserItself() { useEffect(() => { if (!checkAuthenticatedClient()) redirectToLogin() @@ -12,6 +17,12 @@ export default function UserItself() { const userStore = useUserStore() + function logout() { + deleteCookie('nex_user_atk') + deleteCookie('nex_user_rtk') + window.location.reload() + } + return ( <> {userStore.account?.banner && ( @@ -24,6 +35,29 @@ export default function UserItself() { Your Solarpass + + + + {userStore.account && } + + {userStore.account?.nick} + + @{userStore.account?.name} + + + + + + + + + + +
)