Skip to content

Commit 930bd71

Browse files
authored
Merge pull request #118 from Varstak/staging
Edited UI
2 parents 86bed2b + 9eda75b commit 930bd71

File tree

2 files changed

+48
-7
lines changed

2 files changed

+48
-7
lines changed

.DS_Store

0 Bytes
Binary file not shown.

frontend/components/QuestionsPage/FilterBar.tsx

Lines changed: 48 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// FilterBar.tsx
22
import * as React from 'react';
33
import FilterSelector from './FilterSelector'; // Import your FilterSelector component
4-
import { Box, Button } from '@mui/material';
4+
import { Box, Button, Grid, Typography } from '@mui/material';
55

66
interface FilterBarProps {
77
categoryOptions: { value: number; label: string }[];
@@ -30,13 +30,54 @@ const FilterBar: React.FC<FilterBarProps> = ({
3030
};
3131

3232
return (
33-
<Box sx={{paddingX: 2, paddingY: 1}}>
34-
<FilterSelector options={categoryOptions} selectedValues={selectedCategories} onChange={setSelectedCategories} />
35-
<FilterSelector options={difficultyOptions} selectedValues={selectedDifficulties} onChange={setSelectedDifficulties} />
36-
<Button onClick={handleApplyFilters}>Apply Filters</Button>
37-
<Button onClick={handleResetFilters}>Reset Filters</Button>
33+
<Box sx={{ padding: 2 }}>
34+
<Grid container spacing={2}>
35+
<Grid item>
36+
<Box>
37+
<Typography variant="h6" gutterBottom>
38+
Category
39+
</Typography>
40+
<FilterSelector
41+
options={categoryOptions}
42+
selectedValues={selectedCategories}
43+
onChange={setSelectedCategories}
44+
/>
45+
</Box>
46+
</Grid>
47+
<Grid item>
48+
<Box>
49+
<Typography variant="h6" gutterBottom>
50+
Difficulty
51+
</Typography>
52+
<FilterSelector
53+
options={difficultyOptions}
54+
selectedValues={selectedDifficulties}
55+
onChange={setSelectedDifficulties}
56+
/>
57+
</Box>
58+
</Grid>
59+
<Grid item>
60+
<Button
61+
onClick={handleApplyFilters}
62+
variant="contained"
63+
className="bg-blue-400"
64+
>
65+
Apply Filters
66+
</Button>
67+
</Grid>
68+
<Grid item>
69+
<Button
70+
onClick={handleResetFilters}
71+
variant="contained"
72+
className="bg-blue-400"
73+
>
74+
Reset Filters
75+
</Button>
76+
</Grid>
77+
</Grid>
3878
</Box>
39-
);
79+
80+
);
4081
};
4182

4283
export default FilterBar;

0 commit comments

Comments
 (0)