Fix product filter input and select

This commit is contained in:
Krzysztof Bialoglowicz 2019-09-03 11:48:20 +02:00
parent ef6334b46b
commit b6529efd83
4 changed files with 19 additions and 11 deletions

View file

@ -60,21 +60,23 @@ const styles = (theme: Theme) =>
filterButton: { filterButton: {
alignItems: "center", alignItems: "center",
backgroundColor: fade(theme.palette.primary.main, 0.6), backgroundColor: fade(theme.palette.primary.main, 0.6),
borderRadius: "19px", borderRadius: "4px",
display: "flex", display: "flex",
height: "38px", height: "45px",
justifyContent: "space-around", justifyContent: "space-around",
margin: `0 ${theme.spacing.unit * 2}px ${theme.spacing.unit}px`, margin: `0 ${theme.spacing.unit * 2}px ${theme.spacing.unit}px`,
marginLeft: 0, marginLeft: 0,
padding: "0 16px" padding: "0 16px",
}, position: "relative",
filterLabel: { top: -5
marginBottom: theme.spacing.unit
}, },
paper: { paper: {
marginTop: theme.spacing.unit * 2, marginTop: theme.spacing.unit * 2,
padding: theme.spacing.unit * 2, padding: theme.spacing.unit * 2,
width: 240 width: 240,
"& p": {
paddingBottom: 10
}
}, },
popover: { popover: {
zIndex: 1 zIndex: 1

View file

@ -1,4 +1,4 @@
import FilledInput from "@material-ui/core/FilledInput"; import OutlinedInput from "@material-ui/core/OutlinedInput";
import FormControl from "@material-ui/core/FormControl"; import FormControl from "@material-ui/core/FormControl";
import FormHelperText from "@material-ui/core/FormHelperText"; import FormHelperText from "@material-ui/core/FormHelperText";
import InputLabel from "@material-ui/core/InputLabel"; import InputLabel from "@material-ui/core/InputLabel";
@ -65,14 +65,14 @@ export const SingleSelectField = withStyles(styles, {
> >
<InputLabel shrink={!!value}>{label}</InputLabel> <InputLabel shrink={!!value}>{label}</InputLabel>
<Select <Select
variant="filled" variant="outlined"
fullWidth fullWidth
renderValue={choiceValue => renderValue={choiceValue =>
choiceValue ? choicesByKey[choiceValue.toString()] : placeholder choiceValue ? choicesByKey[choiceValue.toString()] : placeholder
} }
value={value || ""} value={value || ""}
onChange={onChange} onChange={onChange}
input={<FilledInput name={name} />} input={<OutlinedInput name={name} labelWidth={180} />}
{...selectProps} {...selectProps}
> >
{choices.length > 0 ? ( {choices.length > 0 ? (

View file

@ -45,7 +45,8 @@ const useStyles = makeStyles(
actionContainer: { actionContainer: {
display: "flex", display: "flex",
flexWrap: "wrap", flexWrap: "wrap",
padding: `${theme.spacing.unit}px ${theme.spacing.unit * 3}px` padding: `${theme.spacing.unit * 2}px ${theme.spacing.unit *
3}px ${theme.spacing.unit / 2}px ${theme.spacing.unit * 3}px`
}, },
filterButton: { filterButton: {
alignItems: "center", alignItems: "center",

View file

@ -228,6 +228,11 @@ export default (colors: IThemeColors): Theme =>
borderColor: colors.input.border borderColor: colors.input.border
} }
}, },
MuiSelect: {
outlined: {
padding: ["15px 12px 17px", "!important"] as any
}
},
MuiSwitch: { MuiSwitch: {
bar: { bar: {
"$colorPrimary$checked + &": { "$colorPrimary$checked + &": {