Skip to content

Commit

Permalink
fix: lang in user detail
Browse files Browse the repository at this point in the history
  • Loading branch information
cesarombredane committed Dec 1, 2023
1 parent f482e26 commit 284732f
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 8 deletions.
8 changes: 8 additions & 0 deletions public/locales/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,14 @@
"division":"or sign in with",
"pass" : "Password"
},
"user_detail": {
"all_games": "All games :",
"in_progress": "In progress...",
"question": "Question ",
"statement": "Statement :",
"answer": "Answer :",
"grade": "Grade : "
},
"signout": "Sign out",
"dashboard": "Dashboard",
"users": "All users",
Expand Down
10 changes: 9 additions & 1 deletion public/locales/fr.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,20 @@
"login": {
"github": "Github",
"google": "Google",

"apple": "Apple",
"choice": "Choisissez un moyen de connection",
"connection" : "Se connecter",
"division": "ou connectez-vous avec",
"pass" : "Mot de passe"
},
"user_detail": {
"all_games": "Toutes les parties :",
"in_progress": "En cours...",
"question": "Question ",
"statement": "Intitulé :",
"answer": "Réponse :",
"grade": "Note : "
},
"signout": "Déconnexion",
"dashboard": "Tableau de bord",
"users": "Tout les utilisateurs",
Expand Down
20 changes: 13 additions & 7 deletions src/app/[lang]/admin/[userId]/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ export default async function AdminUserPage({ params }: { params: { lang: string
</CardContent>
</Card>
</div>
<div className="text-2xl font-bold">All games :</div>
<div className="text-2xl font-bold">{dictionnary.admin.user_detail.all_games}</div>
<Tabs defaultValue={user.games[0].id.toString()} className="space-y-4">
<TabsList>
{user.games.map((game, idx) => (
Expand All @@ -76,36 +76,42 @@ export default async function AdminUserPage({ params }: { params: { lang: string
<TabsContent key={game.id} value={game.id.toString()} className="space-y-4">
{game.progress !== -1 ? (
<div className="items-center">
<div className="text-xl font-medium">In progress...</div>
<div className="text-xl font-medium">question: {game.progress}</div>
<div className="text-xl font-medium">{dictionnary.admin.user_detail.in_progress}</div>
<div className="text-xl font-medium">
{dictionnary.admin.user_detail.question + game.progress}
</div>
</div>
) : (
<Accordion key={game.id} type="single" collapsible>
{game.answers?.map((answer, idx) => (
<AccordionItem value={answer.id.toString()} key={answer.id}>
<AccordionTrigger className="flex flex-row items-center justify-between space-y-0 pb-2">
<div className="text-sm font-medium">
Question {idx + 1} ({answer.difficulty})
{dictionnary.admin.user_detail.question + (idx + 1)} ({answer.difficulty})
</div>
</AccordionTrigger>
<AccordionContent>
<div className="grid grid-cols-2 gap-4">
<Card>
<CardHeader className="flex flex-row items-center justify-between space-y-0 pb-2">
<CardTitle className="text-sm font-medium">Statement :</CardTitle>
<CardTitle className="text-sm font-medium">
{dictionnary.admin.user_detail.statement}
</CardTitle>
</CardHeader>
<CardContent>
<p className="text-xs text-muted-foreground">{answer.statement}</p>
</CardContent>
</Card>
<Card>
<CardHeader className="flex flex-row items-center justify-between space-y-0 pb-2">
<CardTitle className="text-sm font-medium">Answer :</CardTitle>
<CardTitle className="text-sm font-medium">
{dictionnary.admin.user_detail.answer}
</CardTitle>
</CardHeader>
<CardContent>
<p className="text-xs text-muted-foreground">{answer.answer}</p>
</CardContent>
<CardFooter>Grade : {answer.grade}</CardFooter>
<CardFooter>{dictionnary.admin.user_detail.grade + answer.grade}</CardFooter>
</Card>
</div>
</AccordionContent>
Expand Down

0 comments on commit 284732f

Please sign in to comment.