Skip to content

Commit 453596c

Browse files
author
Jin Ying
committed
Refactor Volunteer Page
1 parent 30f73a3 commit 453596c

File tree

1 file changed

+88
-88
lines changed

1 file changed

+88
-88
lines changed

src/components/volunteer/UpcomingProgramsComponent.js

Lines changed: 88 additions & 88 deletions
Original file line numberDiff line numberDiff line change
@@ -8,110 +8,110 @@ import Image from '../commons/Image';
88
import { royalBlue } from '../../utils/Colors'
99

1010
const styles = theme => ({
11-
root: {
12-
padding: '3rem 2rem 1rem 2rem',
13-
[theme.breakpoints.up('sm')]: {
14-
padding: '3rem 4rem 1rem 4rem'
15-
},
16-
[theme.breakpoints.up('md')]: {
17-
padding: '3rem 5rem 1rem 5rem'
18-
},
11+
root: {
12+
padding: '3rem 2rem 1rem 2rem',
13+
[theme.breakpoints.up('sm')]: {
14+
padding: '3rem 4rem 1rem 4rem'
1915
},
20-
title: {
21-
marginBottom: '2rem',
22-
[theme.breakpoints.up('sm')]: {
23-
marginBottom: '2rem'
24-
},
16+
[theme.breakpoints.up('md')]: {
17+
padding: '3rem 5rem 1rem 5rem'
2518
},
26-
programsContainer: {
27-
maxWidth: 1440,
28-
margin: '1rem auto'
19+
},
20+
title: {
21+
marginBottom: '2rem',
22+
[theme.breakpoints.up('sm')]: {
23+
marginBottom: '2rem'
2924
},
30-
programImageContainer: {
31-
padding: 12,
32-
[theme.breakpoints.up('sm')]: {
33-
paddingRight: 14
34-
},
25+
},
26+
programsContainer: {
27+
maxWidth: 1440,
28+
margin: '1rem auto'
29+
},
30+
programImageContainer: {
31+
padding: 12,
32+
[theme.breakpoints.up('sm')]: {
33+
paddingRight: 14
3534
},
36-
programImage: {
37-
width: '100%',
38-
height: 150,
39-
[theme.breakpoints.up('sm')]: {
40-
height: 225
41-
},
42-
[theme.breakpoints.up('md')]: {
43-
height: 175
44-
},
45-
[theme.breakpoints.up('lg')]: {
46-
height: 225
47-
},
35+
},
36+
programImage: {
37+
width: '100%',
38+
height: 150,
39+
[theme.breakpoints.up('sm')]: {
40+
height: 225
4841
},
49-
programTitle: {
50-
color: royalBlue
42+
[theme.breakpoints.up('md')]: {
43+
height: 175
5144
},
52-
programDescriptionContainer: {
53-
padding: 12,
54-
[theme.breakpoints.up('sm')]: {
55-
paddingLeft: 14
56-
},
45+
[theme.breakpoints.up('lg')]: {
46+
height: 225
5747
},
48+
},
49+
programTitle: {
50+
color: royalBlue
51+
},
52+
programDescriptionContainer: {
53+
padding: 12,
54+
[theme.breakpoints.up('sm')]: {
55+
paddingLeft: 14
56+
},
57+
},
5858
})
5959

6060
class UpcomingProgramsComponent extends Component {
61-
programsContainer = (classes, programsData) => {
62-
const programs = programsData.edges
61+
programsContainer = (classes, programsData) => {
62+
const programs = programsData.edges
6363

64-
return (
65-
programs.map((program, index) => (
66-
<React.Fragment>
67-
<Grid item
68-
className={classes.programImageContainer}
69-
xs={12} md={5}
70-
>
71-
<Image filename={program.node.frontmatter.image.relativePath} classProps={classes.programImage} />
72-
</Grid>
64+
return (
65+
programs.map((program, index) => (
66+
<React.Fragment>
67+
<Grid item
68+
className={classes.programImageContainer}
69+
xs={12} md={5}
70+
>
71+
<Image filename={program.node.frontmatter.image.relativePath} classProps={classes.programImage} />
72+
</Grid>
7373

74-
<Grid item
75-
className={classes.programDescriptionContainer}
76-
xs={12} md={6}
77-
>
78-
<Typography className={classes.programTitle} variant="h6" gutterBottom>{program.node.frontmatter.name}</Typography>
79-
<Typography className={classes.programDescription} variant="body1" gutterBottom>
80-
{program.node.frontmatter.description}
81-
</Typography>
82-
<Typography className={classes.programPeriod} variant="body1" color="textSecondary">
83-
Period: {program.node.frontmatter.period}
84-
</Typography>
85-
</Grid>
86-
</React.Fragment>
87-
))
88-
)
89-
}
74+
<Grid item
75+
className={classes.programDescriptionContainer}
76+
xs={12} md={6}
77+
>
78+
<Typography className={classes.programTitle} variant="h6" gutterBottom>{program.node.frontmatter.name}</Typography>
79+
<Typography className={classes.programDescription} variant="body1" gutterBottom>
80+
{program.node.frontmatter.description}
81+
</Typography>
82+
<Typography className={classes.programPeriod} variant="body1" color="textSecondary">
83+
Period: {program.node.frontmatter.period}
84+
</Typography>
85+
</Grid>
86+
</React.Fragment>
87+
))
88+
)
89+
}
9090

91-
render() {
92-
const { programs } = this.props;
93-
const { classes } = this.props;
91+
render() {
92+
const { programs } = this.props;
93+
const { classes } = this.props;
9494

95-
return (
96-
<div className={classes.root}>
97-
<Typography
98-
className={classes.title}
99-
variant="h5"
100-
align="center"
101-
>
102-
Upcoming Programs
95+
return (
96+
<div className={classes.root}>
97+
<Typography
98+
className={classes.title}
99+
variant="h5"
100+
align="center"
101+
>
102+
Upcoming Programs
103103
</Typography>
104104

105-
<Grid container
106-
className={classes.programsContainer}
107-
justify="center"
108-
direction="row"
109-
>
110-
{this.programsContainer(classes, programs)}
111-
</Grid>
112-
</div>
113-
)
114-
}
105+
<Grid container
106+
className={classes.programsContainer}
107+
justify="center"
108+
direction="row"
109+
>
110+
{this.programsContainer(classes, programs)}
111+
</Grid>
112+
</div>
113+
)
114+
}
115115
}
116116

117117
export default withStyles(styles)(UpcomingProgramsComponent);

0 commit comments

Comments
 (0)