Skip to content

Commit 9c0a867

Browse files
Merge branch 'main' of https://github.com/DevLoversTeam/devlovers.net into develop
2 parents d0d6406 + c36c403 commit 9c0a867

6 files changed

Lines changed: 91 additions & 52 deletions

File tree

frontend/app/[locale]/quiz/[slug]/page.tsx

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,18 +9,22 @@ import { getCurrentUser } from '@/lib/auth';
99

1010
type MetadataProps = { params: Promise<{ locale: string; slug: string }> };
1111

12-
export async function generateMetadata({ params }: MetadataProps): Promise<Metadata> {
12+
export async function generateMetadata({
13+
params,
14+
}: MetadataProps): Promise<Metadata> {
1315
const { locale, slug } = await params;
1416
const t = await getTranslations({ locale, namespace: 'quiz.page' });
1517
const quiz = await getQuizBySlug(slug, locale);
16-
18+
1719
if (!quiz) {
1820
return { title: t('notFoundTitle') };
1921
}
20-
22+
2123
return {
2224
title: `${quiz.title} | ${t('metaSuffix')}`,
23-
description: quiz.description ?? t('metaDescriptionFallback', { title: quiz.title ?? '' }),
25+
description:
26+
quiz.description ??
27+
t('metaDescriptionFallback', { title: quiz.title ?? '' }),
2428
};
2529
}
2630

@@ -52,10 +56,10 @@ export default async function QuizPage({
5256

5357
const seed = Number.parseInt(seedParam, 10);
5458
if (Number.isNaN(seed)) {
55-
// eslint-disable-next-line react-hooks/purity -- redirect throws, value never used in render
59+
// eslint-disable-next-line react-hooks/purity -- redirect throws, value never used in render
5660
redirect(`/${locale}/quiz/${slug}?seed=${Date.now()}`);
5761
}
58-
62+
5963
const questions = await getQuizQuestionsRandomized(quiz.id, locale, seed);
6064

6165
const clientQuestions = stripCorrectAnswers(questions);

frontend/app/[locale]/quizzes/page.tsx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,12 @@ import { getCurrentUser } from '@/lib/auth';
88

99
type PageProps = { params: Promise<{ locale: string }> };
1010

11-
export async function generateMetadata({ params }: PageProps): Promise<Metadata> {
11+
export async function generateMetadata({
12+
params,
13+
}: PageProps): Promise<Metadata> {
1214
const { locale } = await params;
1315
const t = await getTranslations({ locale, namespace: 'quiz.list' });
14-
16+
1517
return {
1618
title: t('metaTitle'),
1719
description: t('metaDescription'),

frontend/app/not-found.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ export default async function NotFound() {
2828
<div className="pointer-events-none absolute inset-0 opacity-60">
2929
<div className="absolute -top-32 left-1/2 h-96 w-xl -translate-x-1/2 rounded-full bg-(--accent-primary)/20 blur-3xl" />
3030
<div className="absolute -bottom-48 left-1/4 h-88 w-88 rounded-full bg-(--accent-hover)/15 blur-3xl" />
31-
<div className="absolute -bottom-40 right-0 h-104 w-104 rounded-full bg-(--accent-primary)/25 blur-3xl" />
31+
<div className="absolute right-0 -bottom-40 h-104 w-104 rounded-full bg-(--accent-primary)/25 blur-3xl" />
3232
</div>
3333

3434
<div className="pointer-events-none absolute inset-0 opacity-40 dark:opacity-60">

frontend/components/quiz/CountdownTimer.tsx

Lines changed: 12 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -25,12 +25,11 @@ export function CountdownTimer({
2525
const [isSynced, setIsSynced] = useState(false);
2626
const [prevEndTime, setPrevEndTime] = useState(endTime);
2727

28-
if (endTime !== prevEndTime) {
29-
setPrevEndTime(endTime);
30-
setIsSynced(false);
31-
setRemainingSeconds(timeLimitSeconds);
32-
}
33-
28+
if (endTime !== prevEndTime) {
29+
setPrevEndTime(endTime);
30+
setIsSynced(false);
31+
setRemainingSeconds(timeLimitSeconds);
32+
}
3433

3534
useEffect(() => {
3635
if (!isActive) return;
@@ -57,7 +56,6 @@ export function CountdownTimer({
5756
return () => clearInterval(interval);
5857
}, [isActive, onTimeUp, endTime]);
5958

60-
6159
useEffect(() => {
6260
if (!isActive) return;
6361

@@ -116,12 +114,11 @@ export function CountdownTimer({
116114

117115
<div className="h-2 overflow-hidden rounded-full bg-gray-200 dark:bg-gray-700">
118116
<div
119-
className={cn(
120-
'h-full',
121-
isSynced && 'transition-all duration-1000 ease-linear',
122-
getProgressBarColor()
123-
)}
124-
117+
className={cn(
118+
'h-full',
119+
isSynced && 'transition-all duration-1000 ease-linear',
120+
getProgressBarColor()
121+
)}
125122
style={{ width: `${percentage}%` }}
126123
/>
127124
</div>
@@ -138,7 +135,8 @@ export function CountdownTimer({
138135
</>
139136
) : (
140137
<>
141-
<Clock className="inline h-4 w-4" aria-hidden="true" /> {t('hurryUp')}
138+
<Clock className="inline h-4 w-4" aria-hidden="true" />{' '}
139+
{t('hurryUp')}
142140
</>
143141
)}
144142
</p>

frontend/package-lock.json

Lines changed: 16 additions & 16 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)