-
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
…1884) * feat: campaign application step skeleton * feat: campaign details step skeleton * fix: linter return error
- Loading branch information
1 parent
b2c43dd
commit 3e7dab5
Showing
6 changed files
with
281 additions
and
2 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
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
93 changes: 92 additions & 1 deletion
93
src/components/client/campaign-application/steps/CampaignApplication.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,94 @@ | ||
import { FormControl, Grid, Typography } from '@mui/material' | ||
import { Field, useField } from 'formik' | ||
import { useTranslation } from 'next-i18next' | ||
|
||
import { StyledFormTextField, StyledStepHeading } from '../helpers/campaignApplication.styled' | ||
import { CampaignEndTypes } from '../helpers/campaignApplication.types' | ||
import CampaignTypeSelect from 'components/client/campaigns/CampaignTypeSelect' | ||
import FormDatePicker from 'components/common/form/FormDatePicker' | ||
|
||
import theme from 'common/theme' | ||
|
||
export default function CampaignApplication() { | ||
return <div>Campaign Application</div> | ||
const { t } = useTranslation('campaign-application') | ||
const [campaignEnd] = useField('application.campaignEnd') | ||
|
||
return ( | ||
<Grid container spacing={6} justifyContent="center" direction="column" alignContent="center"> | ||
<Grid item container justifyContent="center"> | ||
<StyledStepHeading variant="h4">{t('steps.application.title')}</StyledStepHeading> | ||
</Grid> | ||
<Grid item container spacing={6} justifyContent="space-between" direction="row"> | ||
<Grid item xs={12}> | ||
<StyledFormTextField | ||
label={t('steps.application.beneficiary')} | ||
type="text" | ||
name="application.beneficiary" | ||
autoComplete="name" | ||
/> | ||
</Grid> | ||
<Grid item xs={12}> | ||
<CampaignTypeSelect /> | ||
</Grid> | ||
<Grid item xs={12}> | ||
<StyledFormTextField | ||
label={t('steps.application.funds')} | ||
type="number" | ||
name="application.funds" | ||
/> | ||
</Grid> | ||
<Grid container item> | ||
<Grid item xs={12}> | ||
<Typography sx={{ fontSize: theme.typography.pxToRem(16), paddingBottom: 2 }}> | ||
{t('steps.application.campaign-end.title')} | ||
</Typography> | ||
</Grid> | ||
<Grid container item xs={12}> | ||
<FormControl> | ||
<Grid container item spacing={2} xs={12}> | ||
<Grid item xs={12}> | ||
<label> | ||
<Field | ||
size="medium" | ||
type="radio" | ||
name="application.campaignEnd" | ||
value={CampaignEndTypes.FUNDS} | ||
/> | ||
{t('steps.application.campaign-end.options.funds')} | ||
</label> | ||
</Grid> | ||
<Grid item xs={12}> | ||
<label> | ||
<Field | ||
size="medium" | ||
type="radio" | ||
name="application.campaignEnd" | ||
value={CampaignEndTypes.ONGOING} | ||
/> | ||
{t('steps.application.campaign-end.options.ongoing')} | ||
</label> | ||
</Grid> | ||
<Grid item xs={12}> | ||
<label> | ||
<Field | ||
size="medium" | ||
type="radio" | ||
name="application.campaignEnd" | ||
value={CampaignEndTypes.DATE} | ||
/> | ||
{t('steps.application.campaign-end.options.date')} | ||
</label> | ||
</Grid> | ||
</Grid> | ||
{campaignEnd.value === CampaignEndTypes.DATE && ( | ||
<Grid item xs={6} sx={{ paddingTop: 2 }}> | ||
<FormDatePicker name="application.campaign-end" label="" /> | ||
</Grid> | ||
)} | ||
</FormControl> | ||
</Grid> | ||
</Grid> | ||
</Grid> | ||
</Grid> | ||
) | ||
} |
104 changes: 103 additions & 1 deletion
104
src/components/client/campaign-application/steps/CampaignApplicationDetails.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,105 @@ | ||
import { useTranslation } from 'next-i18next' | ||
import { Grid, Typography } from '@mui/material' | ||
|
||
import { StyledStepHeading } from '../helpers/campaignApplication.styled' | ||
import FormTextField from 'components/common/form/FormTextField' | ||
|
||
import theme from 'common/theme' | ||
import FileUpload from 'components/common/file-upload/FileUpload' | ||
|
||
export default function CampaignApplicationDetails() { | ||
return <div>Campaign Application Details</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.details.title')}</StyledStepHeading> | ||
</Grid> | ||
<Grid item container spacing={6} justifyContent="space-between" direction="row"> | ||
<Grid item xs={12}> | ||
<FormTextField | ||
type="text" | ||
name="details.description" | ||
label={t('steps.details.description')} | ||
multiline | ||
rows={3} | ||
/> | ||
</Grid> | ||
<Grid item xs={12}> | ||
<FormTextField | ||
type="text" | ||
name="details.currentStatus" | ||
label={t('steps.details.current-status.label')} | ||
placeholder={t('steps.details.current-status.placeholder')} | ||
multiline | ||
rows={5} | ||
/> | ||
</Grid> | ||
<Grid item xs={12}> | ||
<FormTextField | ||
type="text" | ||
name="details.cause" | ||
label={t('steps.details.cause')} | ||
multiline | ||
rows={3} | ||
/> | ||
</Grid> | ||
<Grid item xs={12}> | ||
<Typography sx={{ fontSize: theme.typography.pxToRem(16), paddingBottom: 2 }}> | ||
{t('steps.details.links.label')} | ||
</Typography> | ||
<Grid container item spacing={2} xs={12}> | ||
<Grid item xs={12}> | ||
<FormTextField | ||
type="text" | ||
name="details.links.website" | ||
label="" | ||
placeholder={t('steps.details.links.fields.website')} | ||
/> | ||
</Grid> | ||
<Grid item xs={12}> | ||
<FormTextField | ||
type="text" | ||
name="details.links.media" | ||
label="" | ||
placeholder={t('steps.details.links.fields.media')} | ||
/> | ||
</Grid> | ||
<Grid item xs={12}> | ||
<FormTextField | ||
type="text" | ||
name="details.links.facebook" | ||
label="" | ||
placeholder={t('steps.details.links.fields.facebook')} | ||
/> | ||
</Grid> | ||
<Grid item xs={12}> | ||
<FormTextField | ||
type="text" | ||
name="details.links.donationPlatform" | ||
label="" | ||
placeholder={t('steps.details.links.fields.donation-platforms')} | ||
/> | ||
</Grid> | ||
</Grid> | ||
</Grid> | ||
<Grid item xs={12}> | ||
<FileUpload | ||
buttonLabel={t('steps.details.photos')} | ||
onUpload={(files) => { | ||
return | ||
}} | ||
/> | ||
</Grid> | ||
<Grid item xs={12}> | ||
<FileUpload | ||
buttonLabel={t('steps.details.documents')} | ||
onUpload={(files) => { | ||
return | ||
}} | ||
/> | ||
</Grid> | ||
</Grid> | ||
</Grid> | ||
) | ||
} |