Skip to content

Commit 9d5ca66

Browse files
authored
Merge pull request #59 from CS3219-AY2425S1/sidebar
Update UI for sidebar
2 parents d3ab8cb + a72b225 commit 9d5ca66

File tree

1 file changed

+20
-2
lines changed

1 file changed

+20
-2
lines changed

Frontend/src/components/Sidebar.jsx

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,13 @@ function Sidebar() {
3131

3232
const navigate = useNavigate();
3333

34+
// Static array for difficulty options
35+
const difficultyLevels = [
36+
{ label: 'Easy', value: 'easy' },
37+
{ label: 'Medium', value: 'medium' },
38+
{ label: 'Hard', value: 'hard' },
39+
];
40+
3441
useEffect(() => {
3542
// Fetch categories from backend
3643
const fetchCategories = async () => {
@@ -129,11 +136,22 @@ function Sidebar() {
129136
</Card.Text>
130137
</Card.Body>
131138
</Card>
132-
<div>
139+
{/* <div>
133140
<Button variant="success" onClick={() => setDifficulty('easy')}>Easy</Button>{' '}
134141
<Button variant="warning" onClick={() => setDifficulty('medium')}>Medium</Button>{' '}
135142
<Button variant="danger" onClick={() => setDifficulty('hard')}>Hard</Button>{' '}
136-
</div>
143+
</div> */}
144+
<Form.Select
145+
aria-label="Select difficulty"
146+
onChange={(e) => setDifficulty(e.target.value)}
147+
>
148+
<option value="">Select difficulty</option>
149+
{difficultyLevels.map((level) => (
150+
<option key={level.value} value={level.value}>
151+
{level.label}
152+
</option>
153+
))}
154+
</Form.Select>
137155

138156
{/* Category Dropdown */}
139157
<Form.Select

0 commit comments

Comments
 (0)