Skip to content

Commit

Permalink
Add padding to the ViewButton component (#718)
Browse files Browse the repository at this point in the history
  • Loading branch information
GoelBiju committed Jul 29, 2021
1 parent 169c806 commit 5cae6cb
Showing 1 changed file with 23 additions and 11 deletions.
34 changes: 23 additions & 11 deletions packages/datagateway-dataview/src/page/pageContainer.component.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -247,24 +247,36 @@ const NavBar = (props: {
);
};

const viewButtonStyles = makeStyles(
(theme: Theme): StyleRules =>
createStyles({
root: {
padding: theme.spacing(1),
},
})
);

const ViewButton = (props: {
viewCards: boolean;
handleButtonChange: () => void;
}): React.ReactElement => {
const [t] = useTranslation();
const classes = viewButtonStyles();

return (
<Button
className="tour-dataview-view-button"
aria-label="container-view-button"
variant="contained"
color="primary"
size="small"
endIcon={props.viewCards ? <ViewListIcon /> : <ViewAgendaIcon />}
onClick={() => props.handleButtonChange()}
>
{props.viewCards ? t('app.view_table') : t('app.view_cards')}
</Button>
<div className={classes.root}>
<Button
className="tour-dataview-view-button"
aria-label="container-view-button"
variant="contained"
color="primary"
size="small"
startIcon={props.viewCards ? <ViewListIcon /> : <ViewAgendaIcon />}
onClick={() => props.handleButtonChange()}
>
{props.viewCards ? t('app.view_table') : t('app.view_cards')}
</Button>
</div>
);
};

Expand Down

0 comments on commit 5cae6cb

Please sign in to comment.