add: VersionExplorer, don't work first run Minecraft
This commit is contained in:
@ -1,7 +1,8 @@
|
||||
import { Box, Button, Typography } from '@mui/material';
|
||||
import CloseIcon from '@mui/icons-material/Close';
|
||||
import MinimizeIcon from '@mui/icons-material/Minimize';
|
||||
import { useLocation } from 'react-router-dom';
|
||||
import { useLocation, useNavigate } from 'react-router-dom';
|
||||
import ArrowBackIcon from '@mui/icons-material/ArrowBack';
|
||||
|
||||
declare global {
|
||||
interface Window {
|
||||
@ -24,6 +25,12 @@ export default function TopBar({ onRegister }: TopBarProps) {
|
||||
// Получаем текущий путь
|
||||
const location = useLocation();
|
||||
const isLoginPage = location.pathname === '/login';
|
||||
const isLaunchPage = location.pathname.startsWith('/launch');
|
||||
const navigate = useNavigate();
|
||||
|
||||
const handleLaunchPage = () => {
|
||||
navigate('/');
|
||||
};
|
||||
|
||||
return (
|
||||
<Box
|
||||
@ -38,9 +45,37 @@ export default function TopBar({ onRegister }: TopBarProps) {
|
||||
width: '100%',
|
||||
WebkitAppRegion: 'drag',
|
||||
overflow: 'hidden',
|
||||
justifyContent: 'flex-end', // Всё содержимое справа
|
||||
justifyContent: 'space-between', // Всё содержимое справа
|
||||
}}
|
||||
>
|
||||
<Box
|
||||
sx={{
|
||||
display: 'flex',
|
||||
WebkitAppRegion: 'no-drag',
|
||||
gap: '2vw',
|
||||
padding: '1em',
|
||||
alignItems: 'center',
|
||||
}}
|
||||
>
|
||||
{isLaunchPage && (
|
||||
<Button
|
||||
variant="outlined"
|
||||
color="primary"
|
||||
onClick={() => handleLaunchPage()}
|
||||
sx={{
|
||||
width: '3em',
|
||||
height: '3em',
|
||||
borderRadius: '50%',
|
||||
border: 'unset',
|
||||
color: 'white',
|
||||
minWidth: 'unset',
|
||||
minHeight: 'unset',
|
||||
}}
|
||||
>
|
||||
<ArrowBackIcon />
|
||||
</Button>
|
||||
)}
|
||||
</Box>
|
||||
{/* Правая часть со всеми кнопками */}
|
||||
<Box
|
||||
sx={{
|
||||
|
Reference in New Issue
Block a user