Skip to content
This repository has been archived by the owner on Oct 8, 2024. It is now read-only.

Commit

Permalink
Add option for under review and waitlist
Browse files Browse the repository at this point in the history
  • Loading branch information
harshithpabbati committed Sep 30, 2019
1 parent f6e90f8 commit 646383c
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 8 deletions.
4 changes: 2 additions & 2 deletions src/events/hacktoberfest/components/registration.js
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ class Registration extends React.Component {
if (Object.prototype.hasOwnProperty.call(response, 'errors')) {
this.setState({ loading: false, errorText: response.errors[0].message});
} else {
this.setState({ successText: response.data.id, errorText: '' })
this.setState({ successText: response.data.submitApplication.id, errorText: '' })
}
}
}
Expand Down Expand Up @@ -118,7 +118,7 @@ class Registration extends React.Component {
<div>
<h2 className="my-4 text-light">
<span>{this.state.count}</span> Already Registered.<br />
<span>{this.state.slotsLeft>=0 ? this.state.slotsLeft: 0}</span> Slots Left.<br />
{this.state.count < 200 ? <><span>{this.state.slotsLeft>=0 ? this.state.slotsLeft: 0}</span> Slots Left.<br /></>: <span>Join the WaitList</span>}
Register <span>Now</span></h2>
<p className="text-light">
Sign up for the meet-up for free by filling up the form below,
Expand Down
19 changes: 13 additions & 6 deletions src/events/mlh-hack-day/components/registration.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ const query=`
)
{
id
status
}
}
`;
Expand All @@ -28,7 +29,8 @@ class Registration extends React.Component {
errorText: '',
successText: '',
loading: false,
count: 0
count: 0,
status: ''
}
this.handleNameChange = this.handleNameChange.bind(this);
this.handleEmailChange = this.handleEmailChange.bind(this);
Expand Down Expand Up @@ -74,7 +76,7 @@ class Registration extends React.Component {
if (Object.prototype.hasOwnProperty.call(response, 'errors')) {
this.setState({ loading: false, errorText: response.errors[0].message});
} else {
this.setState({ successText: response.data.id, errorText: '' })
this.setState({ successText: response.data.submitApplication.id, errorText: '', status: response.data.submitApplication.status })
}
}
}
Expand Down Expand Up @@ -160,10 +162,15 @@ class Registration extends React.Component {
</div>
</div>
</form>
</div>) : this.state.successText !== '' ? (<div className="alert alert-success">
Thank You! You have successfully signed up for the event.
We will get back to soon, meanwhile dont forget to bring your friends as well!
</div>) :
</div>) : this.state.successText !== '' ?
this.state.status === "U" ?
(<div className="alert alert-success">
<h5>Thank You! Your application is Under Review.</h5>
We will get back to soon, meanwhile dont forget to bring your friends as well!
</div>) : (<div className="alert alert-warning">
<h5>Thank You! Your application has been Wait listed.</h5>
Sorry, we might not be able to accommodate everyone this time, stay tuned for more events.
</div> ):
<div className="alert alert-warning">Submitting. Please Wait</div>
}
</div>
Expand Down

0 comments on commit 646383c

Please sign in to comment.