feat: update styles
add: TopBar title
This commit is contained in:
@ -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={{
|
||||
|
Reference in New Issue
Block a user