-
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.
feat: prefill campaign application organizer form values from current…
… user (Epic #1842) (#1874) * feat: prefill campaign application organizer form values from current user * fix: remove useMemo * fix: change to useCurrentPerson hook
- Loading branch information
1 parent
04b266c
commit fc91dd0
Showing
2 changed files
with
31 additions
and
14 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
15 changes: 14 additions & 1 deletion
15
src/components/client/campaign-application/CampaignApplicationPage.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,10 +1,23 @@ | ||
import { CircularProgress, Grid } from '@mui/material' | ||
import { useCurrentPerson } from 'common/util/useCurrentPerson' | ||
import Layout from '../layout/Layout' | ||
import CampaignApplicationForm from './CampaignApplicationForm' | ||
|
||
export default function CampaignApplicationPage() { | ||
const { data: userData, isLoading } = useCurrentPerson() | ||
const person = userData?.user || undefined | ||
|
||
if (isLoading) { | ||
return ( | ||
<Grid container justifyContent="center" alignContent="center" sx={{ height: '100vh' }}> | ||
<CircularProgress /> | ||
</Grid> | ||
) | ||
} | ||
|
||
return ( | ||
<Layout maxWidth="md" sx={{ paddingInline: 5 }}> | ||
<CampaignApplicationForm /> | ||
<CampaignApplicationForm person={person} /> | ||
</Layout> | ||
) | ||
} |