-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'release-1.0.0' of github.com:tekdi/teachers-app into re…
…lease-1.0.0
- Loading branch information
Showing
14 changed files
with
407 additions
and
50 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,92 @@ | ||
import { | ||
Box, | ||
Checkbox, | ||
FormControl, | ||
InputLabel, | ||
ListItemText, | ||
MenuItem, | ||
Select, | ||
SelectChangeEvent, | ||
} from '@mui/material'; | ||
import React, { ChangeEvent, useState } from 'react'; | ||
|
||
import { useTheme } from '@mui/material/styles'; | ||
import { useTranslation } from 'next-i18next'; | ||
|
||
function SelectTopic() { | ||
const { t } = useTranslation(); | ||
const theme = useTheme<any>(); | ||
|
||
const [selectedValues, setSelectedValues] = useState<string[]>([]); | ||
|
||
const handleChange = (event: SelectChangeEvent<string[]>) => { | ||
const { | ||
target: { value }, | ||
} = event; | ||
setSelectedValues(typeof value === 'string' ? value.split(',') : value); | ||
}; | ||
|
||
return ( | ||
<Box sx={{ padding: '8px 16px' }}> | ||
<Box sx={{ mt: 2 }}> | ||
<FormControl fullWidth> | ||
<InputLabel | ||
style={{ | ||
color: theme?.palette?.warning['A200'], | ||
background: theme?.palette?.warning['A400'], | ||
padding: '2px 8px', | ||
}} | ||
id="demo-multiple-select-label" | ||
> | ||
{t('CENTER_SESSION.TOPIC')} | ||
</InputLabel> | ||
<Select | ||
labelId="demo-multiple-select-label" | ||
id="demo-multiple-select" | ||
multiple | ||
value={selectedValues} | ||
onChange={handleChange} | ||
renderValue={(selected) => (selected as string[]).join(', ')} | ||
style={{ borderRadius: '4px' }} | ||
className="topic-select" | ||
> | ||
{/* <MenuItem value={'Mathematics'}> | ||
<Checkbox | ||
sx={{ | ||
'&.Mui-checked': { | ||
color: theme?.palette?.warning['300'], | ||
}, | ||
}} | ||
checked={selectedValues.indexOf('Mathematics') > -1} | ||
/> | ||
<ListItemText primary="Mathematics" /> | ||
</MenuItem> | ||
{/* Add more MenuItem components as needed */} | ||
</Select> | ||
</FormControl> | ||
</Box> | ||
|
||
<Box sx={{ my: 2 }}> | ||
<FormControl fullWidth> | ||
<InputLabel | ||
style={{ color: theme?.palette?.warning['A200'] }} | ||
id="demo-simple-select-label" | ||
> | ||
{t('CENTER_SESSION.SUBTOPIC')} | ||
</InputLabel> | ||
<Select | ||
labelId="demo-simple-select-label" | ||
id="demo-simple-select" | ||
label="Subject" | ||
style={{ borderRadius: '4px' }} | ||
> | ||
{/* <MenuItem value={'Mathematics'}>Mathematics</MenuItem> */} | ||
</Select> | ||
</FormControl> | ||
</Box> | ||
</Box> | ||
); | ||
} | ||
|
||
export default SelectTopic; |
Oops, something went wrong.