Skip to content

Commit bc31935

Browse files
committed
Created Form Selector component
Co-authored-by: buddhajjigae <[email protected]> Co-authored-by: xkevinpark <[email protected]> Co-authored-by: williamdyoon <[email protected]> Co-authored-by: MadinventorZero
1 parent 2d667fd commit bc31935

File tree

1 file changed

+35
-0
lines changed

1 file changed

+35
-0
lines changed

app/src/components/form/Selector.tsx

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
// 100% Caret
2+
import React from 'react';
3+
import FormControl from '@material-ui/core/FormControl';
4+
import Select from '@material-ui/core/Select';
5+
import MenuItem from '@material-ui/core/MenuItem';
6+
7+
const FormSelector = (props): JSX.Element => {
8+
const items = [];
9+
props.items.forEach(el => {
10+
items.push(<MenuItem value={el.value}>{el.text}</MenuItem>);
11+
})
12+
return (
13+
<div className={props.classes.configRow}>
14+
<div className={props.isThemeLight ? `${props.classes.configType} ${props.classes.lightThemeFontColor}` : `${props.classes.configType} ${props.classes.darkThemeFontColor}`}>
15+
<h3>{props.title}</h3>
16+
</div>
17+
<div className={props.classes.configValue}>
18+
<FormControl variant="filled" className={props.classes.formControl}>
19+
<Select
20+
value={props.selectValue}
21+
name={props.name}
22+
onChange={props.handleChange}
23+
displayEmpty
24+
className={props.classes.select}
25+
inputProps={{ className: props.isThemeLight ? `${props.classes.selectInput} ${props.classes.lightThemeFontColor}` : `${props.classes.selectInput} ${props.classes.darkThemeFontColor}` }}
26+
>
27+
{items}
28+
</Select>
29+
</FormControl>
30+
</div>
31+
</div>
32+
);
33+
};
34+
35+
export default FormSelector;

0 commit comments

Comments
 (0)