-
Notifications
You must be signed in to change notification settings - Fork 155
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
52b75ff
commit d287e74
Showing
21 changed files
with
776 additions
and
12 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -94,4 +94,5 @@ typings/ | |
.vscode/* | ||
|
||
avatars/ | ||
images/ | ||
images/ | ||
react-material-dashboard-master/ |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
65 changes: 65 additions & 0 deletions
65
client/src/pages/Admin/DashboardPage/components/LatestSales/LatestSales.js
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,65 @@ | ||
import React from 'react'; | ||
import classnames from 'classnames'; | ||
import PropTypes from 'prop-types'; | ||
import { Bar } from 'react-chartjs-2'; | ||
import { makeStyles } from '@material-ui/styles'; | ||
import { | ||
Card, | ||
CardHeader, | ||
CardContent, | ||
CardActions, | ||
Divider, | ||
Button | ||
} from '@material-ui/core'; | ||
import ArrowDropDownIcon from '@material-ui/icons/ArrowDropDown'; | ||
import ArrowRightIcon from '@material-ui/icons/ArrowRight'; | ||
|
||
import { data, options } from './chart'; | ||
|
||
const useStyles = makeStyles(() => ({ | ||
root: {}, | ||
chartContainer: { | ||
height: 400, | ||
position: 'relative' | ||
}, | ||
actions: { | ||
justifyContent: 'flex-end' | ||
} | ||
})); | ||
|
||
const LatestSales = props => { | ||
const { className } = props; | ||
|
||
const classes = useStyles(); | ||
|
||
return ( | ||
<Card className={classnames(classes.root, className)}> | ||
<CardHeader | ||
action={ | ||
<Button size="small" variant="text"> | ||
Last 7 days <ArrowDropDownIcon /> | ||
</Button> | ||
} | ||
title="Latest Sales" | ||
/> | ||
<Divider /> | ||
<CardContent> | ||
<div className={classes.chartContainer}> | ||
<Bar data={data} options={options} /> | ||
</div> | ||
</CardContent> | ||
<Divider /> | ||
<CardActions className={classes.actions}> | ||
<Button color="primary" size="small" variant="text"> | ||
Overview <ArrowRightIcon /> | ||
</Button> | ||
</CardActions> | ||
</Card> | ||
); | ||
}; | ||
|
||
LatestSales.propTypes = { | ||
className: PropTypes.string | ||
}; | ||
|
||
export default LatestSales; |
72 changes: 72 additions & 0 deletions
72
client/src/pages/Admin/DashboardPage/components/LatestSales/chart.js
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,72 @@ | ||
import palette from '../../../../../theme/palette'; | ||
|
||
export const data = { | ||
labels: ['1 Aug', '2 Aug', '3 Aug', '4 Aug', '5 Aug', '6 Aug'], | ||
datasets: [ | ||
{ | ||
label: 'This year', | ||
backgroundColor: palette.primary.main, | ||
data: [18, 5, 19, 27, 29, 19, 20] | ||
}, | ||
{ | ||
label: 'Last year', | ||
backgroundColor: palette.neutral, | ||
data: [11, 20, 12, 29, 30, 25, 13] | ||
} | ||
] | ||
}; | ||
|
||
export const options = { | ||
responsive: true, | ||
maintainAspectRatio: false, | ||
animation: false, | ||
legend: { display: false }, | ||
cornerRadius: 20, | ||
tooltips: { | ||
enabled: true, | ||
mode: 'index', | ||
intersect: false, | ||
borderWidth: 1, | ||
borderColor: palette.divider, | ||
backgroundColor: palette.white, | ||
titleFontColor: palette.text.primary, | ||
bodyFontColor: palette.text.secondary, | ||
footerFontColor: palette.text.secondary | ||
}, | ||
layout: { padding: 0 }, | ||
scales: { | ||
xAxes: [ | ||
{ | ||
barThickness: 12, | ||
maxBarThickness: 10, | ||
barPercentage: 0.5, | ||
categoryPercentage: 0.5, | ||
ticks: { | ||
fontColor: palette.text.secondary | ||
}, | ||
gridLines: { | ||
display: false, | ||
drawBorder: false | ||
} | ||
} | ||
], | ||
yAxes: [ | ||
{ | ||
ticks: { | ||
fontColor: palette.text.secondary, | ||
beginAtZero: true, | ||
min: 0 | ||
}, | ||
gridLines: { | ||
borderDash: [2], | ||
borderDashOffset: [2], | ||
color: palette.divider, | ||
drawBorder: false, | ||
zeroLineBorderDash: [2], | ||
zeroLineBorderDashOffset: [2], | ||
zeroLineColor: palette.divider | ||
} | ||
} | ||
] | ||
} | ||
}; |
1 change: 1 addition & 0 deletions
1
client/src/pages/Admin/DashboardPage/components/LatestSales/index.js
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 @@ | ||
export { default } from './LatestSales'; |
86 changes: 86 additions & 0 deletions
86
client/src/pages/Admin/DashboardPage/components/TotalCinemas/TotalCinemas.js
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,86 @@ | ||
import React from 'react'; | ||
import classnames from 'classnames'; | ||
import PropTypes from 'prop-types'; | ||
import { makeStyles } from '@material-ui/styles'; | ||
import { Card, CardContent, Grid, Typography, Avatar } from '@material-ui/core'; | ||
import ArrowDownwardIcon from '@material-ui/icons/ArrowDownward'; | ||
import TheatersIcon from '@material-ui/icons/Theaters'; | ||
|
||
const useStyles = makeStyles(theme => ({ | ||
root: { | ||
height: '100%' | ||
}, | ||
content: { | ||
alignItems: 'center', | ||
display: 'flex' | ||
}, | ||
title: { | ||
fontWeight: 700 | ||
}, | ||
avatar: { | ||
backgroundColor: theme.palette.error.main, | ||
height: 56, | ||
width: 56 | ||
}, | ||
icon: { | ||
height: 32, | ||
width: 32 | ||
}, | ||
difference: { | ||
marginTop: theme.spacing(2), | ||
display: 'flex', | ||
alignItems: 'center' | ||
}, | ||
differenceIcon: { | ||
color: theme.palette.error.dark | ||
}, | ||
differenceValue: { | ||
color: theme.palette.error.dark, | ||
marginRight: theme.spacing(1) | ||
} | ||
})); | ||
|
||
const TotalCinemas = props => { | ||
const { className, cinemas } = props; | ||
|
||
const classes = useStyles(); | ||
|
||
return ( | ||
<Card className={classnames(classes.root, className)}> | ||
<CardContent> | ||
<Grid container justify="space-between"> | ||
<Grid item> | ||
<Typography | ||
className={classes.title} | ||
color="textSecondary" | ||
gutterBottom | ||
variant="body2"> | ||
TOTAL CINEMAS | ||
</Typography> | ||
<Typography variant="h3">{cinemas}</Typography> | ||
</Grid> | ||
<Grid item> | ||
<Avatar className={classes.avatar}> | ||
<TheatersIcon className={classes.icon} /> | ||
</Avatar> | ||
</Grid> | ||
</Grid> | ||
<div className={classes.difference}> | ||
<ArrowDownwardIcon className={classes.differenceIcon} /> | ||
<Typography className={classes.differenceValue} variant="body2"> | ||
16% | ||
</Typography> | ||
<Typography className={classes.caption} variant="caption"> | ||
Since last month | ||
</Typography> | ||
</div> | ||
</CardContent> | ||
</Card> | ||
); | ||
}; | ||
|
||
TotalCinemas.propTypes = { | ||
className: PropTypes.string | ||
}; | ||
|
||
export default TotalCinemas; |
1 change: 1 addition & 0 deletions
1
client/src/pages/Admin/DashboardPage/components/TotalCinemas/index.js
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 @@ | ||
export { default } from './TotalCinemas'; |
Oops, something went wrong.