add logout button
This commit is contained in:
@ -67,6 +67,7 @@ export default function CapeCard({
|
|||||||
width: 200,
|
width: 200,
|
||||||
overflow: 'hidden',
|
overflow: 'hidden',
|
||||||
position: 'relative', // для позиционирования ценника
|
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>
|
<Typography sx={{ color: 'white' }}>{capeName}</Typography>
|
||||||
</CardContent>
|
</CardContent>
|
||||||
|
|
||||||
@ -108,8 +115,8 @@ export default function CapeCard({
|
|||||||
onClick={() => onAction(capeId)}
|
onClick={() => onAction(capeId)}
|
||||||
disabled={actionDisabled}
|
disabled={actionDisabled}
|
||||||
sx={{
|
sx={{
|
||||||
borderRadius: '20px',
|
borderRadius: '2vw',
|
||||||
p: '5px 25px',
|
p: '0.5vw 2.5vw',
|
||||||
color: 'white',
|
color: 'white',
|
||||||
backgroundColor: 'rgb(0, 134, 0)',
|
backgroundColor: 'rgb(0, 134, 0)',
|
||||||
'&:hover': {
|
'&:hover': {
|
||||||
|
@ -102,6 +102,11 @@ export default function TopBar({ onRegister, username }: TopBarProps) {
|
|||||||
}
|
}
|
||||||
}, [username]);
|
}, [username]);
|
||||||
|
|
||||||
|
const logout = () => {
|
||||||
|
localStorage.removeItem('launcher_config');
|
||||||
|
navigate('/login');
|
||||||
|
};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Box
|
<Box
|
||||||
sx={{
|
sx={{
|
||||||
@ -274,8 +279,29 @@ export default function TopBar({ onRegister, username }: TopBarProps) {
|
|||||||
marginRight: '1vw',
|
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
|
<CustomTooltip
|
||||||
title="Попы — внутриигровая валюта, начисляемая за время игры на серверах."
|
title="Попы — внутриигровая валюта, начисляемая за время игры на серверах."
|
||||||
arrow
|
arrow
|
||||||
|
@ -424,7 +424,7 @@ export default function Profile() {
|
|||||||
display: 'flex',
|
display: 'flex',
|
||||||
justifyContent: 'center',
|
justifyContent: 'center',
|
||||||
flexDirection: 'column',
|
flexDirection: 'column',
|
||||||
gap: 2,
|
gap: '2vw',
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<Typography>Ваши плащи</Typography>
|
<Typography>Ваши плащи</Typography>
|
||||||
@ -432,7 +432,7 @@ export default function Profile() {
|
|||||||
sx={{
|
sx={{
|
||||||
display: 'flex',
|
display: 'flex',
|
||||||
flexDirection: 'row',
|
flexDirection: 'row',
|
||||||
gap: 2,
|
gap: '2vw',
|
||||||
flexWrap: 'wrap',
|
flexWrap: 'wrap',
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
|
Reference in New Issue
Block a user