597 bytes of JavaScript
Created 9 hours ago
— expires in 1 day
Viewed
23 times
https://dpaste.com/D78DW4B6R
| <PageWithForm
formConfig={commonSectionMap}
// optionally set desktopLaunchText/desktopButtonText here
....
/>
----
const PageWithForm = ({
formConfig,
children,
desktopLaunchText,
desktopButtonText,
...props
}) => (
<FormContextProvider sectionMap={formConfig}>
<Page {...props}>
{children}
<FormWrapper
desktopLaunchText
desktopButtonText
/>
</Page>
</FormContextProvider>
)
----
FormWrapper.defaultProps = {
desktopLaunchText:'Ready to sign up?',
desktopButtonText:'Get started',
}
|
<PageWithForm
formConfig={commonSectionMap}
// optionally set desktopLaunchText/desktopButtonText here
....
/>
----
const PageWithForm = ({
formConfig,
children,
desktopLaunchText,
desktopButtonText,
...props
}) => (
<FormContextProvider sectionMap={formConfig}>
<Page {...props}>
{children}
<FormWrapper
desktopLaunchText
desktopButtonText
/>
</Page>
</FormContextProvider>
)
----
FormWrapper.defaultProps = {
desktopLaunchText:'Ready to sign up?',
desktopButtonText:'Get started',
}