Skip to content

Commit c84a48a

Browse files
committed
Removing hydration warnings.
changing the game score component to use the new progress component.
1 parent 4e91653 commit c84a48a

File tree

2 files changed

+44
-22
lines changed

2 files changed

+44
-22
lines changed

app/layout.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,7 @@ export default function RootLayout({ children }: RootLayoutProps) {
9696
"min-h-screen bg-background font-sans antialiased",
9797
fontSans.variable
9898
)}
99+
suppressHydrationWarning
99100
>
100101
<ThemeProvider
101102
attribute="class"

components/game-score.tsx

Lines changed: 43 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -55,36 +55,57 @@ const UserProgressWidget = ({
5555
}, [completedCounts, totalGames, totalArticles, animatedArticleProgress, animatedGameProgress]);
5656

5757
return (
58-
<div className="bg-muted p-4 rounded-xl shadow-md mt-3 md:my-3">
59-
<div className="text-xl font-bold opacity-35 align-middle justify-end flex w-full">
60-
{" "}
61-
Your Progress
62-
<Trophy className="ml-2 text-yellow-500" />
58+
<div className="bg-gradient-to-br from-background to-muted/50 border border-border/50 rounded-2xl shadow-lg p-6 md:p-8 mt-4 md:mt-6 backdrop-blur-sm">
59+
{/* Header */}
60+
<div className="flex items-center justify-between mb-6 md:mb-8">
61+
<h3 className="text-lg md:text-xl font-bold text-foreground flex items-center gap-2">
62+
Your Progress
63+
<Trophy className="w-5 h-5 md:w-6 md:h-6 text-yellow-500" />
64+
</h3>
6365
</div>
64-
<div className="space-y-2 grid grid-cols-1 md:grid-cols-2 xl:gap-9">
65-
<div className="self-end">
66-
<div className="flex justify-between items-center mb-2">
67-
<span className="flex items-center">
68-
<ControllerIcon />
69-
Games Completed
70-
</span>
71-
<span className=" ml-2 font-semibold">
66+
67+
{/* Progress Items */}
68+
<div className="space-y-4 md:space-y-6">
69+
{/* Games Progress */}
70+
<div className="space-y-2">
71+
<div className="flex items-center justify-between mb-2">
72+
<div className="flex items-center gap-2 md:gap-3">
73+
<div className="p-2 rounded-lg bg-primary/10">
74+
<ControllerIcon />
75+
</div>
76+
<span className="text-sm md:text-base font-medium text-foreground">
77+
Games Completed
78+
</span>
79+
</div>
80+
<span className="text-sm md:text-base font-bold text-foreground">
7281
{completedCounts.games} / {totalGames}
7382
</span>
7483
</div>
75-
<Progress value={animatedGameProgress} className="h-2" />
84+
<Progress
85+
value={animatedGameProgress}
86+
className="h-2.5 md:h-3 bg-muted"
87+
/>
7688
</div>
77-
<div className="self-end">
78-
<div className="flex justify-between items-center mb-2">
79-
<span className="flex items-center">
80-
<BookOpen className="mr-2 text-blue-500" />
81-
Articles Read
82-
</span>
83-
<span className="font-semibold">
89+
90+
{/* Articles Progress */}
91+
<div className="space-y-2">
92+
<div className="flex items-center justify-between mb-2">
93+
<div className="flex items-center gap-2 md:gap-3">
94+
<div className="p-2 rounded-lg bg-blue-500/10">
95+
<BookOpen className="w-4 h-4 md:w-5 md:h-5 text-blue-500" />
96+
</div>
97+
<span className="text-sm md:text-base font-medium text-foreground">
98+
Articles Read
99+
</span>
100+
</div>
101+
<span className="text-sm md:text-base font-bold text-foreground">
84102
{completedCounts.articles} / {totalArticles}
85103
</span>
86104
</div>
87-
<Progress value={animatedArticleProgress} className="h-2" />
105+
<Progress
106+
value={animatedArticleProgress}
107+
className="h-2.5 md:h-3 bg-muted"
108+
/>
88109
</div>
89110
</div>
90111
</div>

0 commit comments

Comments
 (0)