569d887d1e
Renaming the package so any further PRs directed to the website are targeted to the reworked code instead of diverging. Once merged, I will start preparing this for deployment to dev to test before releasing to prod. Any improvements will also be applied to this package. I avoided making significant changes to API routes so nothing breaks, but will test it thoroughly today to confirm. That said, everything is ported - double checked. Big diff PR, impossible to review, but last one! No more rebuilds.
26 lines
713 B
TypeScript
26 lines
713 B
TypeScript
'use client';
|
|
|
|
import { useMemo, useState, type ReactNode } from 'react';
|
|
|
|
import { PartnerApplicationModal } from './PartnerApplicationModal';
|
|
import { PartnerApplicationModalContext } from './partner-application-modal-context';
|
|
|
|
export function PartnerApplicationModalRoot({
|
|
children,
|
|
}: {
|
|
children: ReactNode;
|
|
}) {
|
|
const [isOpen, setIsOpen] = useState(false);
|
|
const contextValue = useMemo(
|
|
() => ({ openPartnerApplicationModal: () => setIsOpen(true) }),
|
|
[],
|
|
);
|
|
|
|
return (
|
|
<PartnerApplicationModalContext.Provider value={contextValue}>
|
|
{children}
|
|
<PartnerApplicationModal onClose={() => setIsOpen(false)} open={isOpen} />
|
|
</PartnerApplicationModalContext.Provider>
|
|
);
|
|
}
|