feat: update styles

add: TopBar title
This commit is contained in:
2025-07-13 23:52:28 +05:00
parent 942066ea76
commit 387d1548ba
2 changed files with 37 additions and 2 deletions

View File

@ -22,6 +22,8 @@ body {
display: flex;
justify-content: center;
align-items: center;
padding: 0;
margin: 0;
}
p {

View File

@ -26,12 +26,26 @@ export default function TopBar({ onRegister }: TopBarProps) {
const location = useLocation();
const isLoginPage = location.pathname === '/login';
const isLaunchPage = location.pathname.startsWith('/launch');
const isVersionsExplorerPage = location.pathname.startsWith('/');
const navigate = useNavigate();
const handleLaunchPage = () => {
navigate('/');
};
const getPageTitle = () => {
if (isLoginPage) {
return 'Вход';
}
if (isLaunchPage) {
return 'Запуск';
}
if (isVersionsExplorerPage) {
return 'Версии';
}
return 'Неизвестная страница';
};
return (
<Box
sx={{
@ -40,14 +54,16 @@ export default function TopBar({ onRegister }: TopBarProps) {
top: 0,
left: 0,
right: 0,
height: '50px',
height: '5vh',
zIndex: 1000,
width: '100%',
WebkitAppRegion: 'drag',
overflow: 'hidden',
justifyContent: 'space-between', // Всё содержимое справа
justifyContent: 'space-between',
alignItems: 'center',
}}
>
{/* Левая часть */}
<Box
sx={{
display: 'flex',
@ -76,6 +92,23 @@ export default function TopBar({ onRegister }: TopBarProps) {
</Button>
)}
</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
sx={{