ajout route creation serveur java

This commit is contained in:
AntoninoP 2024-09-18 18:15:49 +02:00
parent 08b566c35f
commit e18b9af60e
4 changed files with 47 additions and 1 deletions

View File

@ -10,6 +10,7 @@ import styles from './App.module.scss';
import Loading from './pages/Loading/loading';
import NotFoundPage from './pages/NotFoundPage/NotFoundPage';
import CreatePage from './pages/CreateServer/CreateServer';
import Javapick from './pages/CreateServer/Javapick/java';
const App = () => {
const [user, setUser] = useState(null);
@ -35,6 +36,7 @@ const App = () => {
<Route path="/login" element={user ? <Navigate to="/dashboard" /> : <LoginPage />} />
<Route path="/dashboard" element={user ? <DashboardPage user={user} /> : <Navigate to="/login" />} />
<Route path="/createServer" element={user ? <CreatePage user={user} /> : <Navigate to="/login" />} />
<Route path="/createServer/java" element={user ? <Javapick user={user} /> : <Navigate to="/login" />} />
<Route path="/server/:serverName/*" element={user ? <ServerDetails user={user} /> : <Navigate to="/login" />} />
<Route path="/" element={<Navigate to={user ? "/dashboard" : "/login"} />} />
<Route path="*" element={<NotFoundPage />} />

View File

@ -20,7 +20,7 @@ const CreateServer = ({ user }) => {
<div className={styles.title}>Création du serveur</div>
<div className={styles.subtitle}>De quels façon voulez-vous jouer ?</div>
<div className={styles.GamesContainer}>
<div className={styles.GameCard}>
<div className={styles.GameCard} onClick={() => navigate('/dashboard')}>
<img src="http://fakeimg.pl/250x150/"/>
<div className={styles.Gamesubtitle}>Java Edition</div>
<div className={styles.Gamedescription}>Lorem ipsum dolor sit, amet consectetur adipisiciiquid, do</div>

View File

@ -0,0 +1,41 @@
import styles from './java.module.scss';
import PropTypes from "prop-types";
import Navbar from '../../../components/navbar/Navbar';
import { useNavigate } from 'react-router-dom';
const Javapick = ({ user }) => {
const navigate = useNavigate();
return (
<div className={styles.Container}>
<Navbar
user={user}
hasShadow={true}
showBackButton={false}
onBackClick={() => navigate('/dashboard')}
/>
<div className={styles.hey}>
<h1>hello java</h1>
</div>
</div>
);
};
Javapick.propTypes = {
user: PropTypes.oneOfType([
PropTypes.shape({
uid: PropTypes.string.isRequired,
displayName: PropTypes.string,
email: PropTypes.string,
photoURL: PropTypes.string,
}),
]),
onCreateServer: PropTypes.func.isRequired,
onSubdomainUpdate: PropTypes.func.isRequired,
onCancel: PropTypes.func,
noServers: PropTypes.any
};
export default Javapick;

View File

@ -0,0 +1,3 @@
.hey{
margin-top: 15rem;
}