-
Notifications
You must be signed in to change notification settings - Fork 92
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
- Loading branch information
1 parent
6b5d3e8
commit 9a5fa5a
Showing
2 changed files
with
36 additions
and
15 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
16 changes: 15 additions & 1 deletion
16
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,24 @@ | ||
import { CircularProgress, Grid } from '@mui/material' | ||
import { useSession } from 'next-auth/react' | ||
import { useViewPersonByKeylockId } from 'common/hooks/person' | ||
import Layout from '../layout/Layout' | ||
import CampaignApplicationForm from './CampaignApplicationForm' | ||
|
||
export default function CampaignApplicationPage() { | ||
const { data: session } = useSession() | ||
const { data: person, isLoading } = useViewPersonByKeylockId(session?.user?.sub as string) | ||
|
||
if (isLoading) { | ||
return ( | ||
<Grid container justifyContent="center" alignContent="center" sx={{ height: '100vh' }}> | ||
<CircularProgress /> | ||
</Grid> | ||
) | ||
} | ||
|
||
return ( | ||
<Layout maxWidth="md" sx={{ paddingInline: 5 }}> | ||
<CampaignApplicationForm /> | ||
{person && <CampaignApplicationForm person={person} />} | ||
</Layout> | ||
) | ||
} |