From ae09e7b7e4753f5ce19b5530f0adab2b9da333f7 Mon Sep 17 00:00:00 2001 From: AntoninoP Date: Wed, 3 Jul 2024 16:57:55 +0200 Subject: [PATCH] add effet loading --- src/components/CreateServer/CreateServer.jsx | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/components/CreateServer/CreateServer.jsx b/src/components/CreateServer/CreateServer.jsx index 17ca1f1..d27f57d 100644 --- a/src/components/CreateServer/CreateServer.jsx +++ b/src/components/CreateServer/CreateServer.jsx @@ -4,7 +4,7 @@ import { getUserSubdomain } from "../../service/firebase"; import { saveSubdomain } from "../../service/serverService"; const CreateServer = ({ user, onCreateServer }) => { - const [subdomain, setSubdomain] = useState(null); + const [subdomain, setSubdomain] = useState('loading'); // Utiliser 'loading' au lieu de null const [subdomainInput, setSubdomainInput] = useState(''); const loadSubdomain = async () => { @@ -33,9 +33,16 @@ const CreateServer = ({ user, onCreateServer }) => { } }; + if (subdomain === 'loading') { + return ( +
+
+ ); + } + return ( <> - {subdomain === null ? ( + {subdomain === '' ? (
Ecrivez votre sous domaine