refactor(web/menu): remove borders from context menu buttons

This commit is contained in:
Luke
2023-01-04 19:57:08 +01:00
parent 47047045c4
commit 0d442a5b8d
2 changed files with 10 additions and 4 deletions

View File

@@ -16,13 +16,16 @@ const useStyles = createStyles((theme, params: { disabled?: boolean }) => ({
inner: { inner: {
justifyContent: 'flex-start', justifyContent: 'flex-start',
}, },
root: {
border: 'none',
},
label: { label: {
width: '100%', width: '100%',
color: params.disabled ? theme.colors.dark[3] : theme.colors.dark[0], color: params.disabled ? theme.colors.dark[3] : theme.colors.dark[0],
whiteSpace: 'pre-wrap', whiteSpace: 'pre-wrap',
}, },
description: { description: {
color: params.disabled ? theme.colors.dark[3] : theme.colors.dark[2] color: params.disabled ? theme.colors.dark[3] : theme.colors.dark[2],
}, },
dropdown: { dropdown: {
padding: 10, padding: 10,
@@ -30,6 +33,7 @@ const useStyles = createStyles((theme, params: { disabled?: boolean }) => ({
fontSize: 14, fontSize: 14,
maxWidth: 256, maxWidth: 256,
width: 'fit-content', width: 'fit-content',
border: 'none',
}, },
})); }));
@@ -49,7 +53,7 @@ const ContextButton: React.FC<{
> >
<HoverCard.Target> <HoverCard.Target>
<Button <Button
classNames={{ inner: classes.inner, label: classes.label }} classNames={{ inner: classes.inner, label: classes.label, root: classes.root }}
onClick={() => (!button.disabled ? (button.menu ? openMenu(button.menu) : clickContext(buttonKey)) : null)} onClick={() => (!button.disabled ? (button.menu ? openMenu(button.menu) : clickContext(buttonKey)) : null)}
variant="default" variant="default"
h="fit-content" h="fit-content"

View File

@@ -19,7 +19,9 @@ const useStyles = createStyles((theme, params: { canClose?: boolean }) => ({
justifyContent: 'center', justifyContent: 'center',
padding: 2, padding: 2,
}, },
root: {
border: 'none',
},
label: { label: {
color: params.canClose ? theme.colors.dark[0] : theme.colors.dark[2], color: params.canClose ? theme.colors.dark[0] : theme.colors.dark[2],
}, },
@@ -32,7 +34,7 @@ const HeaderButton: React.FC<Props> = ({ icon, canClose, iconSize, handleClick }
<Button <Button
variant="default" variant="default"
className={classes.button} className={classes.button}
classNames={{ label: classes.label }} classNames={{ label: classes.label, root: classes.root }}
disabled={canClose === false} disabled={canClose === false}
onClick={handleClick} onClick={handleClick}
> >