diff --git a/src/pages/Application/ApplicationDecision.js b/src/pages/Application/ApplicationDecision.js index 72a9242..33807c8 100644 --- a/src/pages/Application/ApplicationDecision.js +++ b/src/pages/Application/ApplicationDecision.js @@ -1,74 +1,78 @@ import React, { Component } from 'react'; -import { Button } from 'bm-kit'; +import { Button, Card } from 'bm-kit'; import ApplicationTextField from './ApplicationTextField'; import ApplicationSelectField from './ApplicationSelectField'; import ApplicationRSVPToggle from './ApplicationRSVPToggle'; import { dietOptions, shirtOptions, skillOptions } from './ApplicationConsts'; -class ApplicationForm extends Component { - render() { - // let decisionMap = { - // 4: 'EXPIRED', - // 3: 'ACCEPT', - // 2: 'WAITLIST', - // 1: 'REJECT', - // 0: 'UNDECIDED' - // }; +class ApplicationDecision extends Component { + renderHasBus() { const { applicationForm } = this.props.application; - const isLoading = this.props.application.loading; - let transitMessage; - switch (applicationForm.school.transit_method) { - case 'bus': - transitMessage = ( -
-

We'll be sending a bus to {applicationForm.school.name}!

-

- Join the Facebook event{' '} - - here - {' '} - to stay up to date! -

-
- ); - break; - case 'car': - transitMessage = ( -
-

- Sadly we won't be able to send a bus to{' '} - {applicationForm.school.name}. -

-

- However, if you're willing to get here by your own means, we'd - love to have you!. -

-

- - Please note that we will not be providing any form of travel - reimbursements. - -

-
- ); - break; - default: - case 'walk': - transitMessage = ( -

- Well, you have it easy! BoilerMake will be happening in the Black & - Gold Gyms of the CoRec on campus. -

- ); - break; - } + return ( +
+

We'll be sending a bus to {applicationForm.school.name}!

+

+ Join the Facebook event{' '} + + here + {' '} + to stay up to date! +

+
+ ); + } + + renderHasCar() { + const { applicationForm } = this.props.application; - let rsvpYes = ( + return ( +
+

+ Sadly we won't be able to send a bus to{' '} + {applicationForm.school.name}. +

+

+ However, if you're willing to get here by your own means, we'd love to + have you!. +

+

+ + Please note that we will not be providing any form of travel + reimbursements. + +

+
+ ); + } + + renderHasFeet() { + return ( +

+ Well, you have it easy! BoilerMake will be happening in the Black & Gold + Gyms of the CoRec on campus. +

+ ); + } + + renderTransitMethod() { + const { applicationForm } = this.props.application; + const method = applicationForm.school.transit_method; + + if (method === 'bus') return this.renderHasBus(); + if (method === 'car') return this.renderHasCar(); + if (method === 'walk') return this.renderHasFeet(); + } + + renderRSVPYes() { + // const { applicationForm } = this.props.application; + const isLoading = this.props.application.loading; + + return (

Neat! Just a few more steps.

@@ -120,8 +124,12 @@ class ApplicationForm extends Component {

); + } + + renderRSVPNo() { + // const { applicationForm } = this.props.application; - let rsvpNo = ( + return (

Aw{' '} @@ -130,99 +138,120 @@ class ApplicationForm extends Component { Please come back and apply next year though!{' '}

); + } - let decisionForm; - switch (applicationForm.decision) { - case 3: //ACCEPT - decisionForm = ( -
- {applicationForm.is_rsvp_confirmed === 1 ? ( -
-
- Your RSVP has been recorded - we will see you at BoilerMake! -

- Your check in code is:{' '} - - {applicationForm.user.hashid} - -
Please have this + your photo ID ready to expedite - check in. -

-
-
- ) : ( -

- Can you come? You must RSVP{' '} - {applicationForm.rsvp_deadline ? ( - by {applicationForm.rsvp_deadline} - ) : ( - soon - )}{' '} - or else we will offer your spot to someone else. -

- )} -

You're in!

-

- Congratulations, we’re excited to invite you to this year’s retro - twist on BoilerMake.{' '} - - 💜 - -
- BoilerMake will last from around 6PM on Friday Sept 29 until - approximately 2PM on Sunday October 1, and it will be held on - Purdue's campus in West Lafayette. -
- All we need from you now is to RSVP so we know whether to expect - you there or not! -

-

Getting to BoilerMake

- {transitMessage} - - {applicationForm.rsvp !== null - ? applicationForm.rsvp === 1 - ? rsvpYes - : rsvpNo - : null //don't show rest of form if they haven't clicked yes or no yet - } -
- ); - break; - case 2: //WAITLIST - decisionForm = ( -
-

Thanks for applying.

-

- Unfortunately, we cannot accept you just yet. But don’t fret! - We’ll let you know if space opens up so that you can hopefully - attend BoilerMake this year. -

-
- ); - break; - case 4: //EXPIRED - decisionForm = ( -
-

Sorry about that.

-

- Unfortunately, your acceptance offer has expired. We hope to see - you at next year’s BoilerMake! -

-
- ); - break; - default: - decisionForm = ( -
-

There was an error!

-

- Sorry for the inconvenience. Please email us at{' '} - team@boilermake.org -

+ renderAccepted() { + const { applicationForm } = this.props.application; + + return ( +
+ {applicationForm.is_rsvp_confirmed === 1 ? ( +
+
+ Your RSVP has been recorded - we will see you at BoilerMake! +

+ Your check in code is:{' '} + + {applicationForm.user.hashid} + +
Please have this + your photo ID ready to expedite check + in. +

+
- ); - } - return
{decisionForm}
; + ) : ( +

+ Can you come? You must RSVP{' '} + {applicationForm.rsvp_deadline ? ( + by {applicationForm.rsvp_deadline} + ) : ( + soon + )}{' '} + or else we will offer your spot to someone else. +

+ )} +

You're in!

+

+ Congratulations, we’re excited to invite you to this year’s retro + twist on BoilerMake.{' '} + + 💜 + +
+ BoilerMake will last from around 6PM on Friday Sept 29 until + approximately 2PM on Sunday October 1, and it will be held on Purdue's + campus in West Lafayette. +
+ All we need from you now is to RSVP so we know whether to expect you + there or not! +

+

Getting to BoilerMake

+ {this.renderTransitMethod()} + + {applicationForm.rsvp !== null + ? applicationForm.rsvp === 1 + ? this.renderRSVPYes() + : this.renderRSVPNo() + : null //don't show rest of form if they haven't clicked yes or no yet + } +
+ ); + } + + renderWaitlist() { + return ( +
+

Thanks for applying.

+

+ Unfortunately, we cannot accept you just yet. But don’t fret! We’ll + let you know if space opens up so that you can hopefully attend + BoilerMake this year. +

+
+ ); + } + + renderExpired() { + return ( +
+

Sorry about that.

+

+ Unfortunately, your acceptance offer has expired. We hope to see you + at next year’s BoilerMake! +

+
+ ); + } + + renderError() { + return ( +
+

There was an error!

+

+ Sorry for the inconvenience. Please email us at{' '} + team@boilermake.org +

+
+ ); + } + + render() { + // let decisionMap = { + // 4: 'EXPIRED', + // 3: 'ACCEPT', + // 2: 'WAITLIST', + // 1: 'REJECT', + // 0: 'UNDECIDED' + // }; + const { applicationForm } = this.props.application; + + return ( + + {applicationForm === 3 ? this.renderAccepted() : null} + {applicationForm === 2 ? this.renderWaitlist() : null} + {applicationForm === 4 ? this.renderExpired() : null} + + ); } } @@ -253,4 +282,4 @@ const mapDispatchToProps = dispatch => { export default connect( mapStateToProps, mapDispatchToProps -)(ApplicationForm); +)(ApplicationDecision); diff --git a/src/pages/Application/_pillar.application.source.scss b/src/pages/Application/_pillar.application.source.scss index 48395b3..477eb50 100644 --- a/src/pages/Application/_pillar.application.source.scss +++ b/src/pages/Application/_pillar.application.source.scss @@ -76,3 +76,7 @@ color: $dark_mono; text-decoration: underline; } + +.p-decision { + margin-bottom: $spacing_100; +} diff --git a/src/pages/Dashboard/index.js b/src/pages/Dashboard/index.js index 65c134c..f331b8f 100644 --- a/src/pages/Dashboard/index.js +++ b/src/pages/Dashboard/index.js @@ -73,6 +73,8 @@ class Application extends Component { return (

Dashboard

+ {doesUserHaveDecision ? : null} +
@@ -125,8 +127,6 @@ class Application extends Component {
- - {doesUserHaveDecision ? : null}
); }