Skip to content

Commit cb2999c

Browse files
committed
Refactor difficult component into another file
1 parent 1af37c3 commit cb2999c

File tree

3 files changed

+39
-27
lines changed

3 files changed

+39
-27
lines changed
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
"use client";
2+
3+
import { IoIosSettings } from "react-icons/io";
4+
import {
5+
Card,
6+
CardHeader,
7+
CardTitle,
8+
CardDescription,
9+
CardContent,
10+
} from "@/components/ui/card";
11+
import { Button } from "@/components/ui/button";
12+
13+
export default function DifficultyComponent() {
14+
return (
15+
<Card className="w-[80%] flex-1 m-10">
16+
<div className="flex w-full ">
17+
<IoIosSettings className="ml-3 mt-1 text-2xl" />
18+
<CardHeader className="ml-5 flex-1 ml-0 pl-3">
19+
<CardTitle className="text-2xl font-bold">Difficult Level</CardTitle>
20+
<CardDescription>
21+
Select one of more difficulty levels that you would like to practice
22+
</CardDescription>
23+
</CardHeader>
24+
</div>
25+
26+
<CardContent className="flex justify-evenly h-full items-center gap-3">
27+
<Button className="flex-1 h-[50%] bg-green-200 text-black">Easy</Button>
28+
29+
<Button className="flex-1 h-[50%] bg-yellow-200 text-black">
30+
Medium
31+
</Button>
32+
33+
<Button className="flex-1 h-[50%] bg-red-200 text-black">Hard</Button>
34+
</CardContent>
35+
</Card>
36+
);
37+
}

frontend/src/app/components/match/TopicsComponent.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
"use client";
22

3-
import { IoIosSettings } from "react-icons/io";
43
import { CiBookmark } from "react-icons/ci";
54
import {
65
Card,

frontend/src/app/match/page.tsx

Lines changed: 2 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ import {
99
} from "@/components/ui/card";
1010
import { Button } from "@/components/ui/button";
1111
import TopicsComponent from "../components/match/TopicsComponent";
12+
import DifficultyComponent from "../components/match/DifficultyComponent";
1213

1314
export default function MatchPage() {
1415
return (
@@ -20,32 +21,7 @@ export default function MatchPage() {
2021
</h1>
2122
</div>
2223

23-
<Card className="w-[80%] flex-1 m-10">
24-
<div className="flex w-full ">
25-
<IoIosSettings className="ml-3 mt-1 text-2xl" />
26-
<CardHeader className="ml-5 flex-1 ml-0 pl-3">
27-
<CardTitle className="text-2xl font-bold">
28-
Difficult Level
29-
</CardTitle>
30-
<CardDescription>
31-
Select one of more difficulty levels that you would like to
32-
practice
33-
</CardDescription>
34-
</CardHeader>
35-
</div>
36-
37-
<CardContent className="flex justify-evenly h-full items-center gap-3">
38-
<Button className="flex-1 h-[50%] bg-green-200 text-black">
39-
Easy
40-
</Button>
41-
42-
<Button className="flex-1 h-[50%] bg-yellow-200 text-black">
43-
Medium
44-
</Button>
45-
46-
<Button className="flex-1 h-[50%] bg-red-200 text-black">Hard</Button>
47-
</CardContent>
48-
</Card>
24+
<DifficultyComponent />
4925

5026
<TopicsComponent />
5127

0 commit comments

Comments
 (0)