add: background, custom topbar

This commit is contained in:
2025-07-07 04:41:17 +05:00
parent 261b9ac253
commit 76917e3f90
11 changed files with 291 additions and 28 deletions

View File

@ -8,6 +8,9 @@ import Login from './pages/Login';
import LaunchPage from './pages/LaunchPage';
import { ReactNode, useEffect, useState } from 'react';
import './App.css';
import TopBar from './components/TopBar';
import { Box } from '@mui/material';
import MinecraftBackround from './components/MinecraftBackround';
// Переместите launchOptions сюда, вне компонентов
const launchOptions = {
@ -71,19 +74,38 @@ const AuthCheck = ({ children }: { children: ReactNode }) => {
};
const App = () => {
// Просто используйте window.open без useNavigate
const handleRegister = () => {
window.open('https://account.ely.by/register', '_blank');
};
return (
<Router>
<Routes>
<Route path="/login" element={<Login />} />
<Route
path="/"
element={
<AuthCheck>
<LaunchPage launchOptions={launchOptions} />
</AuthCheck>
}
/>
</Routes>
<Box
sx={{
height: '100vh',
width: '100vw',
position: 'relative',
display: 'flex',
flexDirection: 'column',
alignItems: 'center',
justifyContent: 'center',
}}
>
<MinecraftBackround />
<TopBar onRegister={handleRegister} />
<Routes>
<Route path="/login" element={<Login />} />
<Route
path="/"
element={
<AuthCheck>
<LaunchPage launchOptions={launchOptions} />
</AuthCheck>
}
/>
</Routes>
</Box>
</Router>
);
};