Skip to content

Commit 94d187a

Browse files
authored
Merge pull request #30 from kohchihao/update-events-button
Update events button
2 parents 1274bb4 + b033ab6 commit 94d187a

File tree

15 files changed

+3812
-3774
lines changed

15 files changed

+3812
-3774
lines changed

package-lock.json

Lines changed: 3572 additions & 3576 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/components/NavBar.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@ class NavBar extends Component {
162162
{/* Site icon */}
163163
<Button className={classes.siteIcon} color="inherit">
164164
<Link to="/" className={classes.links}>
165-
<img src={codeForCommunity} />
165+
<img src={codeForCommunity} alt="Code for Community"/>
166166
</Link>
167167
</Button>
168168

src/components/about/BannerComponent.js

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import Typography from '@material-ui/core/Typography';
44
import { withStyles } from '@material-ui/core/styles';
55

66
import BannerImage from '../commons/BannerImage';
7-
import { whiteSmoke } from '../../utils/Colors'
7+
import { whiteSmoke } from '../../utils/Colors';
88

99
const styles = theme => ({
1010
root: {
@@ -31,17 +31,17 @@ const styles = theme => ({
3131
},
3232
info: {
3333
marginLeft: '2rem',
34-
marginRight: '2rem'
34+
marginRight: '2rem',
3535
},
3636
title: {
3737
color: whiteSmoke,
38-
fontWeight: 700
38+
fontWeight: 700,
3939
},
4040
description: {
4141
marginTop: '2em',
42-
color: whiteSmoke
43-
}
44-
})
42+
color: whiteSmoke,
43+
},
44+
});
4545

4646
class BannerComponent extends Component {
4747
render() {
@@ -51,10 +51,14 @@ class BannerComponent extends Component {
5151
<div className={classes.root}>
5252
<BannerImage filename={'about_cover.jpg'} classProps={classes.bgImg} />
5353
<div className={classes.info}>
54-
<Typography variant="h4" className={classes.title} gutterBottom>Welcome!</Typography>
54+
<Typography variant="h4" className={classes.title} gutterBottom>
55+
Welcome!
56+
</Typography>
5557
<Typography variant="h6" className={classes.description}>
56-
CodeForCommunity is an umbrella project of SoC Family, a network of SoC Students, Staff and Alumni who take great pride in helping develop the projects for underserved communities.
57-
</Typography>
58+
CodeForCommunity is an umbrella project of SoC Family, a network of
59+
SoC Students, Staff and Alumni who take great pride in helping
60+
develop the projects for underserved communities.
61+
</Typography>
5862
</div>
5963
</div>
6064
);

src/components/cap/CapComponent.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,12 @@ class CapComponent extends Component {
9191
<br />
9292
CAP - Code to Achieve Potential is a program designed in collaboration
9393
with{' '}
94-
<a href="https://www.autism.org.sg" target="_blank" className={classes.a}>
94+
<a
95+
href="https://www.autism.org.sg"
96+
target="_blank"
97+
rel="noopener noreferrer"
98+
className={classes.a}
99+
>
95100
Autism Resource Centre, Singapore
96101
</a>{' '}
97102
to create code specific learning opportunities for youth with Autism.{' '}

src/components/home/banner/BannerComponent.js

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ const styles = theme => ({
8585

8686
class BannerComponent extends Component {
8787
render() {
88-
const { title, description, btnOneText, btnOneLink } = this.props;
88+
const { title, btnOneText, btnOneLink } = this.props;
8989
const { classes } = this.props;
9090

9191
return (
@@ -95,21 +95,14 @@ class BannerComponent extends Component {
9595
<Typography variant="h4" className={classes.title} gutterBottom>
9696
{title}
9797
</Typography>
98-
{/* <Typography variant="h6" className={classes.description}>
99-
{description}
100-
</Typography> */}
10198

10299
<Typography variant="h6" className={classes.description}>
103100
{'Every '}
104101
<ReactRotatingText items={['{bids}', '10110']} />
105102
{' counts.'}
106103
</Typography>
107104

108-
<div>
109-
<Link to={'/' + btnOneLink} className={classes.links}>
110-
<Button className={classes.btn}>{btnOneText}</Button>
111-
</Link>
112-
</div>
105+
113106
</div>
114107
</div>
115108
);

src/components/home/signup/SignUpComponent.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ class SignUpComponent extends Component {
5959
{title}
6060
</Typography>
6161
<Button className={classes.btn}>
62-
<a href={btnLink} className={classes.links} target="_blank">
62+
<a href={btnLink} className={classes.links} target="_blank" rel="noopener noreferrer">
6363
{btnText}
6464
</a>
6565
</Button>

src/components/volunteer/BannerComponent.js renamed to src/components/programmes/BannerComponent.js

Lines changed: 53 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import React, { Component } from 'react';
2-
2+
import { Link } from 'gatsby';
33
import Typography from '@material-ui/core/Typography';
44
import Grid from '@material-ui/core/Grid';
55
import Button from '@material-ui/core/Button';
@@ -9,8 +9,7 @@ import BannerImage from '../commons/BannerImage';
99
import { primary, hoverPrimary } from '../../utils/Colors';
1010

1111
const styles = theme => ({
12-
root: {
13-
},
12+
root: {},
1413
infoContainer: {
1514
padding: '2rem 3rem',
1615
[theme.breakpoints.up('md')]: {
@@ -34,7 +33,7 @@ const styles = theme => ({
3433
height: '25rem',
3534
},
3635
[theme.breakpoints.up('md')]: {
37-
height: 'auto'
36+
height: 'auto',
3837
},
3938
},
4039
bgImg: {
@@ -48,24 +47,40 @@ const styles = theme => ({
4847
joinUsBtn: {
4948
backgroundColor: primary,
5049
fontSize: 20,
51-
textTransform: "capitalize",
50+
textTransform: 'capitalize',
5251
padding: '7.5px 15px',
5352
'& a': {
54-
color: 'white'
53+
color: 'white',
5554
},
5655
'&:hover': {
57-
backgroundColor: hoverPrimary
58-
}
56+
backgroundColor: hoverPrimary,
57+
},
58+
},
59+
btn: {
60+
backgroundColor: primary,
61+
color: 'white',
62+
marginRight: 15,
63+
marginBottom: 15,
64+
padding: '8px 15px',
65+
textTransform: 'capitalize',
66+
'&:hover': {
67+
backgroundColor: hoverPrimary,
68+
},
69+
[theme.breakpoints.up('md')]: {
70+
padding: '10px 25px',
71+
marginRight: 15,
72+
},
5973
},
6074
links: {
6175
textDecoration: 'none',
62-
color: 'black'
76+
color: 'black',
6377
},
64-
})
78+
});
6579

6680
class BannerComponent extends Component {
6781
render() {
6882
const { classes } = this.props;
83+
const { title, btnOneText, btnOneLink } = this.props;
6984

7085
return (
7186
<div className={classes.root}>
@@ -75,30 +90,46 @@ class BannerComponent extends Component {
7590
Impact the community
7691
</Typography>
7792

78-
<Typography variant="body1" className={classes.description} color='textSecondary'>
79-
We are passionate about volunteering for underserved communities . We love to create code specific learning opportunities and bring the latest technologies to communities. We love to learn, share and code together. We love to give life to our ideas.
93+
<Typography
94+
variant="body1"
95+
className={classes.description}
96+
color="textSecondary"
97+
>
98+
We are passionate about volunteering for underserved communities .
99+
We love to create code specific learning opportunities and bring
100+
the latest technologies to communities. We love to learn, share
101+
and code together. We love to give life to our ideas.
80102
</Typography>
81103

82-
<Typography variant="body1" className={classes.description} color='textSecondary'>
83-
If you believe in Giving and have couple of hours to spare very week
104+
<Typography
105+
variant="body1"
106+
className={classes.description}
107+
color="textSecondary"
108+
>
109+
If you believe in Giving and have couple of hours to spare very
110+
week
84111
<br />
85-
If you are trustworthy, good communicator, independent and self-organised
112+
If you are trustworthy, good communicator, independent and
113+
self-organised
86114
</Typography>
87115

88-
<p>
89-
<Button className={classes.joinUsBtn}>
90-
<a href="#" className={classes.links}>Join Us</a>
91-
</Button>
92-
</p>
116+
<div>
117+
<Link to={'/' + btnOneLink} className={classes.links}>
118+
<Button className={classes.btn}>{btnOneText}</Button>
119+
</Link>
120+
</div>
93121
</Grid>
94122

95123
<Grid item xs={12} md={6} className={classes.bgImgContainer}>
96-
<BannerImage filename={'volunteer_cover.jpg'} classProps={classes.bgImg} />
124+
<BannerImage
125+
filename={'volunteer_cover.jpg'}
126+
classProps={classes.bgImg}
127+
/>
97128
</Grid>
98129
</Grid>
99130
</div>
100131
);
101132
}
102133
}
103134

104-
export default withStyles(styles)(BannerComponent);
135+
export default withStyles(styles)(BannerComponent);
Lines changed: 132 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,132 @@
1+
import React, { Component } from 'react';
2+
3+
import Typography from '@material-ui/core/Typography';
4+
import Grid from '@material-ui/core/Grid';
5+
import { withStyles } from '@material-ui/core/styles';
6+
7+
import Image from '../commons/Image';
8+
import { royalBlue } from '../../utils/Colors';
9+
10+
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+
},
19+
},
20+
title: {
21+
marginBottom: '2rem',
22+
[theme.breakpoints.up('sm')]: {
23+
marginBottom: '2rem',
24+
},
25+
},
26+
programsContainer: {
27+
maxWidth: 1440,
28+
margin: '1rem auto',
29+
},
30+
programImageContainer: {
31+
padding: 12,
32+
[theme.breakpoints.up('sm')]: {
33+
paddingRight: 14,
34+
},
35+
},
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+
},
48+
},
49+
programTitle: {
50+
color: royalBlue,
51+
},
52+
programDescriptionContainer: {
53+
padding: 12,
54+
[theme.breakpoints.up('sm')]: {
55+
paddingLeft: 14,
56+
},
57+
},
58+
});
59+
60+
class UpcomingProgramsComponent extends Component {
61+
programsContainer = (classes, programsData) => {
62+
const programs = programsData.edges;
63+
64+
return programs.map((program, index) => (
65+
<React.Fragment>
66+
<Grid item className={classes.programImageContainer} xs={12} md={5}>
67+
<Image
68+
filename={program.node.frontmatter.image.relativePath}
69+
classProps={classes.programImage}
70+
/>
71+
</Grid>
72+
73+
<Grid
74+
item
75+
className={classes.programDescriptionContainer}
76+
xs={12}
77+
md={6}
78+
>
79+
<Typography
80+
className={classes.programTitle}
81+
variant="h6"
82+
gutterBottom
83+
>
84+
{program.node.frontmatter.name}
85+
</Typography>
86+
<Typography
87+
className={classes.programDescription}
88+
variant="body1"
89+
gutterBottom
90+
>
91+
{program.node.frontmatter.description}
92+
</Typography>
93+
<Typography
94+
className={classes.programPeriod}
95+
variant="body1"
96+
color="textSecondary"
97+
>
98+
Period: {program.node.frontmatter.period}
99+
</Typography>
100+
</Grid>
101+
</React.Fragment>
102+
));
103+
};
104+
105+
render() {
106+
const { programs } = this.props;
107+
const { classes } = this.props;
108+
console.log('Progs', programs);
109+
return (
110+
<div className={classes.root}>
111+
<Typography className={classes.title} variant="h5" align="center">
112+
Upcoming Programs
113+
</Typography>
114+
115+
<Grid
116+
container
117+
className={classes.programsContainer}
118+
justify="center"
119+
direction="row"
120+
>
121+
{programs.edges.length > 0 ? (
122+
this.programsContainer(classes, programs)
123+
) : (
124+
<Typography>No Upcoming events</Typography>
125+
)}
126+
</Grid>
127+
</div>
128+
);
129+
}
130+
}
131+
132+
export default withStyles(styles)(UpcomingProgramsComponent);

0 commit comments

Comments
 (0)