List signupees
This commit is contained in:
@@ -9,6 +9,7 @@ export interface SignupForm {
|
||||
start_time: string;
|
||||
end_time: string;
|
||||
questions: Question[];
|
||||
signups: string[];
|
||||
}
|
||||
|
||||
export async function getForms(): Promise<SignupForm[]> {
|
||||
|
||||
@@ -155,6 +155,7 @@ class SignUpPage extends React.Component<SignUpPageProps, SignUpPageState> {
|
||||
};
|
||||
if (payload.id === undefined) {
|
||||
const resp = await createSignup(payload);
|
||||
this.fetchSignUp();
|
||||
this.setState({
|
||||
error: null,
|
||||
statusMessage: "Sign-up submitted successfully",
|
||||
@@ -200,23 +201,37 @@ class SignUpPage extends React.Component<SignUpPageProps, SignUpPageState> {
|
||||
);
|
||||
}
|
||||
|
||||
renderList() {
|
||||
const { signUpForm } = this.state;
|
||||
return (
|
||||
<div>
|
||||
{signUpForm.signups.map(s => (
|
||||
<p key={s}>{s}</p>
|
||||
))}
|
||||
</div>
|
||||
)
|
||||
}
|
||||
|
||||
render() {
|
||||
const { match } = this.props;
|
||||
const { id } = match.params;
|
||||
const { signUpForm, statusMessage } = this.state;
|
||||
|
||||
const content = signUpForm !== null
|
||||
const form = signUpForm !== null
|
||||
? this.renderForm()
|
||||
: <div>Loading...</div>;
|
||||
|
||||
const signups = signUpForm && signUpForm.signups ? this.renderList() : null;
|
||||
|
||||
return (
|
||||
<div className="sign-up-page">
|
||||
<Helmet>
|
||||
<link rel="canonical" href={`https://sik.ayy.fi/signup/${id}`} />
|
||||
</Helmet>
|
||||
{statusMessage}
|
||||
<PageSection backgroundColor={ColorEnum.DarkBlue}>
|
||||
{statusMessage}
|
||||
{content}
|
||||
{form}
|
||||
{signups}
|
||||
</PageSection>
|
||||
</div>
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user