diff --git a/src/models/SignupForm.ts b/src/models/SignupForm.ts index 4e1c9a9..455453a 100644 --- a/src/models/SignupForm.ts +++ b/src/models/SignupForm.ts @@ -10,6 +10,7 @@ export interface SignupForm { end_time: string; questions: Question[]; signups: string[]; + quota: number; } export async function getForms(): Promise { diff --git a/src/pages/admin/SignupCreatePage.tsx b/src/pages/admin/SignupCreatePage.tsx index dc89580..ce31ac8 100644 --- a/src/pages/admin/SignupCreatePage.tsx +++ b/src/pages/admin/SignupCreatePage.tsx @@ -132,6 +132,11 @@ class SignupCreatePage extends React.Component label { - margin: 0.5rem 0; - font-weight: 600; - display: block; + .sign-up-list { + justify-content: start; + li { + padding-bottom: 0.3rem; } - input[type="text"] { - display: block; - } - - input[type="radio"], input[type="checkbox"] { - margin-right: 4px; + .reserved { + color: color(blue1); } } - .question { - display: flex; - flex-flow: column nowrap; + .sign-up-form { + legend { + display: none; + } - span { - input { - margin-right: 1rem; + & > div:last-child { + display: flex; + justify-content: center; + + button[type="submit"] { + @extend .button; + @extend .filled; + } + } + + fieldset { + border: none; + padding: 0; + margin: 1rem 0; + + .form-group { + padding-bottom: 0.5rem; + + & > label { + margin: 0.5rem 0; + font-weight: 600; + display: block; + } } - h3 { - margin: 0.5rem 0; + input[type="text"], input[type="email"] { + display: block; + height: 48px; + width: 100%; + font-size: 1.5rem; + padding: 0 16px; + } + + input[type="radio"], input[type="checkbox"] { + margin-right: 4px; + width: 24px; + height: 24px; + } + + .radio, .checkbox { + padding-bottom: 0.5rem; + + & > label { + display: block; + height: 100%; + + & span { + vertical-align: super; + } + } } } } diff --git a/src/views/SignUpPage/SignUpPageView.tsx b/src/views/SignUpPage/SignUpPageView.tsx index 4b573be..1f9fe8f 100644 --- a/src/views/SignUpPage/SignUpPageView.tsx +++ b/src/views/SignUpPage/SignUpPageView.tsx @@ -4,6 +4,8 @@ import "./SignUpPage.scss"; import PageSection from "@components/PageSection"; import { SignupForm } from "@models/SignupForm"; import { buildSchema, buildUISchema } from "./FormUtils"; +import AsideSection from "@components/AsideSection"; +import MainSection from "@components/MainSection"; interface SignUpPageViewProps { signUpForm: SignupForm; @@ -15,11 +17,16 @@ interface SignUpPageViewProps { const renderList = (signUpForm: SignupForm) => { return ( -
    - {signUpForm.signups.map((s, idx) => ( -
  1. {s}
  2. - ))} -
+ <> +
+ Ilmoittautuneet {signUpForm.quota && (`(${signUpForm.signups.length}/${signUpForm.quota})`)}: +
+
    + {signUpForm.signups.map((s, idx) => ( +
  1. signUpForm.quota ? "reserved" : ""}>{s}
  2. + ))} +
+ ) } @@ -36,8 +43,10 @@ const SignUpPageView: React.FC = ({ const uiSchema = buildUISchema(signUpForm); return ( -
-

Title: {signUpForm.title}

+ <> +

+ {signUpForm.title} +

= ({ idPrefix="rjsf" onChange={onChange} onSubmit={onSubmit} + className="sign-up-form" /> -
+ ); } const form = signUpForm !== null ? renderForm() - :
Loading...
; + : <>Loading...; const signups = signUpForm && signUpForm.signups ? renderList(signUpForm) : null; return ( -
- {statusMessage} - + + + + + {statusMessage} + {form} + + {signups} - -
+ + ) }