Skip to content

Commit 7f009a3

Browse files
Wolfjawankkarimi
authored andcommitted
Feature/dashboard volunteer (#55)
* change CYF to code your future, change font size of some of inputs * Change some text in the form * connecting dashboard to volunteer form * fix bugs
1 parent 1849924 commit 7f009a3

File tree

7 files changed

+62
-22
lines changed

7 files changed

+62
-22
lines changed

src/Components/Navbar/index.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
import React from 'react'
2-
import logo from '../../logo-cyf.png'
2+
import logo from '../../images/logo-CYF-square.png'
33
import './Navbar.css'
44

55
export default () => {
66
return (
77
<div className="navbar-div">
88
<nav className="navbar navbar-expand-lg navbar-light container">
9-
<a className="navbar-brand" href="/">
10-
<img src={logo} alt="logo" width="170" height="50" />
11-
</a>
9+
<span className="navbar-brand">
10+
<img src={logo} alt="logo" width="80" height="50" />
11+
</span>
1212
</nav>
1313
</div>
1414
)

src/Components/forms/data.json

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@
4747

4848
"radioButtonList": [
4949
{ "value": "None", "_id": "None" },
50-
{ "value": "Nome", "_id": "Nome" },
50+
{ "value": "Some", "_id": "Some" },
5151
{ "value": "Professional experience", "_id": "Professional experience" }
5252
],
5353
"guidePeopleSkillList": [
@@ -57,7 +57,12 @@
5757
"level": "",
5858
"label": "Coaching / Mentoring"
5959
},
60-
{ "id": "09u03uifnc", "name": "", "level": "", "label": "Public Speaking" }
60+
{
61+
"id": "09u03uifnc",
62+
"name": "",
63+
"level": "",
64+
"label": "Help people learn public speaking"
65+
}
6166
],
6267
"techSkillList": [
6368
{
@@ -69,7 +74,7 @@
6974
{ "id": "23edcs3h3j3", "name": "", "level": "", "label": "ReactJS" },
7075
{ "id": "9087ihncwqd", "name": "", "level": "", "label": "Databases" },
7176
{ "id": "opiuygtbnc2", "name": "", "level": "", "label": "JavaScript" },
72-
{ "id": "234edcxzzzx", "name": "", "level": "", "label": "HTML, CSS " },
77+
{ "id": "234edcxzzzx", "name": "", "level": "", "label": "HTML, CSS" },
7378
{ "id": "34refw43efe", "name": "", "level": "", "label": "UX Design" },
7479
{ "id": "232dwjouhv8", "name": "", "level": "", "label": "Other" }
7580
],

src/Components/forms/header.js

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,21 @@
11
import React, { Fragment } from 'react'
22

3-
export default ({ err, formInComplete }) => {
3+
export default ({ err, formInComplete, userId }) => {
44
return (
55
<Fragment>
66
<span className="form-header">Volunteer Application Form</span>
77
<hr />
8-
<p className="form-description">
9-
Thank you for your interest! To ensure we’re a great fit, please
10-
complete the form below:
11-
</p>
8+
{userId ? (
9+
<p className="form-description">
10+
Thank you for your interest in volunteering with Code Your Future! To
11+
ensure we're a great fit, please complete the form below:
12+
</p>
13+
) : (
14+
<p className="form-description">
15+
Thank you for your interest! To ensure we’re a great fit, please
16+
complete the form below:
17+
</p>
18+
)}
1219
{err && (
1320
<p className="errors">
1421
{err}

src/Components/forms/helper.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@ export const initialState = {
1919
valuationError: false,
2020
acknowledgement: false,
2121
formInComplete: false,
22+
userId: '',
23+
dashboardUrl: '',
2224
errors: {
2325
firstName: false,
2426
lastName: false,

src/Components/forms/index.js

Lines changed: 32 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,11 @@ class Forms extends Component {
1010
state = initialState
1111

1212
UNSAFE_componentWillMount() {
13+
const dashboardUrl = this.props.location.search
14+
const { userId } = this.props.match.params
15+
if (userId) {
16+
this.setState({ userId, dashboardUrl: dashboardUrl.slice(1) })
17+
}
1318
this.props.loadCities()
1419
}
1520

@@ -88,7 +93,8 @@ class Forms extends Component {
8893
guidePeople,
8994
techSkill,
9095
otherSkill,
91-
acknowledgement
96+
acknowledgement,
97+
userId
9298
} = this.state
9399

94100
const validatedInputs = this.validateForm({
@@ -120,7 +126,8 @@ class Forms extends Component {
120126
hearAboutCYF,
121127
guidePeople: filterEmptyValue(guidePeople),
122128
techSkill: filterEmptyValue(techSkill),
123-
otherSkill: filterEmptyValue(otherSkill)
129+
otherSkill: filterEmptyValue(otherSkill),
130+
userId
124131
})
125132
}
126133
}
@@ -145,25 +152,41 @@ class Forms extends Component {
145152

146153
render() {
147154
const { err, volunteer } = this.props
148-
const { disabled, acknowledgement, formInComplete } = this.state
155+
const {
156+
disabled,
157+
acknowledgement,
158+
formInComplete,
159+
userId,
160+
dashboardUrl
161+
} = this.state
149162
if (volunteer && volunteer._id) {
150163
return (
151164
<div className="form-container container p-4">
152165
<h4>
153166
Welcome {volunteer.firstName} {volunteer.lastName}
154167
</h4>
155-
<p>
156-
Thank you for submitting your application to Code Your Future to
157-
become a volunteer. We will review your application and contact you
158-
via email within 10 days.
159-
</p>
168+
{userId ? (
169+
<p>
170+
Thank you for submitting your application to volunteer with Code
171+
Your Future (CYF). If you are already a registered user of the CYF
172+
Admin dashboard, here is a <a href={dashboardUrl}> link</a> to
173+
login. For new registrants, we will review your application and
174+
contact you via email, within 10 days.
175+
</p>
176+
) : (
177+
<p>
178+
Thank you for submitting your application to Code Your Future to
179+
become a volunteer. We will review your application and contact
180+
you via email within 10 days.
181+
</p>
182+
)}
160183
</div>
161184
)
162185
}
163186
return (
164187
<div className="form-container container">
165188
<div>
166-
<Header err={err} formInComplete={formInComplete} />
189+
<Header err={err} formInComplete={formInComplete} userId={userId} />
167190
<form className="mb-4" onSubmit={this.handleSubmit} method="post">
168191
<Inputs
169192
{...this.props}

src/Components/forms/inputs/checkListB.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,9 @@ export default ({ onChange, list, name }) => {
5353
/>
5454
)}
5555
{listItem.label !== 'Other' && (
56-
<p className="check-list-single-footer">Choose your level</p>
56+
<p className="check-list-single-footer">
57+
Your level of experience
58+
</p>
5759
)}
5860
</span>
5961
) : (

src/Routes/index.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import NotFound from '../Components/NotFound'
77
export default () => (
88
<Switch>
99
<Public exact path="/" component={Forms} />
10+
<Public exact path="/code/:userId" component={Forms} />
1011
<Route path="*" component={NotFound} />
1112
</Switch>
1213
)

0 commit comments

Comments
 (0)