[+] 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(() => { useEffect(() => {
loadSubdomain(); loadSubdomain().then(r => r);
}, [user]); },
[user]);
const handleSaveSubdomain = async () => { const handleSaveSubdomain = async () => {
try { try {

View File

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