Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add remark in the campaign application stepper (Epic #1842) #1861

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import CampaignApplicationOrganizer from './steps/CampaignApplicationOrganizer'
import CampaignApplicationDetails from './steps/CampaignApplicationDetails'
import CampaignApplication from './steps/CampaignApplication'
import CampaignApplicationFormActions from './CampaignApplicationFormActions'
import CampaignApplicationRemark from './CampaignApplicationRemark'
import stepsHandler from './helpers/stepsHandler'

import {
Expand Down Expand Up @@ -48,22 +49,29 @@ export default function CampaignApplicationForm() {
}, [])

return (
<GenericForm<Record<string, string>> onSubmit={handleSubmit} initialValues={initialValues}>
<StyledCampaignApplicationStepper activeStep={activeStep} connector={<StyledStepConnector />}>
{steps.map((step) => (
<StyledCampaignApplicationStep key={step.title}>
<StepLabel StepIconComponent={CampaignApplicationStepperIcon} />
</StyledCampaignApplicationStep>
))}
</StyledCampaignApplicationStepper>
<ActionsContainer container spacing={5}>
<Grid container item xs={12}>
{activeStep < steps.length && steps[activeStep].component}
</Grid>
<Grid container item spacing={3}>
<CampaignApplicationFormActions activeStep={activeStep} onBack={handleBack} />
</Grid>
</ActionsContainer>
</GenericForm>
<>
<GenericForm<Record<string, string>> onSubmit={handleSubmit} initialValues={initialValues}>
<StyledCampaignApplicationStepper
activeStep={activeStep}
connector={<StyledStepConnector />}>
{steps.map((step) => (
<StyledCampaignApplicationStep key={step.title}>
<StepLabel StepIconComponent={CampaignApplicationStepperIcon} />
</StyledCampaignApplicationStep>
))}
</StyledCampaignApplicationStepper>
<ActionsContainer container spacing={5}>
<Grid container item xs={12}>
{activeStep < steps.length && steps[activeStep].component}
</Grid>
<Grid container item spacing={3}>
<CampaignApplicationFormActions activeStep={activeStep} onBack={handleBack} />
</Grid>
</ActionsContainer>
</GenericForm>
{(activeStep === Steps.ORGANIZER || activeStep === Steps.CAMPAIGN) && (
<CampaignApplicationRemark />
)}
</>
)
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
import { Typography, Link, styled } from '@mui/material'
import { useTranslation } from 'next-i18next'
import { routes } from 'common/routes'

const StyledRemark = styled(Typography)(() => ({
textAlign: 'center',
maxWidth: '80%',
margin: '100px auto',
fontSize: '12px',
}))

export default function CampaignApplicationRemark() {
const { t } = useTranslation('campaign-application')

return (
<StyledRemark>
{t('remark.part-one')}
<Link href={routes.termsOfService} target="_blank">
{t('remark.links.terms')}
</Link>
{t('remark.part-two')}
<Link href={routes.faq} target="_blank">
{t('remark.links.faq')}
</Link>
</StyledRemark>
)
}
Loading