|
| 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 | + className={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="Application Details" |
| 51 | + childrenContainerClassName={styles.content} |
| 52 | + > |
| 53 | + <InputSection |
| 54 | + title="National Society (NS)" |
| 55 | + description="Select National Society that is planning to apply for the EAP" |
| 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="Country" |
| 68 | + description="The country will be pre-populated based on the NS selection, but can be adapted as needed." |
| 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="Disaster Type" |
| 81 | + description="Select the disaster type for which the EAP is needed." |
| 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="EAP Type" |
| 94 | + // TODO: Add link here |
| 95 | + description="Select the EAP type. Find details of both under this link." |
| 96 | + > |
| 97 | + <RadioInput |
| 98 | + name="" |
| 99 | + value={undefined} |
| 100 | + onChange={() => {}} |
| 101 | + options={eapFormOptions} |
| 102 | + keySelector={(option) => option.value} |
| 103 | + labelSelector={(option) => option.label} |
| 104 | + error={undefined} |
| 105 | + /> |
| 106 | + </InputSection> |
| 107 | + <InputSection |
| 108 | + title="Expected Time of Submission" |
| 109 | + description="Include the proposed time of submission, accounting for the time it will take to deliver the application." |
| 110 | + withAsteriskOnTitle |
| 111 | + numPreferredColumns={2} |
| 112 | + > |
| 113 | + <DateInput |
| 114 | + name="" |
| 115 | + onChange={() => {}} |
| 116 | + value={undefined} |
| 117 | + /> |
| 118 | + <DateInput |
| 119 | + name="" |
| 120 | + onChange={() => {}} |
| 121 | + value={undefined} |
| 122 | + /> |
| 123 | + </InputSection> |
| 124 | + <InputSection |
| 125 | + title="Partners Involved" |
| 126 | + description="Select from the list the partners involved in this process. Add as many as needed or select not applicable if no partners involved." |
| 127 | + withAsteriskOnTitle |
| 128 | + > |
| 129 | + <SelectInput |
| 130 | + name="" |
| 131 | + value={undefined} |
| 132 | + onChange={() => {}} |
| 133 | + keySelector={numericIdSelector} |
| 134 | + labelSelector={stringNameSelector} |
| 135 | + options={[]} |
| 136 | + /> |
| 137 | + </InputSection> |
| 138 | + </Container> |
| 139 | + <Container |
| 140 | + heading="Contacts" |
| 141 | + > |
| 142 | + <InputSection |
| 143 | + title="National Society Contact" |
| 144 | + description="National Society contact responsible for the EAP process" |
| 145 | + numPreferredColumns={2} |
| 146 | + > |
| 147 | + <TextInput |
| 148 | + label="Name" |
| 149 | + name="" |
| 150 | + value={undefined} |
| 151 | + onChange={() => {}} |
| 152 | + error={undefined} |
| 153 | + disabled={disabled} |
| 154 | + /> |
| 155 | + <TextInput |
| 156 | + label="Title" |
| 157 | + name="" |
| 158 | + value={undefined} |
| 159 | + onChange={() => {}} |
| 160 | + error={undefined} |
| 161 | + disabled={disabled} |
| 162 | + /> |
| 163 | + <TextInput |
| 164 | + label="Email" |
| 165 | + name="" |
| 166 | + value={undefined} |
| 167 | + onChange={() => {}} |
| 168 | + error={undefined} |
| 169 | + disabled={disabled} |
| 170 | + /> |
| 171 | + <TextInput |
| 172 | + label="Phone Number" |
| 173 | + name="" |
| 174 | + value={undefined} |
| 175 | + onChange={() => {}} |
| 176 | + error={undefined} |
| 177 | + disabled={disabled} |
| 178 | + /> |
| 179 | + </InputSection> |
| 180 | + <InputSection |
| 181 | + title="IFRC Contact" |
| 182 | + description="The most senior staff in the National Society responsible and knowledgable about the disaster event." |
| 183 | + numPreferredColumns={2} |
| 184 | + > |
| 185 | + <TextInput |
| 186 | + label="Name" |
| 187 | + name="" |
| 188 | + value={undefined} |
| 189 | + onChange={() => {}} |
| 190 | + error={undefined} |
| 191 | + disabled={disabled} |
| 192 | + /> |
| 193 | + <TextInput |
| 194 | + label="Title" |
| 195 | + name="" |
| 196 | + value={undefined} |
| 197 | + onChange={() => {}} |
| 198 | + error={undefined} |
| 199 | + disabled={disabled} |
| 200 | + /> |
| 201 | + <TextInput |
| 202 | + label="Email" |
| 203 | + name="" |
| 204 | + value={undefined} |
| 205 | + onChange={() => {}} |
| 206 | + error={undefined} |
| 207 | + disabled={disabled} |
| 208 | + /> |
| 209 | + <TextInput |
| 210 | + label="Phone Number" |
| 211 | + name="" |
| 212 | + value={undefined} |
| 213 | + onChange={() => {}} |
| 214 | + error={undefined} |
| 215 | + disabled={disabled} |
| 216 | + /> |
| 217 | + </InputSection> |
| 218 | + <InputSection |
| 219 | + title="DREF Focal Point" |
| 220 | + description="The DREF contact person form IFRCF" |
| 221 | + numPreferredColumns={2} |
| 222 | + > |
| 223 | + <TextInput |
| 224 | + label="Name" |
| 225 | + name="" |
| 226 | + value={undefined} |
| 227 | + onChange={() => {}} |
| 228 | + error={undefined} |
| 229 | + disabled={disabled} |
| 230 | + /> |
| 231 | + <TextInput |
| 232 | + label="Title" |
| 233 | + name="" |
| 234 | + value={undefined} |
| 235 | + onChange={() => {}} |
| 236 | + error={undefined} |
| 237 | + disabled={disabled} |
| 238 | + /> |
| 239 | + <TextInput |
| 240 | + label="Email" |
| 241 | + name="" |
| 242 | + value={undefined} |
| 243 | + onChange={() => {}} |
| 244 | + error={undefined} |
| 245 | + disabled={disabled} |
| 246 | + /> |
| 247 | + <TextInput |
| 248 | + label="Phone Number" |
| 249 | + name="" |
| 250 | + value={undefined} |
| 251 | + onChange={() => {}} |
| 252 | + error={undefined} |
| 253 | + disabled={disabled} |
| 254 | + /> |
| 255 | + </InputSection> |
| 256 | + </Container> |
19 | 257 | </Page> |
20 | 258 | ); |
21 | 259 | } |
0 commit comments