refactor: Changement des IconTextInput en TextInput, modification du composant step

This commit is contained in:
Luc SORIGNET
2025-01-27 11:20:44 +01:00
parent 6f1631a75b
commit a248898203
16 changed files with 270 additions and 127 deletions

View File

@ -17,9 +17,10 @@ export default function Layout({
const router = useRouter(); // Définition de router
const [messages, setMessages] = useState([]);
const [userId, setUserId] = useLocalStorage("userId", '') ;
const [isLoading, setIsLoading] = useState(true);
useEffect(() => {
setIsLoading(true);
setUserId(userId)
fetchMessages(userId)
.then(data => {
@ -30,8 +31,15 @@ export default function Layout({
})
.catch(error => {
console.error('Error fetching data:', error);
})
.finally(() => {
setIsLoading(false);
});
}, []);
}, [userId]);
if (isLoading) {
return <div>Loading...</div>;
}
return (
<ProtectedRoute>