This commit is contained in:
AntoninoP 2024-09-21 11:58:40 +02:00
parent 55202271c8
commit b60dbf83e6
6 changed files with 13 additions and 34 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 MiB

After

Width:  |  Height:  |  Size: 153 KiB

View File

@ -31,8 +31,8 @@ const CreateServer = ({ user }) => {
</div> </div>
<div className={styles.GameCard} onClick={() => navigate('/CreateServer/bedrock')}> <div className={styles.GameCard} onClick={() => navigate('/CreateServer/bedrock')}>
<img src={bedrockimg} className={styles.imgCard}/> <img src={bedrockimg} className={styles.imgCard}/>
<div className={styles.Gamesubtitle}>Bedrock Edition</div> <div className={styles.Gamesubtitle}>Mini-jeu</div>
<div className={styles.Gamedescription}>Jouez à Minecraft sur mobile, tablette et consoles, avec des performances optimisées et un accès multiplateforme.</div> <div className={styles.Gamedescription}>Plongez dans Minecraft avec des cartes personnalisées et des règles uniques, en solo ou avec vos amis.</div>
<button className={styles.GameButton}>Choisir ce modèle </button> <button className={styles.GameButton}>Choisir ce modèle </button>
</div> </div>
<div className={styles.GameCard} onClick={() => navigate('/CreateServer/modpack')}> <div className={styles.GameCard} onClick={() => navigate('/CreateServer/modpack')}>
@ -56,10 +56,6 @@ CreateServer.propTypes = {
photoURL: PropTypes.string, photoURL: PropTypes.string,
}), }),
]), ]),
onCreateServer: PropTypes.func.isRequired,
onSubdomainUpdate: PropTypes.func.isRequired,
onCancel: PropTypes.func,
noServers: PropTypes.any
}; };
export default CreateServer; export default CreateServer;

View File

@ -33,10 +33,6 @@ Bedrock.propTypes = {
photoURL: PropTypes.string, photoURL: PropTypes.string,
}), }),
]), ]),
onCreateServer: PropTypes.func.isRequired,
onSubdomainUpdate: PropTypes.func.isRequired,
onCancel: PropTypes.func,
noServers: PropTypes.any
}; };
export default Bedrock; export default Bedrock;

View File

@ -33,10 +33,6 @@ Modpack.propTypes = {
photoURL: PropTypes.string, photoURL: PropTypes.string,
}), }),
]), ]),
onCreateServer: PropTypes.func.isRequired,
onSubdomainUpdate: PropTypes.func.isRequired,
onCancel: PropTypes.func,
noServers: PropTypes.any
}; };
export default Modpack; export default Modpack;

View File

@ -19,10 +19,6 @@ const DashboardPage = ({ user }) => {
const loadServers = useCallback(async () => { const loadServers = useCallback(async () => {
try { try {
const ApiResponse = await serviiApi.fetchServers();
const data = ApiResponse.message;
const sortedServers = data.sort((a, b) => b.running - a.running);
setServers(sortedServers);
if (user?.uid) { if (user?.uid) {
const userSubdomain = await getUserSubdomain(user.uid); const userSubdomain = await getUserSubdomain(user.uid);
@ -33,6 +29,13 @@ const DashboardPage = ({ user }) => {
} finally { } finally {
setLoading(false); setLoading(false);
} }
const ApiResponse = await serviiApi.fetchServers();
const data = ApiResponse.message;
const sortedServers = data.sort((a, b) => b.running - a.running);
setServers(sortedServers);
}, [user]); }, [user]);
useEffect(() => { useEffect(() => {
@ -106,7 +109,7 @@ const DashboardPage = ({ user }) => {
Bienvenue, {user?.displayName || ' '} ! Bienvenue, {user?.displayName || ' '} !
</h1> </h1>
<p className={styles.subdomainMessage}> <p className={styles.subdomainMessage}>
Le sous-domaine est le nom sous lequel vos amis et vous rejoignez le serveur. Choisissez-le bien, car il n'est pas facilement modifiable ! Le sous-domaine est le nom sous lequel vos amis et vous rejoignez le serveur. Choisissez-le bien, car il nest pas facilement modifiable !
</p> </p>
<div className={styles.subdomainInputContainer}> <div className={styles.subdomainInputContainer}>
<input <input
@ -117,7 +120,7 @@ const DashboardPage = ({ user }) => {
className={styles.subdomainInput} className={styles.subdomainInput}
onKeyPress={(e) => e.key === 'Enter' && handleSaveSubdomain()} onKeyPress={(e) => e.key === 'Enter' && handleSaveSubdomain()}
/> />
<button className={styles.btnCreate} onClick={handleSaveSubdomain}> <button className={styles.btnCreateSubdomain} onClick={handleSaveSubdomain}>
Envoyer Envoyer
</button> </button>
</div> </div>

View File

@ -134,25 +134,13 @@ html, body {
justify-content: center; justify-content: center;
align-items: center; align-items: center;
background-color: #2f2f2f; background-color: #2f2f2f;
border: none; padding: .80rem 1rem;
padding: .5rem 1rem;
cursor: pointer; cursor: pointer;
font-size: 1rem; font-size: 1rem;
font-weight: 600; font-weight: 600;
border-radius: 0.5rem; border: none;
color: white; color: white;
transition: background-color 0.3s ease; transition: background-color 0.3s ease;
margin-left: 1rem; margin-left: 1rem;
display: flex;
justify-content: center;
align-items: center;
background-color: #2f2f2f;
border: none;
padding: 0.75rem 1.5rem;
cursor: pointer;
font-size: 1rem;
font-weight: 600;
border-radius: 0.5rem; border-radius: 0.5rem;
color: white;
transition: background-color 0.3s ease;
} }