Skip to content

Commit

Permalink
fix: fix sidebar spacing
Browse files Browse the repository at this point in the history
  • Loading branch information
jbcl-io committed Apr 20, 2021
1 parent c98d4b0 commit 0a541fe
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 23 deletions.
31 changes: 10 additions & 21 deletions src/components/SidebarComponents/FolderGroupTitle.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { makeStyles } from '@material-ui/core';
import { List, ListItem, ListItemSecondaryAction, makeStyles } from '@material-ui/core';
import { Icon } from 'react-feather';
import DefaultIconButton from '../Buttons/DefaultIconButton';

Expand All @@ -14,35 +14,24 @@ const FolderGroupTitle = (props: Props) => {
const classes = useStyles();

return (
<div className={classes.container}>
<div>{props.title}</div>
<div className={classes.iconButton}>
<List>
<ListItem className={classes.listItem}>{props.title}</ListItem>
<ListItemSecondaryAction>
<DefaultIconButton
label='Add Folder'
icon={props.iconButton.icon}
onClick={props.iconButton.onClick}
/>
</div>
</div>
</ListItemSecondaryAction>
</List>
);
};

const useStyles = makeStyles((theme) => ({
container: {
display: 'flex',
padding: `${theme.spacing(1)}px ${theme.spacing(4)}px`,
fontSize: '0.9rem',
fontWeight: theme.typography.fontWeightMedium,
textTransform: 'uppercase',
justifyContent: 'space-between',
position: 'relative',
opacity: 0.6,
},

iconButton: {
position: 'relative',
top: `-${theme.spacing(1.5)}px`,
right: `-${theme.spacing(1.5)}px`,
listItem: {
'&.MuiListItem-gutters': {
padding: `${theme.spacing(1)}px ${theme.spacing(5)}px`,
},
},
}));

Expand Down
2 changes: 1 addition & 1 deletion src/containers/Sidebar/Folders/ListGroup.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ const useStyles = makeStyles((theme) => ({

'& .MuiListItemIcon-root': {
minWidth: 'auto',
marginRight: theme.spacing(4),
marginRight: theme.spacing(3),
color: theme.palette.text.primary,
},
},
Expand Down
1 change: 0 additions & 1 deletion src/containers/Sidebar/Folders/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,6 @@ const Folders = () => {
secondaryAction: editingFolderId ? null : (
<IconButtonWithMenu
icon={MoreVertical}
size='small'
menuItems={[
{
label: 'Rename',
Expand Down

0 comments on commit 0a541fe

Please sign in to comment.