Skip to content

Commit

Permalink
fix: hydration issue in members space (#218)
Browse files Browse the repository at this point in the history
  • Loading branch information
Jayllyz authored Jun 30, 2024
1 parent e46134e commit aff9fd4
Show file tree
Hide file tree
Showing 3 changed files with 80 additions and 70 deletions.
4 changes: 2 additions & 2 deletions apps/admin/app/(dashboard)/dashboard/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ function Page(): JSX.Element {
<YAxis />
<Tooltip />
<Legend />
<Bar dataKey="members" fill="#8884d8" />
<Bar dataKey="members" fill="#8884d8" name={'Membres'} />
</BarChart>
</ResponsiveContainer>
) : (
Expand All @@ -117,7 +117,7 @@ function Page(): JSX.Element {
<YAxis />
<Tooltip />
<Legend />
<Bar dataKey="amount" fill="#82ca9d" />
<Bar dataKey="amount" fill="#82ca9d" name={'Montant (€)'} />
</BarChart>
</ResponsiveContainer>
) : (
Expand Down
20 changes: 13 additions & 7 deletions apps/client/app/(auth)/(members)/members/documents/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -174,13 +174,19 @@ export default function Documents() {
</Breadcrumb>
</div>
<div className="flex flex-wrap">
<DisplayFolderAndFiles
folder={folders}
onFolderClick={onFolderClick}
files={files}
onFileClick={viewFile}
currrentPath={currrentPath}
/>
{(files?.length ?? 0) > 0 || (folders?.length ?? 0) > 0 ? (
<DisplayFolderAndFiles
folder={folders}
onFolderClick={onFolderClick}
files={files}
onFileClick={viewFile}
currrentPath={currrentPath}
/>
) : (
<div className="flex items-center justify-center w-full h-full p-8">
<p className="text-gray-500">Aucun document disponible</p>
</div>
)}
</div>
</div>
);
Expand Down
126 changes: 65 additions & 61 deletions apps/client/app/(auth)/(members)/members/layout.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { ModeToggle } from '@repo/ui/components/toggleTheme';
import '@repo/ui/globals.css';
import { FileSearch, Flame, Home, LineChart, MessageSquareMore, Trophy, Users } from 'lucide-react';
import Link from 'next/link';
Expand All @@ -8,68 +9,71 @@ export default function RootLayout({
children: React.ReactNode;
}): JSX.Element {
return (
<html lang="fr">
<body className="min-h-screen bg-background font-sans antialiased">
<div className="grid min-h-screen w-full md:grid-cols-[220px_1fr] lg:grid-cols-[280px_1fr]">
<div className="hidden border-r bg-muted/40 md:block">
<div className="flex h-full max-h-screen flex-col gap-2">
<div className="flex h-14 items-center border-b px-4 lg:h-[60px] lg:px-6">
<Link href="/" className="flex items-center gap-2 font-semibold">
<Flame className="h-6 w-6 text-primary" />
<span className="">Escape membre Athlonix</span>
</Link>
</div>
<div className="flex-1">
<nav className="grid items-start px-2 text-sm font-medium lg:px-4">
<Link
href="/members"
className="flex items-center gap-3 rounded-lg px-3 py-2 text-muted-foreground transition-all hover:text-primary"
>
<Home className="h-4 w-4" />
Accueil
</Link>
<Link
href="/members/activities"
className="flex items-center gap-3 rounded-lg px-3 py-2 text-muted-foreground transition-all hover:text-primary"
>
<Users className="h-4 w-4" />
Activités
</Link>
<Link
href="/members/tournaments"
className="flex items-center gap-3 rounded-lg px-3 py-2 text-muted-foreground transition-all hover:text-primary"
>
<Trophy className="h-4 w-4" />
Tournois
</Link>
<Link
href="/members/chat"
className="flex items-center gap-3 rounded-lg px-3 py-2 text-muted-foreground transition-all hover:text-primary"
>
<MessageSquareMore className="h-4 w-4" />
Messagerie
</Link>
<Link
href="/members/documents"
className="flex items-center gap-3 rounded-lg px-3 py-2 text-muted-foreground transition-all hover:text-primary"
>
<FileSearch className="h-4 w-4" />
Documents
</Link>
<Link
href="/members/votes"
className="flex items-center gap-3 rounded-lg px-3 py-2 text-muted-foreground transition-all hover:text-primary"
>
<LineChart className="h-4 w-4" />
Votes
</Link>
</nav>
</div>
</div>
<div className="grid min-h-screen w-full md:grid-cols-[220px_1fr] lg:grid-cols-[280px_1fr]">
<div className="hidden border-r bg-muted/40 md:block">
<div className="flex h-full max-h-screen flex-col gap-2">
<div className="flex h-14 items-center border-b px-4 lg:h-[60px] lg:px-6">
<Link href="/" className="flex items-center gap-2 font-semibold">
<Flame className="h-6 w-6 text-primary" />
<span className="">Escape membre Athlonix</span>
</Link>
</div>
<div className="flex-1">
<nav className="grid items-start px-2 text-sm font-medium lg:px-4">
<Link
href="/members"
className="flex items-center gap-3 rounded-lg px-3 py-2 text-muted-foreground transition-all hover:text-primary"
>
<Home className="h-4 w-4" />
Accueil
</Link>
<Link
href="/members/activities"
className="flex items-center gap-3 rounded-lg px-3 py-2 text-muted-foreground transition-all hover:text-primary"
>
<Users className="h-4 w-4" />
Activités
</Link>
<Link
href="/members/tournaments"
className="flex items-center gap-3 rounded-lg px-3 py-2 text-muted-foreground transition-all hover:text-primary"
>
<Trophy className="h-4 w-4" />
Tournois
</Link>
<Link
href="/members/chat"
className="flex items-center gap-3 rounded-lg px-3 py-2 text-muted-foreground transition-all hover:text-primary"
>
<MessageSquareMore className="h-4 w-4" />
Messagerie
</Link>
<Link
href="/members/documents"
className="flex items-center gap-3 rounded-lg px-3 py-2 text-muted-foreground transition-all hover:text-primary"
>
<FileSearch className="h-4 w-4" />
Documents
</Link>
<Link
href="/members/votes"
className="flex items-center gap-3 rounded-lg px-3 py-2 text-muted-foreground transition-all hover:text-primary"
>
<LineChart className="h-4 w-4" />
Votes
</Link>
</nav>
</div>
<div className="flex flex-col h-full">{children}</div>
</div>
</body>
</html>
</div>
<div className="flex flex-col h-full">
<header className="flex h-14 items-center gap-4 border-b bg-muted/40 px-4 lg:h-[60px] lg:px-6">
<div className="flex items-center gap-4 ml-auto">
<ModeToggle />
</div>
</header>
{children}
</div>
</div>
);
}

0 comments on commit aff9fd4

Please sign in to comment.