From 10304d03036d5bd89d2a220b013f4e9e045225a4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20DOREAU?= Date: Sun, 13 Sep 2020 23:48:48 +0200 Subject: [PATCH] style(core): update CheckBoxTree styles --- .../CheckboxTree/CheckboxTree.stories.tsx | 2 +- .../components/CheckboxTree/CheckboxTree.tsx | 21 +++++++++++++++---- 2 files changed, 18 insertions(+), 5 deletions(-) diff --git a/packages/core/src/components/CheckboxTree/CheckboxTree.stories.tsx b/packages/core/src/components/CheckboxTree/CheckboxTree.stories.tsx index 04d4c41451..58abb4af0f 100644 --- a/packages/core/src/components/CheckboxTree/CheckboxTree.stories.tsx +++ b/packages/core/src/components/CheckboxTree/CheckboxTree.stories.tsx @@ -65,5 +65,5 @@ export default { }; export const Default = () => ( - + ); diff --git a/packages/core/src/components/CheckboxTree/CheckboxTree.tsx b/packages/core/src/components/CheckboxTree/CheckboxTree.tsx index 386b02053a..dc962ea0b5 100644 --- a/packages/core/src/components/CheckboxTree/CheckboxTree.tsx +++ b/packages/core/src/components/CheckboxTree/CheckboxTree.tsx @@ -22,6 +22,7 @@ import { Checkbox, ListItemText, Collapse, + Typography } from '@material-ui/core'; import ExpandLess from '@material-ui/icons/ExpandLess'; import ExpandMore from '@material-ui/icons/ExpandMore'; @@ -34,12 +35,20 @@ const useStyles = makeStyles((theme: Theme) => createStyles({ root: { width: '100%', + minWidth: 10, maxWidth: 360, - backgroundColor: theme.palette.background.paper, + backgroundColor: 'transparent', + "&:hover": { + backgroundColor: "transparent" + } }, nested: { - paddingLeft: theme.spacing(4), + paddingLeft: theme.spacing(5), + height: '32px' }, + listItemIcon: { + minWidth: 10 + } }), ); @@ -69,6 +78,7 @@ type Option = { type Props = { subCategories: SubCategory[]; + label: string; }; /* REDUCER */ @@ -179,6 +189,8 @@ export const CheckboxTree = (props: Props) => { dispatch({ type: 'openCategory', payload: value }); }; return ( +
+ {props.label} {Object.values(state).map(item => { const labelId = `checkbox-list-label-${item?.label}`; @@ -195,7 +207,7 @@ export const CheckboxTree = (props: Props) => { }) } > - + { }) } > - + { ); })} +
); };