add logout button

This commit is contained in:
aurinex
2025-07-21 23:08:11 +05:00
parent 83a0e308bc
commit 5d660e7a95
3 changed files with 39 additions and 6 deletions

View File

@ -67,6 +67,7 @@ export default function CapeCard({
width: 200,
overflow: 'hidden',
position: 'relative', // для позиционирования ценника
borderRadius: '1vw',
}}
>
{/* Ценник для магазина */}
@ -97,7 +98,13 @@ export default function CapeCard({
}}
/>
<CardContent sx={{ bgcolor: 'rgba(255, 255, 255, 0.05)', pt: '9vh' }}>
<CardContent
sx={{
bgcolor: 'rgba(255, 255, 255, 0.05)',
pt: '6vw',
minHeight: '5vw',
}}
>
<Typography sx={{ color: 'white' }}>{capeName}</Typography>
</CardContent>
@ -108,8 +115,8 @@ export default function CapeCard({
onClick={() => onAction(capeId)}
disabled={actionDisabled}
sx={{
borderRadius: '20px',
p: '5px 25px',
borderRadius: '2vw',
p: '0.5vw 2.5vw',
color: 'white',
backgroundColor: 'rgb(0, 134, 0)',
'&:hover': {

View File

@ -102,6 +102,11 @@ export default function TopBar({ onRegister, username }: TopBarProps) {
}
}, [username]);
const logout = () => {
localStorage.removeItem('launcher_config');
navigate('/login');
};
return (
<Box
sx={{
@ -274,8 +279,29 @@ export default function TopBar({ onRegister, username }: TopBarProps) {
marginRight: '1vw',
}}
>
{!isLoginPage && !isRegistrationPage && username && (
<Button
variant="outlined"
color="primary"
onClick={() => logout()}
sx={{
width: '10em',
height: '3em',
borderRadius: '1.5vw',
color: 'white',
backgroundImage: 'linear-gradient(to right, #7BB8FF, #FFB7ED)',
border: 'unset',
'&:hover': {
backgroundImage: 'linear-gradient(to right, #6AA8EE, #EEA7DD)',
},
boxShadow: '0.5em 0.5em 0.5em 0px #00000040 inset',
}}
>
Выйти
</Button>
)}
{/* Кнопка регистрации, если на странице логина */}
{username && (
{!isLoginPage && !isRegistrationPage && username && (
<CustomTooltip
title="Попы — внутриигровая валюта, начисляемая за время игры на серверах."
arrow

View File

@ -424,7 +424,7 @@ export default function Profile() {
display: 'flex',
justifyContent: 'center',
flexDirection: 'column',
gap: 2,
gap: '2vw',
}}
>
<Typography>Ваши плащи</Typography>
@ -432,7 +432,7 @@ export default function Profile() {
sx={{
display: 'flex',
flexDirection: 'row',
gap: 2,
gap: '2vw',
flexWrap: 'wrap',
}}
>