-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #230 from Dudrie/issue-222-Add_overview_page_for_a…
…dmin_which_shows_the_results_of_a_criteria Add overview page for admin which shows the results of a criteria
- Loading branch information
Showing
33 changed files
with
817 additions
and
470 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
import { CircularProgress, PaperProps } from '@material-ui/core'; | ||
import { createStyles, makeStyles, useTheme } from '@material-ui/core/styles'; | ||
import React from 'react'; | ||
import Chart from 'react-google-charts'; | ||
import { ReactGoogleChartProps } from 'react-google-charts/dist/types'; | ||
import InfoPaper from './InfoPaper'; | ||
|
||
const useStyles = makeStyles(theme => | ||
createStyles({ | ||
summaryPaper: { | ||
flex: 1, | ||
background: theme.palette.background.default, | ||
padding: theme.spacing(1.5), | ||
}, | ||
title: { | ||
textAlign: 'center', | ||
}, | ||
chart: { | ||
width: '100%', | ||
height: '100%', | ||
}, | ||
loader: { | ||
position: 'absolute', | ||
top: '50%', | ||
left: '50%', | ||
}, | ||
}) | ||
); | ||
|
||
interface Props extends ReactGoogleChartProps { | ||
title: string; | ||
PaperProps?: PaperProps; | ||
} | ||
|
||
function ChartPaper({ PaperProps, title, ...chartProps }: Props): JSX.Element { | ||
const classes = useStyles(); | ||
const theme = useTheme(); | ||
const { fontStyle } = theme.mixins.chart(theme); | ||
|
||
return ( | ||
<InfoPaper title={title} {...PaperProps}> | ||
<Chart | ||
{...chartProps} | ||
options={{ | ||
backgroundColor: 'transparent', | ||
...fontStyle, | ||
...chartProps.options, | ||
legend: { | ||
...fontStyle, | ||
...chartProps.options?.legend, | ||
}, | ||
hAxis: { | ||
...fontStyle, | ||
...chartProps.options?.hAxis, | ||
baselineColor: theme.palette.text.primary, | ||
}, | ||
vAxis: { | ||
...fontStyle, | ||
...chartProps.options?.vAxis, | ||
baselineColor: theme.palette.text.primary, | ||
}, | ||
}} | ||
className={classes.chart} | ||
loader={<CircularProgress className={classes.loader} />} | ||
/> | ||
</InfoPaper> | ||
); | ||
} | ||
|
||
export default ChartPaper; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
import { Paper, PaperProps, Typography } from '@material-ui/core'; | ||
import { createStyles, makeStyles } from '@material-ui/core/styles'; | ||
import clsx from 'clsx'; | ||
import React from 'react'; | ||
|
||
const useStyles = makeStyles(theme => | ||
createStyles({ | ||
summaryPaper: { | ||
flex: 1, | ||
background: theme.palette.background.default, | ||
padding: theme.spacing(1.5), | ||
position: 'relative', | ||
}, | ||
title: { | ||
textAlign: 'center', | ||
}, | ||
}) | ||
); | ||
|
||
interface Props extends PaperProps { | ||
title: string; | ||
children?: React.ReactNode; | ||
} | ||
|
||
function InfoPaper({ children, title, className, ...props }: Props): JSX.Element { | ||
const classes = useStyles(); | ||
|
||
return ( | ||
<Paper variant='outlined' {...props} className={clsx(className, classes.summaryPaper)}> | ||
<Typography className={classes.title}>{title}</Typography> | ||
|
||
{children} | ||
</Paper> | ||
); | ||
} | ||
|
||
export default InfoPaper; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.