Skip to content

Commit e7c5892

Browse files
ckshobhabbmoz
authored andcommitted
155111450 - add landing page, section C (#177)
* 155111450 - add landing page, section C * 155111450 - Modify comment
1 parent 56a1f45 commit e7c5892

File tree

8 files changed

+117
-1
lines changed

8 files changed

+117
-1
lines changed

client/App.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ import restricted from './components/Restricted/Restricted'
1414
import SignupForm from './components/SignupForm/SignupForm'
1515
import Version from './components/Version/Version'
1616
import LandingA from './components/LandingA/LandingA'
17+
import LandingC from './components/LandingC/LandingC'
1718

1819
// set up components for lazy loading
1920
const ProfileRestrictedLoadable = restricted(Loadable({
@@ -44,6 +45,7 @@ class App extends Component {
4445
<Route path='/profile' component={ProfileRestrictedLoadable}/>
4546
<Route path='/signup' component={SignupForm}/>
4647
<Route path='/landing-a' component={LandingA} />
48+
<Route path='/landing-c' component={LandingC} />
4749
</Switch>
4850
</div>
4951
)

client/components/LandingA/LandingA.scss

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22

33
$black: #000;
44
$bottom-red: #ff3e3e;
5-
$text-red: #ea4c2d;
65
$top-red: #e74e2b;
76
$white: #fff;
87

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
import React, { Component } from 'react'
2+
import styles from './LandingC.scss'
3+
import map from '../../images/map.png'
4+
import { callToCodeEfforts } from '../shared/constants'
5+
6+
/**
7+
* TODO: callToCodeEfforts constants should be removed once the API to
8+
* get the efforts are implemented
9+
*/
10+
class LandingC extends Component {
11+
constructor (props) {
12+
super(props)
13+
this.getLinkStyles = this.getLinkStyles.bind(this)
14+
}
15+
16+
getLinkStyles (itemType) {
17+
return itemType === 'number'
18+
? `${styles.number} ${styles.effortItem}`
19+
: `${styles.label} ${styles.effortItem}`
20+
}
21+
22+
renderList (items, type) {
23+
return items.map((item, index) => {
24+
return (
25+
<div key={index} className={this.getLinkStyles(type)}>
26+
{item}
27+
</div>
28+
)
29+
})
30+
}
31+
32+
render () {
33+
return (
34+
<div className={styles.container}>
35+
<h1 className={styles.landingPageHeading}>
36+
{'A truly international effort'}
37+
</h1>
38+
<div className={styles.map}>
39+
<img src={map} alt="Call to code presence international" />
40+
</div>
41+
<div className={styles.effortsSection}>
42+
{ this.renderList(Object.values(callToCodeEfforts), 'number') }
43+
{ this.renderList(Object.keys(callToCodeEfforts), 'label') }
44+
</div>
45+
</div>
46+
)
47+
}
48+
}
49+
50+
export default LandingC
Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
@import "../../scss/partials/partials";
2+
3+
.container {
4+
left: 0;
5+
padding: 20px 20px;
6+
position: absolute;
7+
right: 0;
8+
}
9+
10+
.landingPageHeading {
11+
text-align: center;
12+
padding-bottom: 30px;
13+
line-height: 2.33;
14+
letter-spacing: normal;
15+
font-size: 30px;
16+
}
17+
18+
.map {
19+
width: 929px;
20+
height: 488px;
21+
object-fit: contain;
22+
margin:0px auto;
23+
display: block;
24+
margin-bottom: 30px;
25+
}
26+
27+
.effortsSection {
28+
margin: auto;
29+
width: 60%;
30+
padding: 10px;
31+
display: grid;
32+
grid-template-columns: repeat(4, 1fr);
33+
grid-column-gap: 10px;
34+
grid-template-rows: auto;
35+
grid-gap: 15px;
36+
justify-items: center;
37+
align-items: center;
38+
}
39+
40+
.effortItem {
41+
text-align: center;
42+
}
43+
44+
.number {
45+
font-size: 350%;
46+
color: $text-red
47+
}
48+
49+
.label {
50+
font-size: 20px;
51+
font-weight: 300;
52+
}
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
export const VOLUNTEERS = 1254
2+
export const PROJECTS = 73
3+
export const ORGANIZATIONS = 52
4+
export const COUNTRIES = 72
5+
6+
export default {
7+
Volunteers: VOLUNTEERS,
8+
Projects: PROJECTS,
9+
Organizations: ORGANIZATIONS,
10+
Countries: COUNTRIES
11+
}
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
export { default as causes } from './causes'
22
export { default as technologies } from './technologies'
3+
export { default as callToCodeEfforts } from './callToCodeEfforts'

client/images/map.png

181 KB
Loading

client/scss/partials/_variables.scss

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,3 +9,4 @@ $listColor: darkgray;
99
$errorColor: red;
1010
$validInputColor: #3E9B2A;
1111
$inputsBorderColor: #C6CBD4;
12+
$text-red: #EA4C2D;

0 commit comments

Comments
 (0)