fix(core): prettier on select component

This commit is contained in:
Rémi DOREAU
2020-09-08 00:14:08 +02:00
parent 1ff3fe165c
commit 5f2e659bea
4 changed files with 20 additions and 18 deletions
@@ -24,19 +24,17 @@ export default {
const SELECT_ITEMS = [
{
label: "test 1",
value: "test_1"
label: 'test 1',
value: 'test_1',
},
{
label: "test 2",
value: "test_2"
label: 'test 2',
value: 'test_2',
},
{
label: "test 3",
value: "test_3"
}
]
label: 'test 3',
value: 'test_3',
},
];
export const Default = () => (
<Select label="Default" items={SELECT_ITEMS} />
);
export const Default = () => <Select label="Default" items={SELECT_ITEMS} />;
@@ -110,9 +110,7 @@ export const SelectComponent = (props: Props) => {
onOpen={() => setOpening(false)}
onClose={() => setOpening(true)}
input={<BootstrapInput />}
IconComponent={() => (
isOpen ? <ClosedDropdown /> : <OpenedDropdown />
)}
IconComponent={() => (isOpen ? <ClosedDropdown /> : <OpenedDropdown />)}
MenuProps={{
anchorOrigin: {
vertical: 'bottom',
@@ -21,7 +21,7 @@ const useStyles = makeStyles(() =>
icon: {
position: 'absolute',
right: '4px',
pointerEvents: "none"
pointerEvents: 'none',
},
}),
);
@@ -34,7 +34,10 @@ const ClosedDropdown = () => {
fill="none"
xmlns="http://www.w3.org/2000/svg"
>
<path d="M7.5 8L6 9.5L12.0703 15.5703L18.1406 9.5L16.6406 8L12.0703 12.5703L7.5 8Z" fill="#616161"/>
<path
d="M7.5 8L6 9.5L12.0703 15.5703L18.1406 9.5L16.6406 8L12.0703 12.5703L7.5 8Z"
fill="#616161"
/>
</SvgIcon>
);
};
@@ -30,11 +30,14 @@ const OpenedDropdown = () => {
const classes = useStyles();
return (
<SvgIcon
className={classes.icon}
className={classes.icon}
fill="none"
xmlns="http://www.w3.org/2000/svg"
>
<path d="M16.5 16L18 14.5L11.9297 8.42969L5.85938 14.5L7.35938 16L11.9297 11.4297L16.5 16Z" fill="#616161"/>
<path
d="M16.5 16L18 14.5L11.9297 8.42969L5.85938 14.5L7.35938 16L11.9297 11.4297L16.5 16Z"
fill="#616161"
/>
</SvgIcon>
);
};