Skip to content

Commit a72b225

Browse files
committed
Update UI for sidebar
1 parent b78f706 commit a72b225

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 () => {
@@ -120,11 +127,22 @@ function Sidebar() {
120127
</Card.Text>
121128
</Card.Body>
122129
</Card>
123-
<div>
130+
{/* <div>
124131
<Button variant="success" onClick={() => setDifficulty('easy')}>Easy</Button>{' '}
125132
<Button variant="warning" onClick={() => setDifficulty('medium')}>Medium</Button>{' '}
126133
<Button variant="danger" onClick={() => setDifficulty('hard')}>Hard</Button>{' '}
127-
</div>
134+
</div> */}
135+
<Form.Select
136+
aria-label="Select difficulty"
137+
onChange={(e) => setDifficulty(e.target.value)}
138+
>
139+
<option value="">Select difficulty</option>
140+
{difficultyLevels.map((level) => (
141+
<option key={level.value} value={level.value}>
142+
{level.label}
143+
</option>
144+
))}
145+
</Form.Select>
128146

129147
{/* Category Dropdown */}
130148
<Form.Select

0 commit comments

Comments
 (0)