|
| 1 | +import { |
| 2 | + Container, |
| 3 | + DateInput, |
| 4 | + InputSection, |
| 5 | + RadioInput, |
| 6 | + SelectInput, |
| 7 | + TextInput, |
| 8 | +} from '@ifrc-go/ui'; |
1 | 9 | import { useTranslation } from '@ifrc-go/ui/hooks'; |
| 10 | +import { |
| 11 | + numericIdSelector, |
| 12 | + stringNameSelector, |
| 13 | +} from '@ifrc-go/ui/utils'; |
2 | 14 |
|
| 15 | +import CountrySelectInput from '#components/domain/CountrySelectInput'; |
| 16 | +import DisasterTypeSelectInput from '#components/domain/DisasterTypeSelectInput'; |
| 17 | +import NationalSocietySelectInput from '#components/domain/NationalSocietySelectInput'; |
3 | 18 | import Page from '#components/Page'; |
4 | 19 |
|
5 | 20 | import i18n from './i18n.json'; |
| 21 | +import styles from './styles.module.css'; |
| 22 | + |
| 23 | +interface Props { |
| 24 | + disabled?: boolean; |
| 25 | +} |
| 26 | + |
| 27 | +const eapFormOptions = [ |
| 28 | + { value: 'full', label: 'Full application' }, |
| 29 | + { value: 'simplified', label: 'Simplified application' }, |
| 30 | + { value: 'not_sure', label: 'Not Sure' }, |
| 31 | +]; |
6 | 32 |
|
7 | 33 | /** @knipignore */ |
8 | 34 | // eslint-disable-next-line import/prefer-default-export |
9 | | -export function Component() { |
| 35 | +export function Component(props: Props) { |
| 36 | + const { |
| 37 | + disabled, |
| 38 | + } = props; |
| 39 | + |
10 | 40 | const strings = useTranslation(i18n); |
11 | 41 |
|
12 | 42 | return ( |
13 | 43 | <Page |
| 44 | + mainSectionClassName={styles.eapRegistrationForm} |
14 | 45 | heading={strings.eapRegistrationHeading} |
15 | 46 | description={strings.eapRegistrationDescription} |
| 47 | + withBackgroundColorInMainSection |
16 | 48 | > |
17 | | - {/* TODO: Add the form */} |
18 | | - Application Details |
| 49 | + <Container |
| 50 | + heading={strings.eapApplicationDetails} |
| 51 | + childrenContainerClassName={styles.content} |
| 52 | + > |
| 53 | + <InputSection |
| 54 | + title={strings.eapNationalSociety} |
| 55 | + description={strings.eapNationalSocietyDescription} |
| 56 | + withAsteriskOnTitle |
| 57 | + > |
| 58 | + <NationalSocietySelectInput |
| 59 | + error={undefined} |
| 60 | + name="national_society" |
| 61 | + onChange={() => {}} |
| 62 | + value={undefined} |
| 63 | + disabled={disabled} |
| 64 | + /> |
| 65 | + </InputSection> |
| 66 | + <InputSection |
| 67 | + title={strings.eapCountry} |
| 68 | + description={strings.eapCountryDescription} |
| 69 | + withAsteriskOnTitle |
| 70 | + > |
| 71 | + <CountrySelectInput |
| 72 | + error={undefined} |
| 73 | + name="country" |
| 74 | + onChange={() => {}} |
| 75 | + value={undefined} |
| 76 | + disabled={disabled} |
| 77 | + /> |
| 78 | + </InputSection> |
| 79 | + <InputSection |
| 80 | + title={strings.eapDisasterType} |
| 81 | + description={strings.eapDisasterTypeDescription} |
| 82 | + withAsteriskOnTitle |
| 83 | + > |
| 84 | + <DisasterTypeSelectInput |
| 85 | + name="disaster_type" |
| 86 | + value={undefined} |
| 87 | + onChange={() => {}} |
| 88 | + error={undefined} |
| 89 | + disabled={disabled} |
| 90 | + /> |
| 91 | + </InputSection> |
| 92 | + <InputSection |
| 93 | + title={strings.eapType} |
| 94 | + // TODO: Add link here |
| 95 | + description={strings.eapTypeDescription} |
| 96 | + withAsteriskOnTitle |
| 97 | + > |
| 98 | + <RadioInput |
| 99 | + name="" |
| 100 | + value={undefined} |
| 101 | + onChange={() => {}} |
| 102 | + options={eapFormOptions} |
| 103 | + keySelector={(option) => option.value} |
| 104 | + labelSelector={(option) => option.label} |
| 105 | + error={undefined} |
| 106 | + /> |
| 107 | + </InputSection> |
| 108 | + <InputSection |
| 109 | + title={strings.eapSubmission} |
| 110 | + description={strings.eapSubmissionDescription} |
| 111 | + withAsteriskOnTitle |
| 112 | + numPreferredColumns={2} |
| 113 | + > |
| 114 | + <DateInput |
| 115 | + name="" |
| 116 | + onChange={() => {}} |
| 117 | + value={undefined} |
| 118 | + /> |
| 119 | + <DateInput |
| 120 | + name="" |
| 121 | + onChange={() => {}} |
| 122 | + value={undefined} |
| 123 | + /> |
| 124 | + </InputSection> |
| 125 | + <InputSection |
| 126 | + title={strings.eapPartnersInvolved} |
| 127 | + description={strings.eapPartnersInvolvedDescription} |
| 128 | + withAsteriskOnTitle |
| 129 | + > |
| 130 | + <SelectInput |
| 131 | + name="" |
| 132 | + value={undefined} |
| 133 | + onChange={() => {}} |
| 134 | + keySelector={numericIdSelector} |
| 135 | + labelSelector={stringNameSelector} |
| 136 | + options={[]} |
| 137 | + /> |
| 138 | + </InputSection> |
| 139 | + </Container> |
| 140 | + <Container |
| 141 | + heading={strings.eapContacts} |
| 142 | + > |
| 143 | + <InputSection |
| 144 | + title={strings.eapNSContact} |
| 145 | + description={strings.eapNSContactDescription} |
| 146 | + numPreferredColumns={2} |
| 147 | + > |
| 148 | + <TextInput |
| 149 | + label={strings.eapNSName} |
| 150 | + name="" |
| 151 | + value={undefined} |
| 152 | + onChange={() => {}} |
| 153 | + error={undefined} |
| 154 | + disabled={disabled} |
| 155 | + /> |
| 156 | + <TextInput |
| 157 | + label={strings.eapNSTitle} |
| 158 | + name="" |
| 159 | + value={undefined} |
| 160 | + onChange={() => {}} |
| 161 | + error={undefined} |
| 162 | + disabled={disabled} |
| 163 | + /> |
| 164 | + <TextInput |
| 165 | + label={strings.eapNSEmail} |
| 166 | + name="" |
| 167 | + value={undefined} |
| 168 | + onChange={() => {}} |
| 169 | + error={undefined} |
| 170 | + disabled={disabled} |
| 171 | + /> |
| 172 | + <TextInput |
| 173 | + label={strings.eapNSPhoneNumber} |
| 174 | + name="" |
| 175 | + value={undefined} |
| 176 | + onChange={() => {}} |
| 177 | + error={undefined} |
| 178 | + disabled={disabled} |
| 179 | + /> |
| 180 | + </InputSection> |
| 181 | + <InputSection |
| 182 | + title={strings.eapIFRCContact} |
| 183 | + description={strings.eapIFRCContactDescription} |
| 184 | + numPreferredColumns={2} |
| 185 | + > |
| 186 | + <TextInput |
| 187 | + label={strings.eapIFRCName} |
| 188 | + name="" |
| 189 | + value={undefined} |
| 190 | + onChange={() => {}} |
| 191 | + error={undefined} |
| 192 | + disabled={disabled} |
| 193 | + /> |
| 194 | + <TextInput |
| 195 | + label={strings.eapIFRCTitle} |
| 196 | + name="" |
| 197 | + value={undefined} |
| 198 | + onChange={() => {}} |
| 199 | + error={undefined} |
| 200 | + disabled={disabled} |
| 201 | + /> |
| 202 | + <TextInput |
| 203 | + label={strings.eapIFRCEmail} |
| 204 | + name="" |
| 205 | + value={undefined} |
| 206 | + onChange={() => {}} |
| 207 | + error={undefined} |
| 208 | + disabled={disabled} |
| 209 | + /> |
| 210 | + <TextInput |
| 211 | + label={strings.eapIFRCPhoneNumber} |
| 212 | + name="" |
| 213 | + value={undefined} |
| 214 | + onChange={() => {}} |
| 215 | + error={undefined} |
| 216 | + disabled={disabled} |
| 217 | + /> |
| 218 | + </InputSection> |
| 219 | + <InputSection |
| 220 | + title={strings.eapFocalPoint} |
| 221 | + description={strings.eapFocalPointDescription} |
| 222 | + numPreferredColumns={2} |
| 223 | + > |
| 224 | + <TextInput |
| 225 | + label={strings.eapFocalPointName} |
| 226 | + name="" |
| 227 | + value={undefined} |
| 228 | + onChange={() => {}} |
| 229 | + error={undefined} |
| 230 | + disabled={disabled} |
| 231 | + /> |
| 232 | + <TextInput |
| 233 | + label={strings.eapFocalPointTitle} |
| 234 | + name="" |
| 235 | + value={undefined} |
| 236 | + onChange={() => {}} |
| 237 | + error={undefined} |
| 238 | + disabled={disabled} |
| 239 | + /> |
| 240 | + <TextInput |
| 241 | + label={strings.eapFocalPointEmail} |
| 242 | + name="" |
| 243 | + value={undefined} |
| 244 | + onChange={() => {}} |
| 245 | + error={undefined} |
| 246 | + disabled={disabled} |
| 247 | + /> |
| 248 | + <TextInput |
| 249 | + label={strings.eapFocalPointPhoneNumber} |
| 250 | + name="" |
| 251 | + value={undefined} |
| 252 | + onChange={() => {}} |
| 253 | + error={undefined} |
| 254 | + disabled={disabled} |
| 255 | + /> |
| 256 | + </InputSection> |
| 257 | + </Container> |
19 | 258 | </Page> |
20 | 259 | ); |
21 | 260 | } |
0 commit comments