Skip to content

Commit 11606e2

Browse files
committed
UI adjustments
1 parent cb2c5bc commit 11606e2

File tree

3 files changed

+65
-32
lines changed

3 files changed

+65
-32
lines changed

src/Dashboard/Subscriptions/Subscriptions.js

Lines changed: 54 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,7 @@ import React from 'react'
22
import PropTypes from 'prop-types'
33
import {
44
makeStyles,
5-
ButtonGroup,
6-
Button,
75
Grid,
8-
Paper,
9-
Avatar,
106
Card,
117
CardHeader,
128
CardContent,
@@ -16,6 +12,14 @@ import {
1612
} from '@material-ui/core'
1713
import { Timeline as IconTimeline, MoreVert as IconMoreVert } from '@material-ui/icons'
1814

15+
const subscriptionsItems = [
16+
{ name: 'GitHub', ratio: 55.3, value: Math.round(55.3 * 144) },
17+
{ name: 'MaterialUI', ratio: 25.7, value: Math.round(25.7 * 144) },
18+
{ name: 'Google', ratio: 15.6, value: Math.round(15.6 * 144) },
19+
{ name: 'ModularCode', ratio: 8.4, value: Math.round(8.4 * 144) },
20+
{ name: 'GH', ratio: 5.5, value: Math.round(5.5 * 144) },
21+
]
22+
1923
const Subscriptions = props => {
2024
const classes = useStyles()
2125

@@ -37,26 +41,34 @@ const Subscriptions = props => {
3741
<div className={classes.chart}></div>
3842
</Grid>
3943
<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>
44+
{subscriptionsItems.map(({ name, ratio, value }) => (
45+
<div>
46+
<Grid container>
47+
<Grid item xs>
48+
<Typography variant="body1">{name}</Typography>
49+
</Grid>
50+
<Grid item xs className={classes.ratingItemValueBox}>
51+
<Typography
52+
align="right"
53+
variant="body2"
54+
display="inline"
55+
className={classes.ratingItemValue}
56+
>
57+
{value}
58+
</Typography>
59+
<Typography
60+
align="left"
61+
variant="body2"
62+
color="textSecondary"
63+
className={classes.ratingItemRatio}
64+
>
65+
{ratio}%
66+
</Typography>
67+
</Grid>
68+
</Grid>
69+
<LinearProgress variant="determinate" value={ratio} color="primary" />
70+
</div>
71+
))}
6072
</Grid>
6173
</Grid>
6274
</CardContent>
@@ -68,7 +80,8 @@ Subscriptions.propTypes = {}
6880

6981
const useStyles = makeStyles(theme => ({
7082
cardHeader: {
71-
borderBottom: '1px solid rgba(24,28,33,0.06)',
83+
borderBottom: '1px solid',
84+
borderBottomColor: theme.palette.divider,
7285
},
7386
cardBody: {
7487
overflow: 'hidden',
@@ -83,11 +96,12 @@ const useStyles = makeStyles(theme => ({
8396
marginRight: '.3em',
8497
},
8598
chartBox: {
86-
borderRight: '1px solid rgba(24,28,33,0.06)',
99+
borderRight: '1px solid',
100+
borderRightColor: theme.palette.divider,
87101
},
88102
chart: {
89103
width: '100%',
90-
paddingBottom: '30%',
104+
paddingBottom: '25%',
91105
background: '#efefef',
92106
},
93107
cardContent: {
@@ -100,6 +114,19 @@ const useStyles = makeStyles(theme => ({
100114
flexDirection: 'column',
101115
justifyContent: 'space-between',
102116
},
117+
ratingItemValueBox: {
118+
textAlign: 'right',
119+
fontSize: '0.7em',
120+
},
121+
ratingItemValue: {
122+
display: 'inline-block',
123+
},
124+
ratingItemRatio: {
125+
marginLeft: 4,
126+
display: 'inline-block',
127+
width: '3em',
128+
// fontSize: '1em',
129+
},
103130
}))
104131

105132
export default Subscriptions

src/_common/AppFooter/AppFooter.js

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,15 @@ const Footer = () => {
99
return (
1010
<footer className={classes.footer}>
1111
<Typography variant="body2" color="textSecondary" align="left">
12-
{'Find me on: '}
13-
<Link color="primary" href="https://github.com/modularcoder">
14-
GitHub
15-
</Link>
12+
{'Copyright your company 2020 '}
1613
{' | '}
1714
<Link color="primary" href="https://twitter.com/modularcoder">
18-
Twitter
15+
MIT License
16+
</Link>
17+
</Typography>
18+
<Typography variant="body2" color="textSecondary" align="center">
19+
<Link color="primary" href="https://github.com/modularcoder">
20+
GitHub
1921
</Link>
2022
{' | '}
2123
<Link color="primary" href="https://www.linkedin.com/in/modularcoder/">

src/_theme/index.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,7 @@ const baseTheme = createMuiTheme({
7373
},
7474
},
7575
palette: {
76+
divider: 'rgba(30, 30, 30, 0.06)',
7677
secondary: {
7778
main: '#8cd136', //indigo[600],
7879
},
@@ -81,6 +82,9 @@ const baseTheme = createMuiTheme({
8182
// main: '#9027d1', //'#619f30',
8283
// main: blue[600], //'#619f30',
8384
},
85+
text: {
86+
secondary: 'rgba(102, 102, 102, 0.83)',
87+
},
8488
},
8589
typography: {
8690
h1: {

0 commit comments

Comments
 (0)