Skip to content

Commit

Permalink
Merge pull request #39 from kaleido-io/timeline-cleanup
Browse files Browse the repository at this point in the history
improve timeline appearance on smaller resolutions
  • Loading branch information
shorsher authored Jun 23, 2021
2 parents 3d0e531 + 7d465a8 commit 838b5e8
Show file tree
Hide file tree
Showing 7 changed files with 108 additions and 66 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "firefly-ui",
"version": "0.1.0",
"version": "0.1.1",
"private": true,
"dependencies": {
"@material-ui/core": "^4.11.4",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,10 @@ export const TimelineContentPanel: React.FC<Props> = ({
onClick={onClick}
>
<Grid container className={classes.container} direction="column">
<Grid item>
<Typography className={classes.title}>{title}</Typography>
<Grid className={classes.titleContainer} item>
<Typography noWrap className={classes.title}>
{title}
</Typography>
</Grid>
<Grid item>
<Typography className={classes.description}>
Expand All @@ -64,6 +66,9 @@ const useStyles = makeStyles((theme) => ({
padding: theme.spacing(2),
backgroundColor: theme.palette.timelineBackground.main,
},
titleContainer: {
maxWidth: 220,
},
title: {
fontWeight: 'bold',
fontSize: 14,
Expand Down
13 changes: 10 additions & 3 deletions src/views/Dashboard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -156,8 +156,14 @@ export const Dashboard: React.FC = () => {
}));

return (
<>
<Grid container wrap="nowrap" className={classes.root} direction="column">
<Grid container justify="center">
<Grid
container
item
wrap="nowrap"
className={classes.root}
direction="column"
>
<Grid container item direction="row">
<Grid className={classes.headerContainer} item>
<Typography variant="h4" className={classes.header}>
Expand Down Expand Up @@ -208,7 +214,7 @@ export const Dashboard: React.FC = () => {
</Grid>
</Grid>
</Grid>
</>
</Grid>
);
};

Expand All @@ -217,6 +223,7 @@ const useStyles = makeStyles((theme) => ({
paddingTop: 20,
paddingLeft: 120,
paddingRight: 120,
maxWidth: 1920,
[theme.breakpoints.down('sm')]: {
flexWrap: 'wrap',
},
Expand Down
50 changes: 29 additions & 21 deletions src/views/Data/Data.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -150,31 +150,38 @@ export const Data: React.FC = () => {

return (
<>
<Grid container wrap="nowrap" direction="column" className={classes.root}>
<Grid container spacing={2} item direction="row">
<Grid item>
<Typography className={classes.header} variant="h4">
{t('data')}
</Typography>
<Grid container justify="center">
<Grid
container
wrap="nowrap"
direction="column"
className={classes.root}
>
<Grid container spacing={2} item direction="row">
<Grid item>
<Typography className={classes.header} variant="h4">
{t('data')}
</Typography>
</Grid>
<Box className={classes.separator} />
<Grid item>
<FilterSelect
filter={createdFilter}
setFilter={setCreatedFilter}
filterItems={createdQueryOptions}
/>
</Grid>
</Grid>
<Box className={classes.separator} />
<Grid item>
<FilterSelect
filter={createdFilter}
setFilter={setCreatedFilter}
filterItems={createdQueryOptions}
<Grid container item>
<DataTable
minHeight="300px"
maxHeight="calc(100vh - 340px)"
{...{ columnHeaders }}
{...{ records }}
{...{ pagination }}
/>
</Grid>
</Grid>
<Grid container item>
<DataTable
minHeight="300px"
maxHeight="calc(100vh - 340px)"
{...{ columnHeaders }}
{...{ records }}
{...{ pagination }}
/>
</Grid>
</Grid>
{viewData && (
<DataDetails
Expand All @@ -194,6 +201,7 @@ const useStyles = makeStyles((theme) => ({
paddingTop: 20,
paddingLeft: 120,
paddingRight: 120,
maxWidth: 1920,
[theme.breakpoints.down('sm')]: {
flexWrap: 'wrap',
},
Expand Down
74 changes: 41 additions & 33 deletions src/views/Messages/Messages.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -197,41 +197,48 @@ export const Messages: React.FC = () => {

return (
<>
<Grid container wrap="nowrap" direction="column" className={classes.root}>
<Grid container spacing={2} item direction="row" alignItems="center">
<Grid item>
<Typography className={classes.header} variant="h4">
{t('messages')}
</Typography>
</Grid>
<Box className={classes.separator} />
<Grid item>
<FilterSelect
filter={createdFilter}
setFilter={setCreatedFilter}
filterItems={createdQueryOptions}
/>
</Grid>
<Grid item>
<DataViewSwitch />
<Grid container justify="center">
<Grid
container
wrap="nowrap"
direction="column"
className={classes.root}
>
<Grid container spacing={2} item direction="row" alignItems="center">
<Grid item>
<Typography className={classes.header} variant="h4">
{t('messages')}
</Typography>
</Grid>
<Box className={classes.separator} />
<Grid item>
<FilterSelect
filter={createdFilter}
setFilter={setCreatedFilter}
filterItems={createdQueryOptions}
/>
</Grid>
<Grid item>
<DataViewSwitch />
</Grid>
</Grid>
{dataView === 'timeline' && (
<Grid className={classes.timelineContainer} xs={12} container item>
<DataTimeline items={buildTimelineElements(messages)} />
</Grid>
)}
{dataView === 'list' && (
<Grid container item>
<DataTable
minHeight="300px"
maxHeight="calc(100vh - 340px)"
records={buildTableRecords(messages)}
{...{ columnHeaders }}
{...{ pagination }}
/>
</Grid>
)}
</Grid>
{dataView === 'timeline' && (
<Grid className={classes.timelineContainer} xs={12} container item>
<DataTimeline items={buildTimelineElements(messages)} />
</Grid>
)}
{dataView === 'list' && (
<Grid container item>
<DataTable
minHeight="300px"
maxHeight="calc(100vh - 340px)"
records={buildTableRecords(messages)}
{...{ columnHeaders }}
{...{ pagination }}
/>
</Grid>
)}
</Grid>
{viewMessage && (
<MessageDetails
Expand All @@ -252,6 +259,7 @@ const useStyles = makeStyles((theme) => ({
paddingTop: 20,
paddingLeft: 120,
paddingRight: 120,
maxWidth: 1920,
[theme.breakpoints.down('sm')]: {
flexWrap: 'wrap',
},
Expand Down
13 changes: 10 additions & 3 deletions src/views/Transactions/TransactionDetails.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,14 @@ export const TransactionDetails: React.FC = () => {
}

return (
<>
<Grid container wrap="nowrap" direction="column" className={classes.root}>
<Grid container justify="center">
<Grid
container
item
wrap="nowrap"
direction="column"
className={classes.root}
>
<Grid item>
<Button
className={classes.backButton}
Expand Down Expand Up @@ -209,7 +215,7 @@ export const TransactionDetails: React.FC = () => {
</Grid>
</Grid>
</Grid>
</>
</Grid>
);
};

Expand All @@ -218,6 +224,7 @@ const useStyles = makeStyles((theme) => ({
paddingTop: 20,
paddingLeft: 120,
paddingRight: 120,
maxWidth: 1920,
[theme.breakpoints.down('sm')]: {
flexWrap: 'wrap',
},
Expand Down
13 changes: 10 additions & 3 deletions src/views/Transactions/Transactions.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -180,8 +180,14 @@ export const Transactions: React.FC = () => {
}

return (
<>
<Grid container wrap="nowrap" direction="column" className={classes.root}>
<Grid container justify="center">
<Grid
container
item
wrap="nowrap"
direction="column"
className={classes.root}
>
<Grid container spacing={2} item direction="row">
<Grid item>
<Typography className={classes.header} variant="h4">
Expand Down Expand Up @@ -217,7 +223,7 @@ export const Transactions: React.FC = () => {
</Grid>
)}
</Grid>
</>
</Grid>
);
};

Expand All @@ -226,6 +232,7 @@ const useStyles = makeStyles((theme) => ({
paddingTop: 20,
paddingLeft: 120,
paddingRight: 120,
maxWidth: 1920,
[theme.breakpoints.down('sm')]: {
flexWrap: 'wrap',
},
Expand Down

0 comments on commit 838b5e8

Please sign in to comment.