Download wp-calypso/client/jetpack-cloud/sections/agency-signup/controller.tsx from Devendra174/react-code-dataset: direct link, hf CLI and curl.
- Browser
- Download file 770 Bytes
-
https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/wp-calypso/client/jetpack-cloud/sections/agency-signup/controller.tsx
- Command line
-
hf download hf://datasets/Devendra174/react-code-dataset/wp-calypso/client/jetpack-cloud/sections/agency-signup/controller.tsx
-
curl -L -o controller.tsx https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/wp-calypso/client/jetpack-cloud/sections/agency-signup/controller.tsx
770 Bytes
| import page, { type Callback } from '@automattic/calypso-router'; | |
| import AgencySignUp from 'calypso/jetpack-cloud/sections/agency-signup/primary/agency-signup'; | |
| import { partnerPortalBasePath } from 'calypso/lib/jetpack/paths'; | |
| import { getCurrentPartner } from 'calypso/state/partner-portal/partner/selectors'; | |
| export const requireNoPartnerRecordContext: Callback = ( context, next ) => { | |
| const state = context.store.getState(); | |
| const partner = getCurrentPartner( state ); | |
| // Users who already have a partner record should be redirected away from the signup form. | |
| if ( partner ) { | |
| page.redirect( partnerPortalBasePath() ); | |
| return; | |
| } | |
| next(); | |
| }; | |
| export const signUpContext: Callback = ( context, next ) => { | |
| context.primary = <AgencySignUp />; | |
| next(); | |
| }; | |