feat: update styles
add: TopBar title
This commit is contained in:
@ -22,6 +22,8 @@ body {
|
|||||||
display: flex;
|
display: flex;
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
|
padding: 0;
|
||||||
|
margin: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
p {
|
p {
|
||||||
|
@ -26,12 +26,26 @@ export default function TopBar({ onRegister }: TopBarProps) {
|
|||||||
const location = useLocation();
|
const location = useLocation();
|
||||||
const isLoginPage = location.pathname === '/login';
|
const isLoginPage = location.pathname === '/login';
|
||||||
const isLaunchPage = location.pathname.startsWith('/launch');
|
const isLaunchPage = location.pathname.startsWith('/launch');
|
||||||
|
const isVersionsExplorerPage = location.pathname.startsWith('/');
|
||||||
const navigate = useNavigate();
|
const navigate = useNavigate();
|
||||||
|
|
||||||
const handleLaunchPage = () => {
|
const handleLaunchPage = () => {
|
||||||
navigate('/');
|
navigate('/');
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const getPageTitle = () => {
|
||||||
|
if (isLoginPage) {
|
||||||
|
return 'Вход';
|
||||||
|
}
|
||||||
|
if (isLaunchPage) {
|
||||||
|
return 'Запуск';
|
||||||
|
}
|
||||||
|
if (isVersionsExplorerPage) {
|
||||||
|
return 'Версии';
|
||||||
|
}
|
||||||
|
return 'Неизвестная страница';
|
||||||
|
};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Box
|
<Box
|
||||||
sx={{
|
sx={{
|
||||||
@ -40,14 +54,16 @@ export default function TopBar({ onRegister }: TopBarProps) {
|
|||||||
top: 0,
|
top: 0,
|
||||||
left: 0,
|
left: 0,
|
||||||
right: 0,
|
right: 0,
|
||||||
height: '50px',
|
height: '5vh',
|
||||||
zIndex: 1000,
|
zIndex: 1000,
|
||||||
width: '100%',
|
width: '100%',
|
||||||
WebkitAppRegion: 'drag',
|
WebkitAppRegion: 'drag',
|
||||||
overflow: 'hidden',
|
overflow: 'hidden',
|
||||||
justifyContent: 'space-between', // Всё содержимое справа
|
justifyContent: 'space-between',
|
||||||
|
alignItems: 'center',
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
|
{/* Левая часть */}
|
||||||
<Box
|
<Box
|
||||||
sx={{
|
sx={{
|
||||||
display: 'flex',
|
display: 'flex',
|
||||||
@ -76,6 +92,23 @@ export default function TopBar({ onRegister }: TopBarProps) {
|
|||||||
</Button>
|
</Button>
|
||||||
)}
|
)}
|
||||||
</Box>
|
</Box>
|
||||||
|
{/* Центр */}
|
||||||
|
<Box
|
||||||
|
sx={{
|
||||||
|
position: 'absolute',
|
||||||
|
left: '50%',
|
||||||
|
transform: 'translateX(-50%)',
|
||||||
|
display: 'flex',
|
||||||
|
alignItems: 'center',
|
||||||
|
justifyContent: 'center',
|
||||||
|
flexGrow: 1,
|
||||||
|
WebkitAppRegion: 'drag',
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
<Typography variant="h6" sx={{ color: 'white' }}>
|
||||||
|
{getPageTitle()}
|
||||||
|
</Typography>
|
||||||
|
</Box>
|
||||||
{/* Правая часть со всеми кнопками */}
|
{/* Правая часть со всеми кнопками */}
|
||||||
<Box
|
<Box
|
||||||
sx={{
|
sx={{
|
||||||
|
Reference in New Issue
Block a user