Skip to content

Commit cb2c5bc

Browse files
committed
Enhance dashboar view
1 parent c9b63b2 commit cb2c5bc

File tree

13 files changed

+211
-4
lines changed

13 files changed

+211
-4
lines changed

src/Dashboard/Dashboard.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,13 @@
11
import React from 'react'
22

3+
import Grid from '@material-ui/core/Grid'
4+
35
import BasePageContainer from '../_common/BasePageContainer'
46
import BasePageToolbar from '../_common/BasePageToolbar'
57

68
import DashboardActions from './DashboardActions'
9+
import KeyNumbers from './KeyNumbers'
10+
import Subscriptions from './Subscriptions'
711

812
const Dashboard = () => {
913
return (
@@ -12,6 +16,12 @@ const Dashboard = () => {
1216
title={'Dashboard'}
1317
actionsComponent={DashboardActions}
1418
></BasePageToolbar>
19+
<Grid container spacing={3}>
20+
<Grid item xs={12}>
21+
<Subscriptions />
22+
</Grid>
23+
<KeyNumbers />
24+
</Grid>
1525
</BasePageContainer>
1626
)
1727
}
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
import React from 'react'
2+
import PropTypes from 'prop-types'
3+
import { makeStyles } from '@material-ui/core/styles'
4+
import Paper from '@material-ui/core/Paper'
5+
import Grid from '@material-ui/core/Grid'
6+
7+
const KeyNumbers = props => {
8+
const classes = useStyles()
9+
10+
return (
11+
<>
12+
<Grid item xs={6} sm={3}>
13+
<Paper className={classes.paper}>xs=3</Paper>
14+
</Grid>
15+
<Grid item xs={6} sm={3}>
16+
<Paper className={classes.paper}>xs=3</Paper>
17+
</Grid>
18+
<Grid item xs={6} sm={3}>
19+
<Paper className={classes.paper}>xs=3</Paper>
20+
</Grid>
21+
<Grid item xs={6} sm={3}>
22+
<Paper className={classes.paper}>xs=3</Paper>
23+
</Grid>
24+
</>
25+
)
26+
}
27+
28+
KeyNumbers.propTypes = {}
29+
30+
const useStyles = makeStyles(theme => ({
31+
root: {
32+
flexGrow: 1,
33+
},
34+
paper: {
35+
padding: theme.spacing(2),
36+
textAlign: 'center',
37+
color: theme.palette.text.secondary,
38+
},
39+
}))
40+
41+
export default KeyNumbers

src/Dashboard/KeyNumbers/index.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export { default } from './KeyNumbers'

src/Dashboard/Revenue/Revenue.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
import React from 'react'
2+
import PropTypes from 'prop-types'
3+
4+
const Revenue = props => {
5+
return <div></div>
6+
}
7+
8+
Revenue.propTypes = {}
9+
10+
export default Revenue

src/Dashboard/Revenue/index.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export { default } from './Revenue'

src/Dashboard/Sales/Sales.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
import React from 'react'
2+
import PropTypes from 'prop-types'
3+
4+
const Sales = props => {
5+
return <div></div>
6+
}
7+
8+
Sales.propTypes = {}
9+
10+
export default Sales

src/Dashboard/Sales/index.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export { default } from './Sales'
Lines changed: 105 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,105 @@
1+
import React from 'react'
2+
import PropTypes from 'prop-types'
3+
import {
4+
makeStyles,
5+
ButtonGroup,
6+
Button,
7+
Grid,
8+
Paper,
9+
Avatar,
10+
Card,
11+
CardHeader,
12+
CardContent,
13+
Typography,
14+
IconButton,
15+
LinearProgress,
16+
} from '@material-ui/core'
17+
import { Timeline as IconTimeline, MoreVert as IconMoreVert } from '@material-ui/icons'
18+
19+
const Subscriptions = props => {
20+
const classes = useStyles()
21+
22+
return (
23+
<Card>
24+
<CardHeader
25+
className={classes.cardHeader}
26+
avatar={<IconTimeline className={classes.headerIcon} />}
27+
action={
28+
<IconButton aria-label="settings" size="small">
29+
<IconMoreVert />
30+
</IconButton>
31+
}
32+
title="Subscriptions"
33+
/>
34+
<CardContent className={classes.cardContent}>
35+
<Grid container spacing={4}>
36+
<Grid item sm={9} className={classes.chartBox}>
37+
<div className={classes.chart}></div>
38+
</Grid>
39+
<Grid item sm={3} className={classes.ratingBox}>
40+
<div>
41+
<Typography>GitHub.com</Typography>
42+
<LinearProgress variant="determinate" value={55} color="primary" />
43+
</div>
44+
<div>
45+
<Typography>MaterialUI.com</Typography>
46+
<LinearProgress variant="determinate" value={25} color="primary" />
47+
</div>
48+
<div>
49+
<Typography>Google</Typography>
50+
<LinearProgress variant="determinate" value={15} color="primary" />
51+
</div>
52+
<div>
53+
<Typography>ModularCode.io</Typography>
54+
<LinearProgress variant="determinate" value={8} color="primary" />
55+
</div>
56+
<div>
57+
<Typography>TypeScript</Typography>
58+
<LinearProgress variant="determinate" value={5} color="primary" />
59+
</div>
60+
</Grid>
61+
</Grid>
62+
</CardContent>
63+
</Card>
64+
)
65+
}
66+
67+
Subscriptions.propTypes = {}
68+
69+
const useStyles = makeStyles(theme => ({
70+
cardHeader: {
71+
borderBottom: '1px solid rgba(24,28,33,0.06)',
72+
},
73+
cardBody: {
74+
overflow: 'hidden',
75+
},
76+
headerTitleBox: {},
77+
headerActionsBox: {
78+
textAlign: 'right',
79+
},
80+
headerIcon: {
81+
color: theme.palette.primary.main,
82+
verticalAlign: 'sub',
83+
marginRight: '.3em',
84+
},
85+
chartBox: {
86+
borderRight: '1px solid rgba(24,28,33,0.06)',
87+
},
88+
chart: {
89+
width: '100%',
90+
paddingBottom: '30%',
91+
background: '#efefef',
92+
},
93+
cardContent: {
94+
'&:last-child': {
95+
paddingBottom: 'default',
96+
},
97+
},
98+
ratingBox: {
99+
display: 'flex',
100+
flexDirection: 'column',
101+
justifyContent: 'space-between',
102+
},
103+
}))
104+
105+
export default Subscriptions

src/Dashboard/Subscriptions/index.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export { default } from './Subscriptions'

src/Dashboard/Visits/Visits.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
import React from 'react'
2+
import PropTypes from 'prop-types'
3+
4+
const Visits = props => {
5+
return <div></div>
6+
}
7+
8+
Visits.propTypes = {}
9+
10+
export default Visits

0 commit comments

Comments
 (0)