Made it so the pages update the user when loading

This commit is contained in:
Tiago Ribeiro
2023-04-21 12:18:24 +01:00
parent 713771d949
commit 1adfb7f3d5
5 changed files with 79 additions and 48 deletions

View File

@@ -60,15 +60,17 @@ export default function Stats({user}: {user: User}) {
<main className="w-full h-full min-h-[100vh] flex flex-col items-center bg-neutral-100 text-neutral-600">
<Navbar profilePicture={user.profilePicture} />
<div className="w-full h-full flex flex-col items-center justify-center p-4 relative gap-8">
<AutoComplete
value={autocompleteValue}
suggestions={items}
field="name"
onChange={(e) => setAutocompleteValue(e.target.value)}
completeMethod={search}
onSelect={(e) => setSelectedUser(e.value)}
dropdown
/>
{!isLoading && (
<AutoComplete
value={autocompleteValue}
suggestions={items}
field="name"
onChange={(e) => setAutocompleteValue(e.target.value)}
completeMethod={search}
onSelect={(e) => setSelectedUser(e.value)}
dropdown
/>
)}
<section className="flex flex-col gap-2 md:gap-4 w-full">
<div className="flex flex-col">