-
Notifications
You must be signed in to change notification settings - Fork 88
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
* feat: add remark in the stepper * add translations for step one * refactor action buttons styles * create CampaignApplicationOrganizer component * edit CampaignApplicationOrganizer * add yup validation to campaign application organizer form * fix styles to be responsive * fix: adjust spacing between fields and buttons to be the same * refactor organizer step form according to endpoint schema * refactor action buttons styles
- Loading branch information
1 parent
9552937
commit 8c6e1a0
Showing
9 changed files
with
160 additions
and
39 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,22 @@ | ||
{ | ||
"steps": { | ||
"organizer": { | ||
"title": "Организатор", | ||
"name": "Вашите име и фамилия", | ||
"phone": "Телефон за връзка", | ||
"email": "Email" | ||
} | ||
}, | ||
"cta": { | ||
"next": "Запазете и продължете", | ||
"back": "Назад" | ||
}, | ||
"remark": { | ||
"part-one": "*Допълнителна информация за процеса на кандидатстване и неговите етапи можете да намерите в нашите ", | ||
"part-two": "и в секцията ", | ||
"links": { | ||
"terms": "Общи условия ", | ||
"faq": "Често задавани въпроси" | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
29 changes: 29 additions & 0 deletions
29
src/components/client/campaign-application/helpers/validation-schema.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
import * as yup from 'yup' | ||
|
||
import { name, phone, email } from 'common/form/validation' | ||
|
||
import { | ||
CampaignApplicationFormDataSteps, | ||
CampaignApplicationOrganizer, | ||
Steps, | ||
} from './campaignApplication.types' | ||
|
||
const organizer: yup.SchemaOf<CampaignApplicationOrganizer> = yup | ||
.object() | ||
.shape({ | ||
name: name.required(), | ||
phone: phone.required(), | ||
email: email.required(), | ||
}) | ||
.defined() | ||
|
||
export const validationSchema: { | ||
[key in Steps]?: | ||
| yup.SchemaOf<CampaignApplicationFormDataSteps[Steps.NONE]> | ||
| yup.SchemaOf<CampaignApplicationFormDataSteps[Steps.ORGANIZER]> | ||
} = { | ||
[Steps.NONE]: undefined, | ||
[Steps.ORGANIZER]: yup.object().shape({ | ||
organizer: organizer.required(), | ||
}), | ||
} |
44 changes: 43 additions & 1 deletion
44
src/components/client/campaign-application/steps/CampaignApplicationOrganizer.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,45 @@ | ||
import { useTranslation } from 'next-i18next' | ||
|
||
import { Grid } from '@mui/material' | ||
|
||
import { StyledStepHeading, StyledFormTextField } from '../helpers/campaignApplication.styled' | ||
|
||
export default function CampaignApplicationOrganizer() { | ||
return <div>Campaign Application Organizer</div> | ||
const { t } = useTranslation('campaign-application') | ||
|
||
return ( | ||
<Grid container spacing={6} justifyContent="center" direction="column" alignContent="center"> | ||
<Grid item container justifyContent="center"> | ||
<StyledStepHeading variant="h4">{t('steps.organizer.title')}</StyledStepHeading> | ||
</Grid> | ||
<Grid item container spacing={6} justifyContent="space-between" direction="row"> | ||
<Grid item xs={12} flexWrap="nowrap"> | ||
<StyledFormTextField | ||
label={t('steps.organizer.name')} | ||
type="text" | ||
name="organizer.name" | ||
autoComplete="name" | ||
/> | ||
</Grid> | ||
</Grid> | ||
<Grid item container spacing={6} justifyContent="space-between" direction="row"> | ||
<Grid container item xs={12} md={6} flexWrap="nowrap"> | ||
<StyledFormTextField | ||
label={t('steps.organizer.phone')} | ||
type="phone" | ||
name="organizer.phone" | ||
autoComplete="tel" | ||
/> | ||
</Grid> | ||
<Grid container item xs={12} md={6} flexWrap="nowrap"> | ||
<StyledFormTextField | ||
label={t('steps.organizer.email')} | ||
type="email" | ||
name="organizer.email" | ||
autoComplete="email" | ||
/> | ||
</Grid> | ||
</Grid> | ||
</Grid> | ||
) | ||
} |