[+] Fixed basic warnings and indentation

This commit is contained in:
Charles Le Maux 2024-09-16 22:46:10 +02:00
parent 8adffc3212
commit 5484017ba7
2 changed files with 19 additions and 17 deletions

View File

@ -67,8 +67,9 @@ const CreateServer = ({ user, onCreateServer, onSubdomainUpdate, onCancel, noSer
};
useEffect(() => {
loadSubdomain();
}, [user]);
loadSubdomain().then(r => r);
},
[user]);
const handleSaveSubdomain = async () => {
try {

View File

@ -1,5 +1,5 @@
import { useEffect, useState } from 'react';
import ServerCard from '../../components/serverCard/serverCard';
import DefaultServerCard from '../../components/serverCards/DefaultServerCard.jsx';
import Navbar from '../../components/navbar/Navbar';
import styles from './DashboardPage.module.scss';
import Loading from '../Loading/loading';
@ -87,7 +87,7 @@ const DashboardPage = ({ user }) => {
const handleCopyAddress = () => {
const address = `${subdomain}.servii.fr`;
navigator.clipboard.writeText(address)
navigator.clipboard.writeText(address).then(r => r)
};
@ -116,6 +116,7 @@ const DashboardPage = ({ user }) => {
<CreateServer
user={user}
onCreateServer={handleCreateServerPage}
onSubdomainUpdate={setSubdomain}
onCancel={handleCancelCreateServer}
noServers
/>
@ -134,19 +135,19 @@ const DashboardPage = ({ user }) => {
Créer un nouveau serveur
</button>
{servers.map((server) => (
<ServerCard
key={server.id}
status={server.running}
version={server.version}
name={server.name}
framework={server.framework}
maxPlayers={server.maxPlayers}
countPlayers={server.onlinePlayers}
onRunClick={() => handleRunServer(server.name)}
onStopClick={() => handleStopServer(server.name)}
onDeleteClick={() => handleDeleteServer(server.name)}
subdomain={subdomain}
/>
<DefaultServerCard
key={server.id}
status={server.running}
version={server.version}
name={server.name}
framework={server.framework}
maxPlayers={server.maxPlayers}
countPlayers={server.onlinePlayers}
onRunClick={() => handleRunServer(server.name)}
onStopClick={() => handleStopServer(server.name)}
onDeleteClick={() => handleDeleteServer(server.name)}
subdomain={subdomain}
/>
))}
</div>
)}