feat(apps): registration step 5 pages in bull and bear
Add /onboarding/creator-profile and /onboarding/investor-profile to both
apps, with the group's loading skeleton. Each page renders its frame on the
server and its step only in the browser behind AuthGuard for its role, with
noindex. bull uses the mobile top bar and column; bear the desktop header,
with the creator's form card beside its live preview (AuthTemplate
`framed={false}`) and the investor in the 560 card.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
parent
436695ae0b
commit
a6e6eddc94
|
|
@ -0,0 +1,13 @@
|
||||||
|
import { SkeletonPreset } from '@lumina/island/organisms/skeleton-preset';
|
||||||
|
|
||||||
|
import { i18n } from '../../i18n';
|
||||||
|
import { AuthTemplate } from '../templates/auth-template';
|
||||||
|
|
||||||
|
/** Registration's last steps, before their frame arrives: the header, the card and a form step's shape. */
|
||||||
|
export default function OnboardingLoading() {
|
||||||
|
return (
|
||||||
|
<AuthTemplate width="wide">
|
||||||
|
<SkeletonPreset preset="form" delayed label={i18n.t('auth:loading')} />
|
||||||
|
</AuthTemplate>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,43 @@
|
||||||
|
import { AuthGuard } from '@lumina/market/app/guards/auth-guard';
|
||||||
|
import {
|
||||||
|
CreatorProfileStep,
|
||||||
|
CreatorProfileStepSkeleton,
|
||||||
|
} from '@lumina/market/app/screens/(onboarding)/onboarding/creator-profile/organisms/creator-profile-step';
|
||||||
|
import type { Metadata } from 'next';
|
||||||
|
import { Suspense } from 'react';
|
||||||
|
|
||||||
|
import { i18n } from '../../../../i18n';
|
||||||
|
import { AuthTemplate } from '../../../templates/auth-template';
|
||||||
|
|
||||||
|
export function generateMetadata(): Metadata {
|
||||||
|
return {
|
||||||
|
title: i18n.t('auth:register.profile.meta-title'),
|
||||||
|
robots: { index: false },
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Registration step 5 for a creator, on the session: the form card beside its live preview. The
|
||||||
|
* frame renders on the server; the step only in the browser, behind the same-size skeleton.
|
||||||
|
*/
|
||||||
|
export default function CreatorProfilePage() {
|
||||||
|
const skeleton = (
|
||||||
|
<CreatorProfileStepSkeleton
|
||||||
|
layout="desktop"
|
||||||
|
label={i18n.t('auth:loading')}
|
||||||
|
/>
|
||||||
|
);
|
||||||
|
return (
|
||||||
|
<AuthTemplate framed={false}>
|
||||||
|
<AuthGuard role="creator" fallback={skeleton}>
|
||||||
|
<Suspense fallback={skeleton}>
|
||||||
|
<CreatorProfileStep
|
||||||
|
size="md"
|
||||||
|
layout="desktop"
|
||||||
|
supportPlacement="popover"
|
||||||
|
/>
|
||||||
|
</Suspense>
|
||||||
|
</AuthGuard>
|
||||||
|
</AuthTemplate>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,37 @@
|
||||||
|
import { SkeletonPreset } from '@lumina/island/organisms/skeleton-preset';
|
||||||
|
import { AuthGuard } from '@lumina/market/app/guards/auth-guard';
|
||||||
|
import { InvestorProfileStep } from '@lumina/market/app/screens/(onboarding)/onboarding/investor-profile/organisms/investor-profile-step';
|
||||||
|
import type { Metadata } from 'next';
|
||||||
|
|
||||||
|
import { i18n } from '../../../../i18n';
|
||||||
|
import { AuthTemplate } from '../../../templates/auth-template';
|
||||||
|
|
||||||
|
export function generateMetadata(): Metadata {
|
||||||
|
return {
|
||||||
|
title: i18n.t('auth:register.profile.meta-title'),
|
||||||
|
robots: { index: false },
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Registration step 5 for an investor, optional, on the session, in the 560 card. The frame
|
||||||
|
* renders on the server; the step only in the browser, for the signed-in investor.
|
||||||
|
*/
|
||||||
|
export default function InvestorProfilePage() {
|
||||||
|
return (
|
||||||
|
<AuthTemplate width="wide">
|
||||||
|
<AuthGuard
|
||||||
|
role="investor"
|
||||||
|
fallback={
|
||||||
|
<SkeletonPreset
|
||||||
|
preset="form"
|
||||||
|
count={2}
|
||||||
|
label={i18n.t('auth:loading')}
|
||||||
|
/>
|
||||||
|
}
|
||||||
|
>
|
||||||
|
<InvestorProfileStep size="md" supportPlacement="popover" />
|
||||||
|
</AuthGuard>
|
||||||
|
</AuthTemplate>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
@ -11,11 +11,13 @@ import type { AuthTemplateProps } from './types';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Login and registration on desktop: the logged-out header (the brand and support) and each
|
* Login and registration on desktop: the logged-out header (the brand and support) and each
|
||||||
* step in one centred card, its buttons inside the card under the fields. Browser back is the
|
* step in one centred card, its buttons inside the card under the fields. Registration step 5
|
||||||
|
* keeps the header, signed in: there is no nav until registration is complete. Browser back is the
|
||||||
* way back; there is no back button.
|
* way back; there is no back button.
|
||||||
*/
|
*/
|
||||||
export function AuthTemplate({
|
export function AuthTemplate({
|
||||||
width = 'narrow',
|
width = 'narrow',
|
||||||
|
framed = true,
|
||||||
children,
|
children,
|
||||||
}: AuthTemplateProps) {
|
}: AuthTemplateProps) {
|
||||||
return (
|
return (
|
||||||
|
|
@ -43,15 +45,19 @@ export function AuthTemplate({
|
||||||
justifyContent="justify-center"
|
justifyContent="justify-center"
|
||||||
className="px-4 pt-28 pb-16"
|
className="px-4 pt-28 pb-16"
|
||||||
>
|
>
|
||||||
<Card
|
{framed ? (
|
||||||
padding="none"
|
<Card
|
||||||
className={cn(
|
padding="none"
|
||||||
'w-full p-10',
|
className={cn(
|
||||||
width === 'wide' ? 'max-w-form' : 'max-w-checkout',
|
'w-full p-10',
|
||||||
)}
|
width === 'wide' ? 'max-w-form' : 'max-w-checkout',
|
||||||
>
|
)}
|
||||||
{children}
|
>
|
||||||
</Card>
|
{children}
|
||||||
|
</Card>
|
||||||
|
) : (
|
||||||
|
children
|
||||||
|
)}
|
||||||
</FlexBox>
|
</FlexBox>
|
||||||
</FlexBox>
|
</FlexBox>
|
||||||
);
|
);
|
||||||
|
|
|
||||||
|
|
@ -3,5 +3,10 @@ import type { ReactNode } from 'react';
|
||||||
export type AuthTemplateProps = {
|
export type AuthTemplateProps = {
|
||||||
/** narrow (480): the number and the code. wide (560): the account type and step 4. */
|
/** narrow (480): the number and the code. wide (560): the account type and step 4. */
|
||||||
width?: 'narrow' | 'wide';
|
width?: 'narrow' | 'wide';
|
||||||
|
/**
|
||||||
|
* false: no card; the step draws its own, such as registration step 5's form card beside its
|
||||||
|
* live preview.
|
||||||
|
*/
|
||||||
|
framed?: boolean;
|
||||||
children: ReactNode;
|
children: ReactNode;
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,16 @@
|
||||||
|
import { SkeletonPreset } from '@lumina/island/organisms/skeleton-preset';
|
||||||
|
|
||||||
|
import { i18n } from '../../i18n';
|
||||||
|
import { AuthTopBar } from '../organisms/auth-top-bar';
|
||||||
|
import { AuthTemplate } from '../templates/auth-template';
|
||||||
|
|
||||||
|
/** Registration's last steps, before their frame arrives: the top bar and a form step's shape. */
|
||||||
|
export default function OnboardingLoading() {
|
||||||
|
return (
|
||||||
|
<AuthTemplate
|
||||||
|
header={<AuthTopBar title={i18n.t('auth:register.header')} />}
|
||||||
|
>
|
||||||
|
<SkeletonPreset preset="form" delayed label={i18n.t('auth:loading')} />
|
||||||
|
</AuthTemplate>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,46 @@
|
||||||
|
import { AuthGuard } from '@lumina/market/app/guards/auth-guard';
|
||||||
|
import {
|
||||||
|
CreatorProfileStep,
|
||||||
|
CreatorProfileStepSkeleton,
|
||||||
|
} from '@lumina/market/app/screens/(onboarding)/onboarding/creator-profile/organisms/creator-profile-step';
|
||||||
|
import type { Metadata } from 'next';
|
||||||
|
import { Suspense } from 'react';
|
||||||
|
|
||||||
|
import { i18n } from '../../../../i18n';
|
||||||
|
import { AuthTopBar } from '../../../organisms/auth-top-bar';
|
||||||
|
import { AuthTemplate } from '../../../templates/auth-template';
|
||||||
|
|
||||||
|
export function generateMetadata(): Metadata {
|
||||||
|
return {
|
||||||
|
title: i18n.t('auth:register.profile.meta-title'),
|
||||||
|
robots: { index: false },
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Registration step 5 for a creator, on the session. The frame renders on the server; the step
|
||||||
|
* only in the browser, for the signed-in creator, behind the same-size skeleton.
|
||||||
|
*/
|
||||||
|
export default function CreatorProfilePage() {
|
||||||
|
const skeleton = (
|
||||||
|
<CreatorProfileStepSkeleton
|
||||||
|
layout="mobile"
|
||||||
|
label={i18n.t('auth:loading')}
|
||||||
|
/>
|
||||||
|
);
|
||||||
|
return (
|
||||||
|
<AuthTemplate
|
||||||
|
header={<AuthTopBar title={i18n.t('auth:register.header')} />}
|
||||||
|
>
|
||||||
|
<AuthGuard role="creator" fallback={skeleton}>
|
||||||
|
<Suspense fallback={skeleton}>
|
||||||
|
<CreatorProfileStep
|
||||||
|
size="lg"
|
||||||
|
layout="mobile"
|
||||||
|
supportPlacement="bottom"
|
||||||
|
/>
|
||||||
|
</Suspense>
|
||||||
|
</AuthGuard>
|
||||||
|
</AuthTemplate>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,40 @@
|
||||||
|
import { SkeletonPreset } from '@lumina/island/organisms/skeleton-preset';
|
||||||
|
import { AuthGuard } from '@lumina/market/app/guards/auth-guard';
|
||||||
|
import { InvestorProfileStep } from '@lumina/market/app/screens/(onboarding)/onboarding/investor-profile/organisms/investor-profile-step';
|
||||||
|
import type { Metadata } from 'next';
|
||||||
|
|
||||||
|
import { i18n } from '../../../../i18n';
|
||||||
|
import { AuthTopBar } from '../../../organisms/auth-top-bar';
|
||||||
|
import { AuthTemplate } from '../../../templates/auth-template';
|
||||||
|
|
||||||
|
export function generateMetadata(): Metadata {
|
||||||
|
return {
|
||||||
|
title: i18n.t('auth:register.profile.meta-title'),
|
||||||
|
robots: { index: false },
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Registration step 5 for an investor, optional, on the session. The frame renders on the
|
||||||
|
* server; the step only in the browser, for the signed-in investor.
|
||||||
|
*/
|
||||||
|
export default function InvestorProfilePage() {
|
||||||
|
return (
|
||||||
|
<AuthTemplate
|
||||||
|
header={<AuthTopBar title={i18n.t('auth:register.header')} />}
|
||||||
|
>
|
||||||
|
<AuthGuard
|
||||||
|
role="investor"
|
||||||
|
fallback={
|
||||||
|
<SkeletonPreset
|
||||||
|
preset="form"
|
||||||
|
count={2}
|
||||||
|
label={i18n.t('auth:loading')}
|
||||||
|
/>
|
||||||
|
}
|
||||||
|
>
|
||||||
|
<InvestorProfileStep size="lg" supportPlacement="bottom" />
|
||||||
|
</AuthGuard>
|
||||||
|
</AuthTemplate>
|
||||||
|
);
|
||||||
|
}
|
||||||
Loading…
Reference in New Issue