diff --git a/apps/bear/src/app/(auth)/auth/login/(number)/loading.tsx b/apps/bear/src/app/(auth)/auth/login/(number)/loading.tsx
new file mode 100644
index 0000000..211c3da
--- /dev/null
+++ b/apps/bear/src/app/(auth)/auth/login/(number)/loading.tsx
@@ -0,0 +1,13 @@
+import { SkeletonPreset } from '@lumina/island/organisms/skeleton-preset';
+
+import { i18n } from '../../../../../i18n';
+import { AuthTemplate } from '../../../../templates/auth-template';
+
+/** Login, the number, before its frame arrives. The same frame and skeleton as the page, so nothing moves when it arrives. */
+export default function Loading() {
+ return (
+
+
+
+ );
+}
diff --git a/apps/bear/src/app/(auth)/auth/login/page.tsx b/apps/bear/src/app/(auth)/auth/login/(number)/page.tsx
similarity index 87%
rename from apps/bear/src/app/(auth)/auth/login/page.tsx
rename to apps/bear/src/app/(auth)/auth/login/(number)/page.tsx
index 081cfbf..c11c76c 100644
--- a/apps/bear/src/app/(auth)/auth/login/page.tsx
+++ b/apps/bear/src/app/(auth)/auth/login/(number)/page.tsx
@@ -3,8 +3,8 @@ import { GuestGuard } from '@lumina/market/app/guards/guest-guard';
import { LoginStep } from '@lumina/market/app/screens/(auth)/auth/login/organisms/login-step';
import type { Metadata } from 'next';
-import { i18n } from '../../../../i18n';
-import { AuthTemplate } from '../../../templates/auth-template';
+import { i18n } from '../../../../../i18n';
+import { AuthTemplate } from '../../../../templates/auth-template';
export function generateMetadata(): Metadata {
return { title: i18n.t('auth:login.meta-title'), robots: { index: false } };
diff --git a/apps/bear/src/app/(auth)/auth/login/suspended/loading.tsx b/apps/bear/src/app/(auth)/auth/login/suspended/loading.tsx
new file mode 100644
index 0000000..f4e6342
--- /dev/null
+++ b/apps/bear/src/app/(auth)/auth/login/suspended/loading.tsx
@@ -0,0 +1,13 @@
+import { SkeletonPreset } from '@lumina/island/organisms/skeleton-preset';
+
+import { i18n } from '../../../../../i18n';
+import { AuthTemplate } from '../../../../templates/auth-template';
+
+/** The suspended screen, before its frame arrives. The same frame and skeleton as the page, so nothing moves when it arrives. */
+export default function Loading() {
+ return (
+
+
+
+ );
+}
diff --git a/apps/bear/src/app/(auth)/auth/login/suspended/page.tsx b/apps/bear/src/app/(auth)/auth/login/suspended/page.tsx
new file mode 100644
index 0000000..ac46d53
--- /dev/null
+++ b/apps/bear/src/app/(auth)/auth/login/suspended/page.tsx
@@ -0,0 +1,36 @@
+import { SkeletonPreset } from '@lumina/island/organisms/skeleton-preset';
+import { GuestGuard } from '@lumina/market/app/guards/guest-guard';
+import { LoginSuspendedStep } from '@lumina/market/app/screens/(auth)/auth/login/suspended/organisms/login-suspended-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:suspended.meta-title'),
+ robots: { index: false },
+ };
+}
+
+/**
+ * After a valid code for a suspended account (S6 3.1): the 560 card with the support button
+ * inside it. The frame renders on the server; the screen only in the browser (0013).
+ */
+export default function LoginSuspendedPage() {
+ return (
+
+
+ }
+ >
+
+
+
+ );
+}
diff --git a/apps/bear/src/app/(auth)/auth/login/verify/loading.tsx b/apps/bear/src/app/(auth)/auth/login/verify/loading.tsx
new file mode 100644
index 0000000..51a529d
--- /dev/null
+++ b/apps/bear/src/app/(auth)/auth/login/verify/loading.tsx
@@ -0,0 +1,13 @@
+import { SkeletonPreset } from '@lumina/island/organisms/skeleton-preset';
+
+import { i18n } from '../../../../../i18n';
+import { AuthTemplate } from '../../../../templates/auth-template';
+
+/** Login, the code, before its frame arrives. The same frame and skeleton as the page, so nothing moves when it arrives. */
+export default function Loading() {
+ return (
+
+
+
+ );
+}
diff --git a/apps/bear/src/app/(auth)/auth/register/(type)/loading.tsx b/apps/bear/src/app/(auth)/auth/register/(type)/loading.tsx
new file mode 100644
index 0000000..f7b2993
--- /dev/null
+++ b/apps/bear/src/app/(auth)/auth/register/(type)/loading.tsx
@@ -0,0 +1,18 @@
+import { SkeletonPreset } from '@lumina/island/organisms/skeleton-preset';
+
+import { i18n } from '../../../../../i18n';
+import { AuthTemplate } from '../../../../templates/auth-template';
+
+/** Registration step 1, before its frame arrives. The same frame and skeleton as the page, so nothing moves when it arrives. */
+export default function Loading() {
+ return (
+
+
+
+ );
+}
diff --git a/apps/bear/src/app/(auth)/auth/register/page.tsx b/apps/bear/src/app/(auth)/auth/register/(type)/page.tsx
similarity index 89%
rename from apps/bear/src/app/(auth)/auth/register/page.tsx
rename to apps/bear/src/app/(auth)/auth/register/(type)/page.tsx
index 0c3e794..8fc093a 100644
--- a/apps/bear/src/app/(auth)/auth/register/page.tsx
+++ b/apps/bear/src/app/(auth)/auth/register/(type)/page.tsx
@@ -3,8 +3,8 @@ import { GuestGuard } from '@lumina/market/app/guards/guest-guard';
import { RegisterTypeStep } from '@lumina/market/app/screens/(auth)/auth/register/organisms/register-type-step';
import type { Metadata } from 'next';
-import { i18n } from '../../../../i18n';
-import { AuthTemplate } from '../../../templates/auth-template';
+import { i18n } from '../../../../../i18n';
+import { AuthTemplate } from '../../../../templates/auth-template';
export function generateMetadata(): Metadata {
return {
diff --git a/apps/bear/src/app/(auth)/auth/register/details/loading.tsx b/apps/bear/src/app/(auth)/auth/register/details/loading.tsx
new file mode 100644
index 0000000..3a2b998
--- /dev/null
+++ b/apps/bear/src/app/(auth)/auth/register/details/loading.tsx
@@ -0,0 +1,18 @@
+import { SkeletonPreset } from '@lumina/island/organisms/skeleton-preset';
+
+import { i18n } from '../../../../../i18n';
+import { AuthTemplate } from '../../../../templates/auth-template';
+
+/** Registration step 4, before its frame arrives. The same frame and skeleton as the page, so nothing moves when it arrives. */
+export default function Loading() {
+ return (
+
+
+
+ );
+}
diff --git a/apps/bear/src/app/(auth)/auth/register/phone/loading.tsx b/apps/bear/src/app/(auth)/auth/register/phone/loading.tsx
new file mode 100644
index 0000000..e707c82
--- /dev/null
+++ b/apps/bear/src/app/(auth)/auth/register/phone/loading.tsx
@@ -0,0 +1,18 @@
+import { SkeletonPreset } from '@lumina/island/organisms/skeleton-preset';
+
+import { i18n } from '../../../../../i18n';
+import { AuthTemplate } from '../../../../templates/auth-template';
+
+/** Registration step 2, before its frame arrives. The same frame and skeleton as the page, so nothing moves when it arrives. */
+export default function Loading() {
+ return (
+
+
+
+ );
+}
diff --git a/apps/bear/src/app/(auth)/auth/register/verify/loading.tsx b/apps/bear/src/app/(auth)/auth/register/verify/loading.tsx
new file mode 100644
index 0000000..c32b35a
--- /dev/null
+++ b/apps/bear/src/app/(auth)/auth/register/verify/loading.tsx
@@ -0,0 +1,18 @@
+import { SkeletonPreset } from '@lumina/island/organisms/skeleton-preset';
+
+import { i18n } from '../../../../../i18n';
+import { AuthTemplate } from '../../../../templates/auth-template';
+
+/** Registration step 3, before its frame arrives. The same frame and skeleton as the page, so nothing moves when it arrives. */
+export default function Loading() {
+ return (
+
+
+
+ );
+}
diff --git a/apps/bear/src/app/(auth)/loading.tsx b/apps/bear/src/app/(auth)/loading.tsx
deleted file mode 100644
index 20c4694..0000000
--- a/apps/bear/src/app/(auth)/loading.tsx
+++ /dev/null
@@ -1,13 +0,0 @@
-import { SkeletonPreset } from '@lumina/island/organisms/skeleton-preset';
-
-import { i18n } from '../../i18n';
-import { AuthTemplate } from '../templates/auth-template';
-
-/** Login and registration, before their frame arrives: the header, the card and a form step's shape. */
-export default function AuthLoading() {
- return (
-
-
-
- );
-}
diff --git a/apps/bear/src/app/(flow)/compose/layout.tsx b/apps/bear/src/app/(flow)/compose/layout.tsx
new file mode 100644
index 0000000..05e63c2
--- /dev/null
+++ b/apps/bear/src/app/(flow)/compose/layout.tsx
@@ -0,0 +1,2 @@
+// Locked until a creator finishes registration step 5 (0016); the guard renders the page as is.
+export { OnboardingGuard as default } from '@lumina/market/app/guards/onboarding-guard';
diff --git a/apps/bear/src/app/(main)/dashboard/pricing/.gitkeep b/apps/bear/src/app/(main)/dashboard/pricing/.gitkeep
deleted file mode 100644
index e69de29..0000000
diff --git a/apps/bear/src/app/(main)/dashboard/pricing/layout.tsx b/apps/bear/src/app/(main)/dashboard/pricing/layout.tsx
new file mode 100644
index 0000000..05e63c2
--- /dev/null
+++ b/apps/bear/src/app/(main)/dashboard/pricing/layout.tsx
@@ -0,0 +1,2 @@
+// Locked until a creator finishes registration step 5 (0016); the guard renders the page as is.
+export { OnboardingGuard as default } from '@lumina/market/app/guards/onboarding-guard';
diff --git a/apps/bear/src/app/(onboarding)/loading.tsx b/apps/bear/src/app/(onboarding)/loading.tsx
deleted file mode 100644
index c431c6d..0000000
--- a/apps/bear/src/app/(onboarding)/loading.tsx
+++ /dev/null
@@ -1,13 +0,0 @@
-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 (
-
-
-
- );
-}
diff --git a/apps/bear/src/app/(onboarding)/onboarding/creator-identity/.gitkeep b/apps/bear/src/app/(onboarding)/onboarding/creator-identity/.gitkeep
deleted file mode 100644
index e69de29..0000000
diff --git a/apps/bear/src/app/(onboarding)/onboarding/creator-profile/(form)/loading.tsx b/apps/bear/src/app/(onboarding)/onboarding/creator-profile/(form)/loading.tsx
new file mode 100644
index 0000000..8ba4960
--- /dev/null
+++ b/apps/bear/src/app/(onboarding)/onboarding/creator-profile/(form)/loading.tsx
@@ -0,0 +1,16 @@
+import { CreatorProfileStepSkeleton } from '@lumina/market/app/screens/(onboarding)/onboarding/creator-profile/organisms/creator-profile-step';
+
+import { i18n } from '../../../../../i18n';
+import { AuthTemplate } from '../../../../templates/auth-template';
+
+/** Registration step 5 for a creator, before its frame arrives. The same frame and skeleton as the page, so nothing moves when it arrives. */
+export default function Loading() {
+ return (
+
+
+
+ );
+}
diff --git a/apps/bear/src/app/(onboarding)/onboarding/creator-profile/page.tsx b/apps/bear/src/app/(onboarding)/onboarding/creator-profile/(form)/page.tsx
similarity index 91%
rename from apps/bear/src/app/(onboarding)/onboarding/creator-profile/page.tsx
rename to apps/bear/src/app/(onboarding)/onboarding/creator-profile/(form)/page.tsx
index 341554f..957647f 100644
--- a/apps/bear/src/app/(onboarding)/onboarding/creator-profile/page.tsx
+++ b/apps/bear/src/app/(onboarding)/onboarding/creator-profile/(form)/page.tsx
@@ -6,8 +6,8 @@ import {
import type { Metadata } from 'next';
import { Suspense } from 'react';
-import { i18n } from '../../../../i18n';
-import { AuthTemplate } from '../../../templates/auth-template';
+import { i18n } from '../../../../../i18n';
+import { AuthTemplate } from '../../../../templates/auth-template';
export function generateMetadata(): Metadata {
return {
diff --git a/apps/bear/src/app/(onboarding)/onboarding/creator-profile/done/loading.tsx b/apps/bear/src/app/(onboarding)/onboarding/creator-profile/done/loading.tsx
new file mode 100644
index 0000000..cfe3de3
--- /dev/null
+++ b/apps/bear/src/app/(onboarding)/onboarding/creator-profile/done/loading.tsx
@@ -0,0 +1,13 @@
+import { CreatorProfileDoneStepSkeleton } from '@lumina/market/app/screens/(onboarding)/onboarding/creator-profile/done/organisms/creator-profile-done-step';
+
+import { i18n } from '../../../../../i18n';
+import { AuthTemplate } from '../../../../templates/auth-template';
+
+/** The creator's end of registration, before its frame arrives. The same frame and skeleton as the page, so nothing moves when it arrives. */
+export default function Loading() {
+ return (
+
+
+
+ );
+}
diff --git a/apps/bear/src/app/(onboarding)/onboarding/creator-profile/done/page.tsx b/apps/bear/src/app/(onboarding)/onboarding/creator-profile/done/page.tsx
new file mode 100644
index 0000000..1fd886a
--- /dev/null
+++ b/apps/bear/src/app/(onboarding)/onboarding/creator-profile/done/page.tsx
@@ -0,0 +1,36 @@
+import { AuthGuard } from '@lumina/market/app/guards/auth-guard';
+import {
+ CreatorProfileDoneStep,
+ CreatorProfileDoneStepSkeleton,
+} from '@lumina/market/app/screens/(onboarding)/onboarding/creator-profile/done/organisms/creator-profile-done-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.done.meta-title'),
+ robots: { index: false },
+ };
+}
+
+/**
+ * The end of registration for a creator (R2-CompleteProfile 3.3), in the 560 card. 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 CreatorProfileDonePage() {
+ const skeleton = (
+
+ );
+ return (
+
+
+
+
+
+
+
+ );
+}
diff --git a/apps/bear/src/app/(onboarding)/onboarding/investor-profile/loading.tsx b/apps/bear/src/app/(onboarding)/onboarding/investor-profile/loading.tsx
new file mode 100644
index 0000000..d6b8444
--- /dev/null
+++ b/apps/bear/src/app/(onboarding)/onboarding/investor-profile/loading.tsx
@@ -0,0 +1,13 @@
+import { InvestorProfileStepSkeleton } from '@lumina/market/app/screens/(onboarding)/onboarding/investor-profile/organisms/investor-profile-step';
+
+import { i18n } from '../../../../i18n';
+import { AuthTemplate } from '../../../templates/auth-template';
+
+/** Registration step 5 for an investor, before its frame arrives. The same frame and skeleton as the page, so nothing moves when it arrives. */
+export default function Loading() {
+ return (
+
+
+
+ );
+}
diff --git a/apps/bear/src/app/(onboarding)/onboarding/investor-profile/page.tsx b/apps/bear/src/app/(onboarding)/onboarding/investor-profile/page.tsx
index 6ca8d9f..8897b51 100644
--- a/apps/bear/src/app/(onboarding)/onboarding/investor-profile/page.tsx
+++ b/apps/bear/src/app/(onboarding)/onboarding/investor-profile/page.tsx
@@ -1,6 +1,8 @@
-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 {
+ InvestorProfileStep,
+ InvestorProfileStepSkeleton,
+} from '@lumina/market/app/screens/(onboarding)/onboarding/investor-profile/organisms/investor-profile-step';
import type { Metadata } from 'next';
import { i18n } from '../../../../i18n';
@@ -23,11 +25,7 @@ export default function InvestorProfilePage() {
+
}
>
diff --git a/apps/bull/src/app/(auth)/auth/login/(number)/loading.tsx b/apps/bull/src/app/(auth)/auth/login/(number)/loading.tsx
new file mode 100644
index 0000000..d72cef5
--- /dev/null
+++ b/apps/bull/src/app/(auth)/auth/login/(number)/loading.tsx
@@ -0,0 +1,14 @@
+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';
+
+/** Login, the number, before its frame arrives. The same frame and skeleton as the page, so nothing moves when it arrives. */
+export default function Loading() {
+ return (
+ }>
+
+
+ );
+}
diff --git a/apps/bull/src/app/(auth)/auth/login/page.tsx b/apps/bull/src/app/(auth)/auth/login/(number)/page.tsx
similarity index 82%
rename from apps/bull/src/app/(auth)/auth/login/page.tsx
rename to apps/bull/src/app/(auth)/auth/login/(number)/page.tsx
index 1ecadb7..d84ff41 100644
--- a/apps/bull/src/app/(auth)/auth/login/page.tsx
+++ b/apps/bull/src/app/(auth)/auth/login/(number)/page.tsx
@@ -3,9 +3,9 @@ import { GuestGuard } from '@lumina/market/app/guards/guest-guard';
import { LoginStep } from '@lumina/market/app/screens/(auth)/auth/login/organisms/login-step';
import type { Metadata } from 'next';
-import { i18n } from '../../../../i18n';
-import { AuthTopBar } from '../../../organisms/auth-top-bar';
-import { AuthTemplate } from '../../../templates/auth-template';
+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:login.meta-title'), robots: { index: false } };
diff --git a/apps/bull/src/app/(auth)/auth/login/suspended/loading.tsx b/apps/bull/src/app/(auth)/auth/login/suspended/loading.tsx
new file mode 100644
index 0000000..5ca8576
--- /dev/null
+++ b/apps/bull/src/app/(auth)/auth/login/suspended/loading.tsx
@@ -0,0 +1,14 @@
+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';
+
+/** The suspended screen, before its frame arrives. The same frame and skeleton as the page, so nothing moves when it arrives. */
+export default function Loading() {
+ return (
+ }>
+
+
+ );
+}
diff --git a/apps/bull/src/app/(auth)/auth/login/suspended/page.tsx b/apps/bull/src/app/(auth)/auth/login/suspended/page.tsx
new file mode 100644
index 0000000..d51f76f
--- /dev/null
+++ b/apps/bull/src/app/(auth)/auth/login/suspended/page.tsx
@@ -0,0 +1,37 @@
+import { SkeletonPreset } from '@lumina/island/organisms/skeleton-preset';
+import { GuestGuard } from '@lumina/market/app/guards/guest-guard';
+import { LoginSuspendedStep } from '@lumina/market/app/screens/(auth)/auth/login/suspended/organisms/login-suspended-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:suspended.meta-title'),
+ robots: { index: false },
+ };
+}
+
+/**
+ * After a valid code for a suspended account (S6 1.11, 2.1): the brand header with support and
+ * no way back into login. The frame renders on the server; the screen only in the browser (0013).
+ */
+export default function LoginSuspendedPage() {
+ return (
+ }>
+
+ }
+ >
+
+
+
+ );
+}
diff --git a/apps/bull/src/app/(auth)/auth/login/verify/loading.tsx b/apps/bull/src/app/(auth)/auth/login/verify/loading.tsx
new file mode 100644
index 0000000..1370193
--- /dev/null
+++ b/apps/bull/src/app/(auth)/auth/login/verify/loading.tsx
@@ -0,0 +1,19 @@
+import { SkeletonPreset } from '@lumina/island/organisms/skeleton-preset';
+import { ROUTES } from '@lumina/market/app/navigation';
+
+import { i18n } from '../../../../../i18n';
+import { AuthTopBar } from '../../../../organisms/auth-top-bar';
+import { AuthTemplate } from '../../../../templates/auth-template';
+
+/** Login, the code, before its frame arrives. The same frame and skeleton as the page, so nothing moves when it arrives. */
+export default function Loading() {
+ return (
+
+ }
+ >
+
+
+ );
+}
diff --git a/apps/bull/src/app/(auth)/auth/login/verify/page.tsx b/apps/bull/src/app/(auth)/auth/login/verify/page.tsx
index 52a380a..1c1e15f 100644
--- a/apps/bull/src/app/(auth)/auth/login/verify/page.tsx
+++ b/apps/bull/src/app/(auth)/auth/login/verify/page.tsx
@@ -1,6 +1,6 @@
import { SkeletonPreset } from '@lumina/island/organisms/skeleton-preset';
import { GuestGuard } from '@lumina/market/app/guards/guest-guard';
-import { ROUTES, withReturnPath } from '@lumina/market/app/navigation';
+import { ROUTES } from '@lumina/market/app/navigation';
import { LoginVerifyStep } from '@lumina/market/app/screens/(auth)/auth/login/verify/organisms/login-verify-step';
import type { Metadata } from 'next';
@@ -15,24 +15,12 @@ export function generateMetadata(): Metadata {
};
}
-type LoginVerifyPageProps = {
- searchParams: Promise>;
-};
-
/** Login, the code. The frame renders on the server; the step only in the browser (0013). */
-export default async function LoginVerifyPage({
- searchParams,
-}: LoginVerifyPageProps) {
- const { redirect } = await searchParams;
- const backHref = withReturnPath(
- ROUTES.login,
- typeof redirect === 'string' ? redirect : null,
- );
-
+export default function LoginVerifyPage() {
return (
+
}
>
}>
+
+
+ );
+}
diff --git a/apps/bull/src/app/(auth)/auth/register/page.tsx b/apps/bull/src/app/(auth)/auth/register/(type)/page.tsx
similarity index 84%
rename from apps/bull/src/app/(auth)/auth/register/page.tsx
rename to apps/bull/src/app/(auth)/auth/register/(type)/page.tsx
index 060d370..0f38751 100644
--- a/apps/bull/src/app/(auth)/auth/register/page.tsx
+++ b/apps/bull/src/app/(auth)/auth/register/(type)/page.tsx
@@ -3,9 +3,9 @@ import { GuestGuard } from '@lumina/market/app/guards/guest-guard';
import { RegisterTypeStep } from '@lumina/market/app/screens/(auth)/auth/register/organisms/register-type-step';
import type { Metadata } from 'next';
-import { i18n } from '../../../../i18n';
-import { AuthTopBar } from '../../../organisms/auth-top-bar';
-import { AuthTemplate } from '../../../templates/auth-template';
+import { i18n } from '../../../../../i18n';
+import { AuthTopBar } from '../../../../organisms/auth-top-bar';
+import { AuthTemplate } from '../../../../templates/auth-template';
export function generateMetadata(): Metadata {
return {
diff --git a/apps/bull/src/app/(auth)/auth/register/details/loading.tsx b/apps/bull/src/app/(auth)/auth/register/details/loading.tsx
new file mode 100644
index 0000000..53a72b3
--- /dev/null
+++ b/apps/bull/src/app/(auth)/auth/register/details/loading.tsx
@@ -0,0 +1,21 @@
+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 step 4, before its frame arrives. The same frame and skeleton as the page, so nothing moves when it arrives. */
+export default function Loading() {
+ return (
+ }
+ >
+
+
+ );
+}
diff --git a/apps/bull/src/app/(auth)/auth/register/phone/loading.tsx b/apps/bull/src/app/(auth)/auth/register/phone/loading.tsx
new file mode 100644
index 0000000..a470391
--- /dev/null
+++ b/apps/bull/src/app/(auth)/auth/register/phone/loading.tsx
@@ -0,0 +1,27 @@
+import { SkeletonPreset } from '@lumina/island/organisms/skeleton-preset';
+import { ROUTES } from '@lumina/market/app/navigation';
+
+import { i18n } from '../../../../../i18n';
+import { AuthTopBar } from '../../../../organisms/auth-top-bar';
+import { AuthTemplate } from '../../../../templates/auth-template';
+
+/** Registration step 2, before its frame arrives. The same frame and skeleton as the page, so nothing moves when it arrives. */
+export default function Loading() {
+ return (
+
+ }
+ >
+
+
+ );
+}
diff --git a/apps/bull/src/app/(auth)/auth/register/phone/page.tsx b/apps/bull/src/app/(auth)/auth/register/phone/page.tsx
index 8f82f09..1a51b2c 100644
--- a/apps/bull/src/app/(auth)/auth/register/phone/page.tsx
+++ b/apps/bull/src/app/(auth)/auth/register/phone/page.tsx
@@ -1,6 +1,6 @@
import { SkeletonPreset } from '@lumina/island/organisms/skeleton-preset';
import { GuestGuard } from '@lumina/market/app/guards/guest-guard';
-import { ROUTES, withReturnPath } from '@lumina/market/app/navigation';
+import { ROUTES } from '@lumina/market/app/navigation';
import { RegisterPhoneStep } from '@lumina/market/app/screens/(auth)/auth/register/phone/organisms/register-phone-step';
import type { Metadata } from 'next';
@@ -15,26 +15,14 @@ export function generateMetadata(): Metadata {
};
}
-type RegisterPhonePageProps = {
- searchParams: Promise>;
-};
-
/** Registration step 2, the number. The frame renders on the server; the step only in the browser (0013). */
-export default async function RegisterPhonePage({
- searchParams,
-}: RegisterPhonePageProps) {
- const { redirect } = await searchParams;
- const backHref = withReturnPath(
- ROUTES.register.type,
- typeof redirect === 'string' ? redirect : null,
- );
-
+export default function RegisterPhonePage() {
return (
}
>
diff --git a/apps/bull/src/app/(auth)/auth/register/verify/loading.tsx b/apps/bull/src/app/(auth)/auth/register/verify/loading.tsx
new file mode 100644
index 0000000..9ec1210
--- /dev/null
+++ b/apps/bull/src/app/(auth)/auth/register/verify/loading.tsx
@@ -0,0 +1,27 @@
+import { SkeletonPreset } from '@lumina/island/organisms/skeleton-preset';
+import { ROUTES } from '@lumina/market/app/navigation';
+
+import { i18n } from '../../../../../i18n';
+import { AuthTopBar } from '../../../../organisms/auth-top-bar';
+import { AuthTemplate } from '../../../../templates/auth-template';
+
+/** Registration step 3, before its frame arrives. The same frame and skeleton as the page, so nothing moves when it arrives. */
+export default function Loading() {
+ return (
+
+ }
+ >
+
+
+ );
+}
diff --git a/apps/bull/src/app/(auth)/auth/register/verify/page.tsx b/apps/bull/src/app/(auth)/auth/register/verify/page.tsx
index 14709e0..f9edcab 100644
--- a/apps/bull/src/app/(auth)/auth/register/verify/page.tsx
+++ b/apps/bull/src/app/(auth)/auth/register/verify/page.tsx
@@ -1,6 +1,6 @@
import { SkeletonPreset } from '@lumina/island/organisms/skeleton-preset';
import { GuestGuard } from '@lumina/market/app/guards/guest-guard';
-import { ROUTES, withReturnPath } from '@lumina/market/app/navigation';
+import { ROUTES } from '@lumina/market/app/navigation';
import { RegisterVerifyStep } from '@lumina/market/app/screens/(auth)/auth/register/verify/organisms/register-verify-step';
import type { Metadata } from 'next';
@@ -15,26 +15,14 @@ export function generateMetadata(): Metadata {
};
}
-type RegisterVerifyPageProps = {
- searchParams: Promise>;
-};
-
/** Registration step 3, the code. The frame renders on the server; the step only in the browser (0013). */
-export default async function RegisterVerifyPage({
- searchParams,
-}: RegisterVerifyPageProps) {
- const { redirect } = await searchParams;
- const backHref = withReturnPath(
- ROUTES.register.phone,
- typeof redirect === 'string' ? redirect : null,
- );
-
+export default function RegisterVerifyPage() {
return (
}
>
diff --git a/apps/bull/src/app/(auth)/loading.tsx b/apps/bull/src/app/(auth)/loading.tsx
deleted file mode 100644
index 70071a2..0000000
--- a/apps/bull/src/app/(auth)/loading.tsx
+++ /dev/null
@@ -1,14 +0,0 @@
-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';
-
-/** Login and registration, before their frame arrives: the top bar and a form step's shape. */
-export default function AuthLoading() {
- return (
- }>
-
-
- );
-}
diff --git a/apps/bull/src/app/(flow)/compose/layout.tsx b/apps/bull/src/app/(flow)/compose/layout.tsx
new file mode 100644
index 0000000..05e63c2
--- /dev/null
+++ b/apps/bull/src/app/(flow)/compose/layout.tsx
@@ -0,0 +1,2 @@
+// Locked until a creator finishes registration step 5 (0016); the guard renders the page as is.
+export { OnboardingGuard as default } from '@lumina/market/app/guards/onboarding-guard';
diff --git a/apps/bull/src/app/(main)/dashboard/pricing/.gitkeep b/apps/bull/src/app/(main)/dashboard/pricing/.gitkeep
deleted file mode 100644
index e69de29..0000000
diff --git a/apps/bull/src/app/(main)/dashboard/pricing/layout.tsx b/apps/bull/src/app/(main)/dashboard/pricing/layout.tsx
new file mode 100644
index 0000000..05e63c2
--- /dev/null
+++ b/apps/bull/src/app/(main)/dashboard/pricing/layout.tsx
@@ -0,0 +1,2 @@
+// Locked until a creator finishes registration step 5 (0016); the guard renders the page as is.
+export { OnboardingGuard as default } from '@lumina/market/app/guards/onboarding-guard';
diff --git a/apps/bull/src/app/(onboarding)/loading.tsx b/apps/bull/src/app/(onboarding)/loading.tsx
deleted file mode 100644
index 82f9f02..0000000
--- a/apps/bull/src/app/(onboarding)/loading.tsx
+++ /dev/null
@@ -1,16 +0,0 @@
-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 (
- }
- >
-
-
- );
-}
diff --git a/apps/bull/src/app/(onboarding)/onboarding/creator-identity/.gitkeep b/apps/bull/src/app/(onboarding)/onboarding/creator-identity/.gitkeep
deleted file mode 100644
index e69de29..0000000
diff --git a/apps/bull/src/app/(onboarding)/onboarding/creator-profile/(form)/loading.tsx b/apps/bull/src/app/(onboarding)/onboarding/creator-profile/(form)/loading.tsx
new file mode 100644
index 0000000..3f4c8fe
--- /dev/null
+++ b/apps/bull/src/app/(onboarding)/onboarding/creator-profile/(form)/loading.tsx
@@ -0,0 +1,19 @@
+import { CreatorProfileStepSkeleton } from '@lumina/market/app/screens/(onboarding)/onboarding/creator-profile/organisms/creator-profile-step';
+
+import { i18n } from '../../../../../i18n';
+import { AuthTopBar } from '../../../../organisms/auth-top-bar';
+import { AuthTemplate } from '../../../../templates/auth-template';
+
+/** Registration step 5 for a creator, before its frame arrives. The same frame and skeleton as the page, so nothing moves when it arrives. */
+export default function Loading() {
+ return (
+ }
+ >
+
+
+ );
+}
diff --git a/apps/bull/src/app/(onboarding)/onboarding/creator-profile/page.tsx b/apps/bull/src/app/(onboarding)/onboarding/creator-profile/(form)/page.tsx
similarity index 87%
rename from apps/bull/src/app/(onboarding)/onboarding/creator-profile/page.tsx
rename to apps/bull/src/app/(onboarding)/onboarding/creator-profile/(form)/page.tsx
index 815db16..b8f39e7 100644
--- a/apps/bull/src/app/(onboarding)/onboarding/creator-profile/page.tsx
+++ b/apps/bull/src/app/(onboarding)/onboarding/creator-profile/(form)/page.tsx
@@ -6,9 +6,9 @@ import {
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';
+import { i18n } from '../../../../../i18n';
+import { AuthTopBar } from '../../../../organisms/auth-top-bar';
+import { AuthTemplate } from '../../../../templates/auth-template';
export function generateMetadata(): Metadata {
return {
diff --git a/apps/bull/src/app/(onboarding)/onboarding/creator-profile/done/loading.tsx b/apps/bull/src/app/(onboarding)/onboarding/creator-profile/done/loading.tsx
new file mode 100644
index 0000000..e781c1d
--- /dev/null
+++ b/apps/bull/src/app/(onboarding)/onboarding/creator-profile/done/loading.tsx
@@ -0,0 +1,14 @@
+import { CreatorProfileDoneStepSkeleton } from '@lumina/market/app/screens/(onboarding)/onboarding/creator-profile/done/organisms/creator-profile-done-step';
+
+import { i18n } from '../../../../../i18n';
+import { AuthTopBar } from '../../../../organisms/auth-top-bar';
+import { AuthTemplate } from '../../../../templates/auth-template';
+
+/** The creator's end of registration, before its frame arrives. The same frame and skeleton as the page, so nothing moves when it arrives. */
+export default function Loading() {
+ return (
+ }>
+
+
+ );
+}
diff --git a/apps/bull/src/app/(onboarding)/onboarding/creator-profile/done/page.tsx b/apps/bull/src/app/(onboarding)/onboarding/creator-profile/done/page.tsx
new file mode 100644
index 0000000..6c441a7
--- /dev/null
+++ b/apps/bull/src/app/(onboarding)/onboarding/creator-profile/done/page.tsx
@@ -0,0 +1,38 @@
+import { AuthGuard } from '@lumina/market/app/guards/auth-guard';
+import {
+ CreatorProfileDoneStep,
+ CreatorProfileDoneStepSkeleton,
+} from '@lumina/market/app/screens/(onboarding)/onboarding/creator-profile/done/organisms/creator-profile-done-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.done.meta-title'),
+ robots: { index: false },
+ };
+}
+
+/**
+ * The end of registration for a creator (R2-CompleteProfile 1.8): the brand header, as
+ * registration is over. 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 CreatorProfileDonePage() {
+ const skeleton = (
+
+ );
+ return (
+ }>
+
+
+
+
+
+
+ );
+}
diff --git a/apps/bull/src/app/(onboarding)/onboarding/investor-profile/loading.tsx b/apps/bull/src/app/(onboarding)/onboarding/investor-profile/loading.tsx
new file mode 100644
index 0000000..bb7c985
--- /dev/null
+++ b/apps/bull/src/app/(onboarding)/onboarding/investor-profile/loading.tsx
@@ -0,0 +1,16 @@
+import { InvestorProfileStepSkeleton } from '@lumina/market/app/screens/(onboarding)/onboarding/investor-profile/organisms/investor-profile-step';
+
+import { i18n } from '../../../../i18n';
+import { AuthTopBar } from '../../../organisms/auth-top-bar';
+import { AuthTemplate } from '../../../templates/auth-template';
+
+/** Registration step 5 for an investor, before its frame arrives. The same frame and skeleton as the page, so nothing moves when it arrives. */
+export default function Loading() {
+ return (
+ }
+ >
+
+
+ );
+}
diff --git a/apps/bull/src/app/(onboarding)/onboarding/investor-profile/page.tsx b/apps/bull/src/app/(onboarding)/onboarding/investor-profile/page.tsx
index 1a3eb99..f32e825 100644
--- a/apps/bull/src/app/(onboarding)/onboarding/investor-profile/page.tsx
+++ b/apps/bull/src/app/(onboarding)/onboarding/investor-profile/page.tsx
@@ -1,6 +1,8 @@
-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 {
+ InvestorProfileStep,
+ InvestorProfileStepSkeleton,
+} from '@lumina/market/app/screens/(onboarding)/onboarding/investor-profile/organisms/investor-profile-step';
import type { Metadata } from 'next';
import { i18n } from '../../../../i18n';
@@ -26,11 +28,7 @@ export default function InvestorProfilePage() {
+
}
>
diff --git a/apps/bull/src/app/organisms/auth-top-bar/AuthTopBar.tsx b/apps/bull/src/app/organisms/auth-top-bar/AuthTopBar.tsx
index 74a788f..3887280 100644
--- a/apps/bull/src/app/organisms/auth-top-bar/AuthTopBar.tsx
+++ b/apps/bull/src/app/organisms/auth-top-bar/AuthTopBar.tsx
@@ -1,4 +1,3 @@
-import { Button } from '@lumina/island/atoms/button';
import { FlexBox } from '@lumina/island/atoms/flex-box';
import { Typography } from '@lumina/island/atoms/typography';
import { ROUTES } from '@lumina/market/app/navigation';
@@ -6,6 +5,7 @@ import { SupportEntry } from '@lumina/market/app/screens/organisms/support-entry
import NextLink from 'next/link';
import { i18n } from '../../../i18n';
+import { BackButton } from './components/BackButton';
import type { AuthTopBarProps } from './types';
/**
@@ -13,7 +13,7 @@ import type { AuthTopBarProps } from './types';
* support on a pushed step; only the name on a step with no way back (registration step 4).
* Back keeps what was typed: the number lives in the flow store.
*/
-export function AuthTopBar({ title, backHref }: AuthTopBarProps) {
+export function AuthTopBar({ title, back }: AuthTopBarProps) {
return (
- {backHref && (
-
- )}
+ {back && }
{title ? (
{title}
diff --git a/apps/bull/src/app/organisms/auth-top-bar/components/BackButton.tsx b/apps/bull/src/app/organisms/auth-top-bar/components/BackButton.tsx
new file mode 100644
index 0000000..0dd1012
--- /dev/null
+++ b/apps/bull/src/app/organisms/auth-top-bar/components/BackButton.tsx
@@ -0,0 +1,23 @@
+'use client';
+
+import { Button } from '@lumina/island/atoms/button';
+import { withReturnPath } from '@lumina/market/app/navigation';
+import { useSearchParams } from 'next/navigation';
+
+import type { BackButtonProps } from '../types';
+
+/**
+ * Back to the previous step, keeping `?redirect=` from the address bar, so a page and its loading
+ * frame lead to the same place and the person still returns to the page that asked for login.
+ */
+export function BackButton({ step, label }: BackButtonProps) {
+ const redirect = useSearchParams().get('redirect');
+ return (
+
+ );
+}
diff --git a/apps/bull/src/app/organisms/auth-top-bar/types.ts b/apps/bull/src/app/organisms/auth-top-bar/types.ts
index 994b770..27302d2 100644
--- a/apps/bull/src/app/organisms/auth-top-bar/types.ts
+++ b/apps/bull/src/app/organisms/auth-top-bar/types.ts
@@ -1,6 +1,11 @@
export type AuthTopBarProps = {
/** A pushed step's name, such as «ورود». Without it the bar shows the brand. */
title?: string;
- /** The previous step, behind the back button. */
- backHref?: string;
+ /** The previous step's path, behind the back button; `?redirect=` is kept from the address. */
+ back?: string;
+};
+
+export type BackButtonProps = {
+ step: string;
+ label: string;
};
diff --git a/platforms/market/src/app/guards/guest-guard/GuestGuard.tsx b/platforms/market/src/app/guards/guest-guard/GuestGuard.tsx
index 771dc0f..43db9d7 100644
--- a/platforms/market/src/app/guards/guest-guard/GuestGuard.tsx
+++ b/platforms/market/src/app/guards/guest-guard/GuestGuard.tsx
@@ -3,18 +3,20 @@
import { useRouter } from 'next/navigation';
import { useEffect, useState } from 'react';
-import { useViewerStatus } from '../../../stores/auth';
-import { safeReturnPath } from '../../navigation';
+import { useNeedsProfile, useViewerStatus } from '../../../stores/auth';
+import { ROUTES, safeReturnPath, withReturnPath } from '../../navigation';
import type { GuestGuardProps } from './types';
/**
* Wraps login and registration, which render only in the browser. A visitor who arrives signed in
- * goes on to `?redirect=` (a path on this site only) or home; a guest sees the page. The skeleton
+ * goes on to `?redirect=` (a path on this site only) or home, or to registration step 5 when they
+ * are a creator who has not finished it; a guest sees the page. The skeleton
* covers the moment before the viewer is known. A guest who signs in on the page keeps it: the
* page shows its progress and sends them on itself.
*/
export function GuestGuard({ fallback, children }: GuestGuardProps) {
const status = useViewerStatus();
+ const needsProfile = useNeedsProfile();
const router = useRouter();
const [wasGuest, setWasGuest] = useState(false);
// Remembered during render, so the render that turns member already knows.
@@ -25,8 +27,12 @@ export function GuestGuard({ fallback, children }: GuestGuardProps) {
const redirect = new URLSearchParams(window.location.search).get(
'redirect',
);
- router.replace(safeReturnPath(redirect));
- }, [status, wasGuest, router]);
+ router.replace(
+ needsProfile
+ ? withReturnPath(ROUTES.onboarding.creatorProfile, redirect)
+ : safeReturnPath(redirect),
+ );
+ }, [status, needsProfile, wasGuest, router]);
const showsPage = status === 'guest' || (status === 'member' && wasGuest);
return showsPage ? children : fallback;
diff --git a/platforms/market/src/app/guards/onboarding-guard/.gitkeep b/platforms/market/src/app/guards/onboarding-guard/.gitkeep
deleted file mode 100644
index e69de29..0000000
diff --git a/platforms/market/src/app/guards/onboarding-guard/OnboardingGuard.tsx b/platforms/market/src/app/guards/onboarding-guard/OnboardingGuard.tsx
new file mode 100644
index 0000000..6118fb3
--- /dev/null
+++ b/platforms/market/src/app/guards/onboarding-guard/OnboardingGuard.tsx
@@ -0,0 +1,31 @@
+'use client';
+
+import { useRouter } from 'next/navigation';
+import { useEffect } from 'react';
+
+import { useNeedsProfile, useViewerStatus } from '../../../stores/auth';
+import { ROUTES, withReturnPath } from '../../navigation';
+import type { OnboardingGuardProps } from './types';
+
+/**
+ * Keeps a creator who has not finished registration step 5 away from what stays locked until
+ * then: publishing and prices (R2-CompleteProfile 4.2). It changes nothing in the render, so the
+ * server HTML stays the same for every visitor; once the browser knows the viewer, such a creator
+ * goes to step 5, which returns here when done. The layouts of those routes render it
+ * (`compose`, `dashboard/pricing`); everything else, such as the terms, stays open.
+ */
+export function OnboardingGuard({ children }: OnboardingGuardProps) {
+ const status = useViewerStatus();
+ const needsProfile = useNeedsProfile();
+ const router = useRouter();
+
+ useEffect(() => {
+ if (status !== 'member' || !needsProfile) return;
+ const { pathname, search } = window.location;
+ router.replace(
+ withReturnPath(ROUTES.onboarding.creatorProfile, `${pathname}${search}`),
+ );
+ }, [status, needsProfile, router]);
+
+ return children;
+}
diff --git a/platforms/market/src/app/guards/onboarding-guard/index.ts b/platforms/market/src/app/guards/onboarding-guard/index.ts
new file mode 100644
index 0000000..a57d878
--- /dev/null
+++ b/platforms/market/src/app/guards/onboarding-guard/index.ts
@@ -0,0 +1,2 @@
+export { OnboardingGuard } from './OnboardingGuard';
+export type { OnboardingGuardProps } from './types';
diff --git a/platforms/market/src/app/guards/onboarding-guard/types.ts b/platforms/market/src/app/guards/onboarding-guard/types.ts
new file mode 100644
index 0000000..59ba5e3
--- /dev/null
+++ b/platforms/market/src/app/guards/onboarding-guard/types.ts
@@ -0,0 +1,3 @@
+import type { ReactNode } from 'react';
+
+export type OnboardingGuardProps = { children: ReactNode };
diff --git a/platforms/market/src/app/navigation/constants.ts b/platforms/market/src/app/navigation/constants.ts
index 0780c4e..1a53078 100644
--- a/platforms/market/src/app/navigation/constants.ts
+++ b/platforms/market/src/app/navigation/constants.ts
@@ -1,2 +1,5 @@
/** The public channel URL prefix; next.config rewrites `/@username` onto `channels/[username]`. */
export const CHANNEL_PREFIX = '/@';
+
+/** Login's query parameter naming the channel a guest wants to subscribe to. */
+export const SUBSCRIBE_PARAM = 'subscribe';
diff --git a/platforms/market/src/app/navigation/hooks/use-auth-routes.ts b/platforms/market/src/app/navigation/hooks/use-auth-routes.ts
index 6227787..16ce495 100644
--- a/platforms/market/src/app/navigation/hooks/use-auth-routes.ts
+++ b/platforms/market/src/app/navigation/hooks/use-auth-routes.ts
@@ -1,23 +1,44 @@
import { useSearchParams } from 'next/navigation';
import { useMemo } from 'react';
+import * as v from 'valibot';
import type { SignedInViewer } from '../../../features/auth';
+import { usernameSchema } from '../../../shared/validations';
+import { SUBSCRIBE_PARAM } from '../constants';
import { ROUTES, withReturnPath } from '../navigation';
import { safeReturnPath } from '../return-path';
import type { AuthRoutes } from '../types';
+/**
+ * The channel named by `?subscribe=`, as the API stores it, only when the person returns to that
+ * same channel (`?redirect=`): the notice says where they go back to, so any other pair, or a
+ * name that is no username, shows the plain login.
+ */
+function toSubscribeUsername(
+ subscribe: string | null,
+ redirect: string | null,
+): string | null {
+ const parsed = v.safeParse(usernameSchema, subscribe ?? '');
+ return parsed.success && redirect === ROUTES.channel(parsed.output)
+ ? parsed.output
+ : null;
+}
+
/**
* Every login and registration step's path, each keeping `?redirect=`, and where a person lands
* once signed in. Browser only: the auth pages render their steps in the browser.
*/
export function useAuthRoutes(): AuthRoutes {
- const redirect = useSearchParams().get('redirect');
+ const params = useSearchParams();
+ const redirect = params.get('redirect');
+ const subscribe = params.get(SUBSCRIBE_PARAM);
return useMemo(() => {
const step = (path: string) => withReturnPath(path, redirect);
return {
login: step(ROUTES.login),
loginVerify: step(ROUTES.loginVerify),
+ loginSuspended: ROUTES.loginSuspended,
register: {
type: step(ROUTES.register.type),
phone: step(ROUTES.register.phone),
@@ -27,12 +48,14 @@ export function useAuthRoutes(): AuthRoutes {
profile: {
investor: step(ROUTES.onboarding.investorProfile),
creator: step(ROUTES.onboarding.creatorProfile),
+ creatorDone: step(ROUTES.onboarding.creatorProfileDone),
},
landing: ({ role, username, needsProfile }: SignedInViewer) => {
if (needsProfile) return step(ROUTES.onboarding.creatorProfile);
if (redirect) return safeReturnPath(redirect);
return role === 'creator' ? ROUTES.channel(username) : ROUTES.home;
},
+ subscribeTo: toSubscribeUsername(subscribe, redirect),
};
- }, [redirect]);
+ }, [redirect, subscribe]);
}
diff --git a/platforms/market/src/app/navigation/index.ts b/platforms/market/src/app/navigation/index.ts
index be2cbf9..5d8c640 100644
--- a/platforms/market/src/app/navigation/index.ts
+++ b/platforms/market/src/app/navigation/index.ts
@@ -1,5 +1,10 @@
export { CHANNEL_PREFIX } from './constants';
export { useAuthRoutes } from './hooks/use-auth-routes';
-export { loginRoute, ROUTES, withReturnPath } from './navigation';
+export {
+ loginRoute,
+ ROUTES,
+ subscribeLoginRoute,
+ withReturnPath,
+} from './navigation';
export { safeReturnPath } from './return-path';
export type { AuthRoutes } from './types';
diff --git a/platforms/market/src/app/navigation/navigation.ts b/platforms/market/src/app/navigation/navigation.ts
index 0c280d4..3cada10 100644
--- a/platforms/market/src/app/navigation/navigation.ts
+++ b/platforms/market/src/app/navigation/navigation.ts
@@ -1,4 +1,4 @@
-import { CHANNEL_PREFIX } from './constants';
+import { CHANNEL_PREFIX, SUBSCRIBE_PARAM } from './constants';
const channel = (username: string) =>
`${CHANNEL_PREFIX}${encodeURIComponent(username)}`;
@@ -8,6 +8,8 @@ export const ROUTES = {
home: '/',
login: '/auth/login',
loginVerify: '/auth/login/verify',
+ /** After a valid code for a suspended account: no session, only support. */
+ loginSuspended: '/auth/login/suspended',
register: {
type: '/auth/register',
phone: '/auth/register/phone',
@@ -32,8 +34,9 @@ export const ROUTES = {
sheba: '/dashboard/finance/sheba',
},
onboarding: {
- creatorIdentity: '/onboarding/creator-identity',
creatorProfile: '/onboarding/creator-profile',
+ /** The end of registration for a creator: what happens next. */
+ creatorProfileDone: '/onboarding/creator-profile/done',
investorProfile: '/onboarding/investor-profile',
},
terms: '/terms/subscription',
@@ -44,6 +47,15 @@ export function loginRoute(returnTo?: string): string {
return withReturnPath(ROUTES.login, returnTo);
}
+/**
+ * Login for a guest who tapped «اشتراک» on a channel: the login page says why, and the person
+ * comes back to the channel (S6 Login · to-subscribe). The channel page's «اشتراک» links here;
+ * until that page is built (the channel epic), nothing does.
+ */
+export function subscribeLoginRoute(username: string): string {
+ return `${loginRoute(channel(username))}&${SUBSCRIBE_PARAM}=${encodeURIComponent(username)}`;
+}
+
/**
* An auth step's path that keeps `?redirect=`, so every step of login and registration returns
* to the page that asked for it.
diff --git a/platforms/market/src/app/navigation/types.ts b/platforms/market/src/app/navigation/types.ts
index 11b8c44..5f9dac4 100644
--- a/platforms/market/src/app/navigation/types.ts
+++ b/platforms/market/src/app/navigation/types.ts
@@ -4,13 +4,16 @@ import type { SignedInViewer } from '../../features/auth';
export type AuthRoutes = {
login: string;
loginVerify: string;
+ loginSuspended: string;
register: {
type: string;
phone: string;
verify: string;
details: string;
};
- /** Registration step 5, per account type. */
- profile: { investor: string; creator: string };
+ /** Registration step 5, per account type, and the creator's end of registration. */
+ profile: { investor: string; creator: string; creatorDone: string };
landing: (viewer: SignedInViewer) => string;
+ /** The channel's username when a guest came to log in from «اشتراک», else `null`. */
+ subscribeTo: string | null;
};
diff --git a/platforms/market/src/app/screens/(auth)/auth/login/organisms/login-step/LoginStep.tsx b/platforms/market/src/app/screens/(auth)/auth/login/organisms/login-step/LoginStep.tsx
index ec7495e..700dc94 100644
--- a/platforms/market/src/app/screens/(auth)/auth/login/organisms/login-step/LoginStep.tsx
+++ b/platforms/market/src/app/screens/(auth)/auth/login/organisms/login-step/LoginStep.tsx
@@ -18,7 +18,8 @@ import type { LoginStepProps } from './types';
/**
* Login step 1: the mobile number and «دریافت کد» right under it, the way to registration, and
- * support. A number with no account gets the way to register with it under the field.
+ * support. A number with no account gets the way to register with it under the field. A guest
+ * who came from «اشتراک» reads why, and which channel they return to (S6 Login · to-subscribe).
*/
export function LoginStep({ size, supportPlacement }: LoginStepProps) {
const { t } = useTranslation('auth');
@@ -28,26 +29,31 @@ export function LoginStep({ size, supportPlacement }: LoginStepProps) {
submit,
isSubmitting,
formError,
+ clearError,
isUnknownPhone,
registerHref,
- carryPhone,
+ subscribe,
} = useLoginPage({
codeHref: routes.loginVerify,
registerHref: routes.register.type,
+ subscribeTo: routes.subscribeTo,
});
return (
+ {/* The toast carries the details; the banner says what to do (S6 1.5). */}
{formError && (
-
- {formError}
-
+ {t('phone.send-failed-banner')}
)}
- {t('login.title')}
+ {subscribe ? t('login.subscribe.title') : t('login.title')}
+
+
+ {subscribe
+ ? t('login.subscribe.return', { name: subscribe.channelName })
+ : t('login.description')}
- {t('login.description')} (
{
+ field.onChange(event);
+ clearError();
+ }}
type="tel"
dir="ltr"
inputMode="numeric"
@@ -78,12 +88,7 @@ export function LoginStep({ size, supportPlacement }: LoginStepProps) {
)}
/>
{isUnknownPhone && (
-
+
{t('login.register-with-phone')}
)}
@@ -97,6 +102,11 @@ export function LoginStep({ size, supportPlacement }: LoginStepProps) {
>
{t('login.submit')}
+ {subscribe && (
+
+ {t('login.subscribe.notice')}
+
+ )}
{t('login.no-account')}
-
- {t('login.register')}
-
+ {t('login.register')}
diff --git a/platforms/market/src/app/screens/(auth)/auth/login/suspended/organisms/login-suspended-step/LoginSuspendedStep.tsx b/platforms/market/src/app/screens/(auth)/auth/login/suspended/organisms/login-suspended-step/LoginSuspendedStep.tsx
new file mode 100644
index 0000000..f57725a
--- /dev/null
+++ b/platforms/market/src/app/screens/(auth)/auth/login/suspended/organisms/login-suspended-step/LoginSuspendedStep.tsx
@@ -0,0 +1,74 @@
+'use client';
+
+import { FlexBox } from '@lumina/island/atoms/flex-box';
+import { StateArt } from '@lumina/island/atoms/state-art';
+import { Typography } from '@lumina/island/atoms/typography';
+import { SkeletonPreset } from '@lumina/island/organisms/skeleton-preset';
+import { useEffect, useRef } from 'react';
+import { useTranslation } from 'react-i18next';
+
+import { useLoginSuspendedPage } from '../../../../../../../../features/auth';
+import { useAuthRoutes } from '../../../../../../../navigation';
+import { SupportEntry } from '../../../../../../organisms/support-entry';
+import type { LoginSuspendedStepProps } from './types';
+
+/**
+ * A valid code for a suspended account (S6 1.11, 2.1, 3.1): no session, nothing else reachable,
+ * one way out to support. Amber, because a suspension is a state, not an error. The admin's reason
+ * shows when there is one. Focus starts on the heading, as the page replaces the code step.
+ */
+export function LoginSuspendedStep({
+ size,
+ supportPlacement,
+ layout,
+}: LoginSuspendedStepProps) {
+ const { t } = useTranslation('auth');
+ const routes = useAuthRoutes();
+ const { suspension } = useLoginSuspendedPage({ loginHref: routes.login });
+ const headingRef = useRef(null);
+
+ useEffect(() => headingRef.current?.focus(), [suspension]);
+
+ if (!suspension) {
+ // The page's own skeleton, while a reload goes back to login.
+ return ;
+ }
+ return (
+
+
+
+
+ {t('suspended.title')}
+
+
+ {suspension.reason
+ ? t('suspended.reason', { reason: suspension.reason })
+ : t('suspended.description')}
+
+
+
+
+
+
+ );
+}
diff --git a/platforms/market/src/app/screens/(auth)/auth/login/suspended/organisms/login-suspended-step/index.ts b/platforms/market/src/app/screens/(auth)/auth/login/suspended/organisms/login-suspended-step/index.ts
new file mode 100644
index 0000000..c034f17
--- /dev/null
+++ b/platforms/market/src/app/screens/(auth)/auth/login/suspended/organisms/login-suspended-step/index.ts
@@ -0,0 +1,2 @@
+export { LoginSuspendedStep } from './LoginSuspendedStep';
+export type { LoginSuspendedStepProps } from './types';
diff --git a/platforms/market/src/app/screens/(auth)/auth/login/suspended/organisms/login-suspended-step/types.ts b/platforms/market/src/app/screens/(auth)/auth/login/suspended/organisms/login-suspended-step/types.ts
new file mode 100644
index 0000000..6b95520
--- /dev/null
+++ b/platforms/market/src/app/screens/(auth)/auth/login/suspended/organisms/login-suspended-step/types.ts
@@ -0,0 +1,9 @@
+import type { SupportEntryProps } from '../../../../../../organisms/support-entry';
+
+export type LoginSuspendedStepProps = {
+ /** `lg` on mobile, `md` on desktop. */
+ size: 'md' | 'lg';
+ supportPlacement: SupportEntryProps['placement'];
+ /** Mobile pins «تماس با پشتیبانی» to the bottom; desktop keeps it in the card. */
+ layout: 'mobile' | 'desktop';
+};
diff --git a/platforms/market/src/app/screens/(auth)/auth/login/verify/organisms/login-verify-step/LoginVerifyStep.tsx b/platforms/market/src/app/screens/(auth)/auth/login/verify/organisms/login-verify-step/LoginVerifyStep.tsx
index e78c4da..5bf539c 100644
--- a/platforms/market/src/app/screens/(auth)/auth/login/verify/organisms/login-verify-step/LoginVerifyStep.tsx
+++ b/platforms/market/src/app/screens/(auth)/auth/login/verify/organisms/login-verify-step/LoginVerifyStep.tsx
@@ -6,13 +6,12 @@ import { useTranslation } from 'react-i18next';
import { useLoginVerifyPage } from '../../../../../../../../features/auth';
import { useAuthRoutes } from '../../../../../../../navigation';
import { CodeStep } from '../../../../organisms/code-step';
-import { SuspendedNotice } from './components/SuspendedNotice';
import type { LoginVerifyStepProps } from './types';
/**
- * Login step 2: the code, then the person lands where they were going. A suspended account sees
- * the suspended screen here instead. Without a number (after a reload) it waits in its skeleton
- * while the model sends the person back to the number step.
+ * Login step 2: the code, then the person lands where they were going, or on the suspended
+ * screen. Without a number (after a reload) it waits in its skeleton while the model sends the
+ * person back to the number step.
*/
export function LoginVerifyStep({
size,
@@ -22,12 +21,10 @@ export function LoginVerifyStep({
const routes = useAuthRoutes();
const model = useLoginVerifyPage({
phoneHref: routes.login,
+ suspendedHref: routes.loginSuspended,
landing: routes.landing,
});
- if (model.view === 'suspended') {
- return ;
- }
if (!model.phone) {
return ;
}
diff --git a/platforms/market/src/app/screens/(auth)/auth/login/verify/organisms/login-verify-step/components/SuspendedNotice.tsx b/platforms/market/src/app/screens/(auth)/auth/login/verify/organisms/login-verify-step/components/SuspendedNotice.tsx
deleted file mode 100644
index b0a4f01..0000000
--- a/platforms/market/src/app/screens/(auth)/auth/login/verify/organisms/login-verify-step/components/SuspendedNotice.tsx
+++ /dev/null
@@ -1,55 +0,0 @@
-'use client';
-
-import { FlexBox } from '@lumina/island/atoms/flex-box';
-import { StateArt } from '@lumina/island/atoms/state-art';
-import { Typography } from '@lumina/island/atoms/typography';
-import { useEffect, useRef } from 'react';
-import { useTranslation } from 'react-i18next';
-
-import { SupportEntry } from '../../../../../../../organisms/support-entry';
-import type { SuspendedNoticeProps } from '../types';
-
-/**
- * A valid code for a suspended account: no session, nothing else reachable, one way out to
- * support. Amber, because a suspension is a state, not an error. It replaces the code step, so
- * focus moves to its heading. The API gives no reason yet.
- */
-export function SuspendedNotice({
- size,
- supportPlacement,
-}: SuspendedNoticeProps) {
- const { t } = useTranslation('auth');
- const headingRef = useRef(null);
-
- useEffect(() => headingRef.current?.focus(), []);
-
- return (
-
-
-
-
- {t('suspended.title')}
-
- {t('suspended.description')}
-
-
-
-
-
- );
-}
diff --git a/platforms/market/src/app/screens/(auth)/auth/login/verify/organisms/login-verify-step/types.ts b/platforms/market/src/app/screens/(auth)/auth/login/verify/organisms/login-verify-step/types.ts
index 944168b..fbefc5d 100644
--- a/platforms/market/src/app/screens/(auth)/auth/login/verify/organisms/login-verify-step/types.ts
+++ b/platforms/market/src/app/screens/(auth)/auth/login/verify/organisms/login-verify-step/types.ts
@@ -5,5 +5,3 @@ export type LoginVerifyStepProps = {
size: 'md' | 'lg';
supportPlacement: SupportEntryProps['placement'];
};
-
-export type SuspendedNoticeProps = LoginVerifyStepProps;
diff --git a/platforms/market/src/app/screens/(auth)/auth/organisms/code-step/CodeStep.tsx b/platforms/market/src/app/screens/(auth)/auth/organisms/code-step/CodeStep.tsx
index feff8f4..5104bfd 100644
--- a/platforms/market/src/app/screens/(auth)/auth/organisms/code-step/CodeStep.tsx
+++ b/platforms/market/src/app/screens/(auth)/auth/organisms/code-step/CodeStep.tsx
@@ -18,7 +18,8 @@ import type { CodeStepProps } from './types';
/**
* The 6-digit code step of login and registration: the number it went to, the cells, the resend
* wait and the submit button under them. Blocked, the cells and the button rest and the wait
- * counts to the moment a new code may be asked for; «ویرایش شماره» stays live.
+ * counts to the moment a new code may be asked for; «ویرایش شماره» stays live. Limited (too many
+ * codes in an hour), only the wait is amber: the last code can still be typed.
*/
export function CodeStep({
model,
@@ -29,7 +30,7 @@ export function CodeStep({
progress,
}: CodeStepProps) {
const { t } = useTranslation('auth');
- const { form, status, attempt, submit, complete, resend } = model;
+ const { form, status, attempt, submit, clearError, complete, resend } = model;
const isBlocked = status === 'blocked';
const formError = form.formState.errors.root?.server?.message;
@@ -79,7 +80,10 @@ export function CodeStep({
key={attempt}
name={field.name}
value={field.value}
- onChange={field.onChange}
+ onChange={(value: string) => {
+ field.onChange(value);
+ clearError();
+ }}
onComplete={complete}
label={t('code.label')}
error={translateMessage(t, fieldState.error?.message)}
@@ -96,9 +100,10 @@ export function CodeStep({
// A new code (or block) starts a new wait, and its announcement plays again.
key={resend.endsAt}
endsAt={resend.endsAt}
+ limitTotal={resend.limitTotal}
status={
resend.phase === 'auto'
- ? isBlocked
+ ? resend.isLimited
? 'limited'
: 'auto'
: resend.phase
diff --git a/platforms/market/src/app/screens/(auth)/auth/register/details/organisms/register-details-step/components/CreatorIdentityForm.tsx b/platforms/market/src/app/screens/(auth)/auth/register/details/organisms/register-details-step/components/CreatorIdentityForm.tsx
index 98ae269..b840d7c 100644
--- a/platforms/market/src/app/screens/(auth)/auth/register/details/organisms/register-details-step/components/CreatorIdentityForm.tsx
+++ b/platforms/market/src/app/screens/(auth)/auth/register/details/organisms/register-details-step/components/CreatorIdentityForm.tsx
@@ -83,6 +83,7 @@ export function CreatorIdentityForm(props: DetailsFormProps) {
submit,
isSubmitting,
formError,
+ username,
pickImage,
progress,
cancelUpload,
@@ -129,8 +130,9 @@ export function CreatorIdentityForm(props: DetailsFormProps) {
(
pickImage(side, file)}
onBlur={field.onBlur}
accept={ID_CARD_IMAGE.types.join(',')}
label={t(`register.fields.${label}`)}
- hint={t('register.fields.id-card-hint')}
+ hint={t(`register.fields.${label}-hint`)}
size={
field.value &&
t('register.fields.file-size', {
diff --git a/platforms/market/src/app/screens/(auth)/auth/register/details/organisms/register-details-step/components/DetailsFrame.tsx b/platforms/market/src/app/screens/(auth)/auth/register/details/organisms/register-details-step/components/DetailsFrame.tsx
index e24d5a3..90cffb3 100644
--- a/platforms/market/src/app/screens/(auth)/auth/register/details/organisms/register-details-step/components/DetailsFrame.tsx
+++ b/platforms/market/src/app/screens/(auth)/auth/register/details/organisms/register-details-step/components/DetailsFrame.tsx
@@ -33,7 +33,11 @@ export function DetailsFrame({
return (
{page.phase === 'warning' && page.expiresAt !== null && (
-
+
)}
{formError && (
diff --git a/platforms/market/src/app/screens/(auth)/auth/register/details/organisms/register-details-step/components/ExpiryWarning.tsx b/platforms/market/src/app/screens/(auth)/auth/register/details/organisms/register-details-step/components/ExpiryWarning.tsx
index 069cdc1..cff1701 100644
--- a/platforms/market/src/app/screens/(auth)/auth/register/details/organisms/register-details-step/components/ExpiryWarning.tsx
+++ b/platforms/market/src/app/screens/(auth)/auth/register/details/organisms/register-details-step/components/ExpiryWarning.tsx
@@ -1,5 +1,6 @@
'use client';
+import { Button } from '@lumina/island/atoms/button';
import { Countdown } from '@lumina/island/atoms/countdown';
import { Banner } from '@lumina/island/molecules/banner';
import { useTranslation } from 'react-i18next';
@@ -7,10 +8,15 @@ import { useTranslation } from 'react-i18next';
import type { ExpiryWarningProps } from '../types';
/**
- * Two minutes before the registration token runs out. Announced once (the banner's status
- * role), never every second: the clock inside is not a live region.
+ * Two minutes before the registration token runs out, with «تمدید زمان» for another 15 minutes
+ * without leaving the page (WCAG 2.2.1). Announced once (the banner's status role), never every
+ * second: the clock inside is not a live region.
*/
-export function ExpiryWarning({ expiresAt }: ExpiryWarningProps) {
+export function ExpiryWarning({
+ expiresAt,
+ isRenewing,
+ onRenew,
+}: ExpiryWarningProps) {
const { t } = useTranslation('auth');
return (
@@ -18,6 +24,19 @@ export function ExpiryWarning({ expiresAt }: ExpiryWarningProps) {
tone="warning"
icon="clock"
title={t('register.expiry.warning-title')}
+ action={
+ onRenew && (
+
+ )
+ }
>
{t('register.expiry.warning-before')}{' '}
{' '}
diff --git a/platforms/market/src/app/screens/(auth)/auth/register/details/organisms/register-details-step/components/InvestorDetailsForm.tsx b/platforms/market/src/app/screens/(auth)/auth/register/details/organisms/register-details-step/components/InvestorDetailsForm.tsx
index b689d42..8632b77 100644
--- a/platforms/market/src/app/screens/(auth)/auth/register/details/organisms/register-details-step/components/InvestorDetailsForm.tsx
+++ b/platforms/market/src/app/screens/(auth)/auth/register/details/organisms/register-details-step/components/InvestorDetailsForm.tsx
@@ -13,7 +13,7 @@ import { UsernameField } from './UsernameField';
/** Step 4 for an investor: name, last name and username, then «ساخت حساب». */
export function InvestorDetailsForm(props: DetailsFormProps) {
const { t } = useTranslation('auth');
- const { form, submit, isSubmitting, formError, draft } =
+ const { form, submit, isSubmitting, formError, username, draft } =
useInvestorDetailsPart(props.partOptions);
return (
@@ -45,6 +45,7 @@ export function InvestorDetailsForm(props: DetailsFormProps) {
name="username"
placeholder={t('register.fields.username-placeholder')}
hint={t('register.fields.username-hint')}
+ availability={username}
/>
);
diff --git a/platforms/market/src/app/screens/(auth)/auth/register/details/organisms/register-details-step/components/UsernameField.tsx b/platforms/market/src/app/screens/(auth)/auth/register/details/organisms/register-details-step/components/UsernameField.tsx
index a91681e..ed70213 100644
--- a/platforms/market/src/app/screens/(auth)/auth/register/details/organisms/register-details-step/components/UsernameField.tsx
+++ b/platforms/market/src/app/screens/(auth)/auth/register/details/organisms/register-details-step/components/UsernameField.tsx
@@ -1,5 +1,8 @@
'use client';
+import { FlexBox } from '@lumina/island/atoms/flex-box';
+import { Icon } from '@lumina/island/atoms/icon';
+import { Typography } from '@lumina/island/atoms/typography';
import { TextInput } from '@lumina/island/molecules/text-input';
import { Controller } from 'react-hook-form';
import type { FieldValues } from 'react-hook-form';
@@ -9,35 +12,63 @@ import { translateMessage } from '../../../../../../../../../shared/utils';
import { USERNAME_LENGTH } from '../../../../../../../../../shared/validations';
import type { UsernameFieldProps } from '../types';
-/** The public username: left to right after a fixed «@», lower-case, 3 to 30 characters. */
+/**
+ * The public username: left to right after a fixed «@», lower-case, 3 to 30 characters. A wrong
+ * character or a taken name shows as it is typed, and a free one gets the ✓ line in place of the
+ * hint; the other rules wait for blur.
+ */
export function UsernameField({
control,
name,
placeholder,
hint,
+ note,
+ availability,
}: UsernameFieldProps) {
const { t } = useTranslation('auth');
return (
- (
-
+
+ {
+ const error = fieldState.error?.message ?? availability.error;
+ return (
+
+ );
+ }}
+ />
+ {note && (
+
+
+
+ {note}
+
+
)}
- />
+
);
}
diff --git a/platforms/market/src/app/screens/(auth)/auth/register/details/organisms/register-details-step/types.ts b/platforms/market/src/app/screens/(auth)/auth/register/details/organisms/register-details-step/types.ts
index c2d6814..1a216d5 100644
--- a/platforms/market/src/app/screens/(auth)/auth/register/details/organisms/register-details-step/types.ts
+++ b/platforms/market/src/app/screens/(auth)/auth/register/details/organisms/register-details-step/types.ts
@@ -4,6 +4,7 @@ import type { Control, FieldValues, Path } from 'react-hook-form';
import type {
RegisterDetailsPageModel,
UseDetailsPartOptions,
+ UsernameAvailability,
} from '../../../../../../../../features/auth';
import type { SupportEntryProps } from '../../../../../../organisms/support-entry';
@@ -36,6 +37,9 @@ export type DetailsFrameProps = DetailsFormProps & {
export type ExpiryWarningProps = {
expiresAt: number;
+ isRenewing: boolean;
+ /** Without it, the warning offers no renewal (the server allows no more). */
+ onRenew?: () => void;
};
export type ExpiryHaltProps = {
@@ -53,8 +57,12 @@ export type UsernameFieldProps = {
control: Control;
name: Path;
placeholder: string;
- /** A rule shown before typing, replaced by an error. */
+ /** A rule shown before typing, replaced by an error or the free ✓. */
hint?: string;
+ /** A note that stays under the field whatever it shows, with a lock: the name can't change later. */
+ note?: string;
+ /** The live character and availability checks. */
+ availability: UsernameAvailability;
};
export type NameFieldsProps = {
diff --git a/platforms/market/src/app/screens/(auth)/auth/register/organisms/register-type-step/RegisterTypeStep.tsx b/platforms/market/src/app/screens/(auth)/auth/register/organisms/register-type-step/RegisterTypeStep.tsx
index d0ff4d3..be49717 100644
--- a/platforms/market/src/app/screens/(auth)/auth/register/organisms/register-type-step/RegisterTypeStep.tsx
+++ b/platforms/market/src/app/screens/(auth)/auth/register/organisms/register-type-step/RegisterTypeStep.tsx
@@ -77,9 +77,11 @@ export function RegisterTypeStep({
{t('register.type.label')}
- {ACCOUNT_TYPES.map(({ value, icon }) => (
+ {ACCOUNT_TYPES.map(({ value, icon }, index) => (
+ {/* The toast carries the details; the banner says what to do (S6 1.5). */}
{formError && (
-
- {formError}
-
+ {t('phone.send-failed-banner')}
)}
@@ -98,6 +97,10 @@ export function RegisterPhoneStep({
render={({ field, fieldState }) => (
{
+ field.onChange(event);
+ clearError();
+ }}
type="tel"
dir="ltr"
inputMode="numeric"
@@ -140,9 +143,7 @@ export function RegisterPhoneStep({
{t('register.has-account')}
-
- {t('register.login')}
-
+ {t('register.login')}
diff --git a/platforms/market/src/app/screens/(onboarding)/onboarding/creator-profile/organisms/creator-profile-step/components/CompletedView.tsx b/platforms/market/src/app/screens/(onboarding)/onboarding/creator-profile/done/organisms/creator-profile-done-step/CreatorProfileDoneStep.tsx
similarity index 57%
rename from platforms/market/src/app/screens/(onboarding)/onboarding/creator-profile/organisms/creator-profile-step/components/CompletedView.tsx
rename to platforms/market/src/app/screens/(onboarding)/onboarding/creator-profile/done/organisms/creator-profile-done-step/CreatorProfileDoneStep.tsx
index 1d501d4..b2cd852 100644
--- a/platforms/market/src/app/screens/(onboarding)/onboarding/creator-profile/organisms/creator-profile-step/components/CompletedView.tsx
+++ b/platforms/market/src/app/screens/(onboarding)/onboarding/creator-profile/done/organisms/creator-profile-done-step/CreatorProfileDoneStep.tsx
@@ -11,9 +11,11 @@ import { Card } from '@lumina/island/molecules/card';
import { useEffect, useRef } from 'react';
import { useTranslation } from 'react-i18next';
-import { ROUTES } from '../../../../../../../navigation';
+import { useCreatorProfileDonePage } from '../../../../../../../../features/profile';
+import { ROUTES, useAuthRoutes } from '../../../../../../../navigation';
import { SupportEntry } from '../../../../../../organisms/support-entry';
-import type { CompletedViewProps } from '../types';
+import { CreatorProfileDoneStepSkeleton } from './CreatorProfileDoneStepSkeleton';
+import type { CreatorProfileDoneStepProps } from './types';
const NEXT_STEPS = [
{ icon: 'check-circle', text: 'account', tone: 'text-success-text' },
@@ -23,21 +25,28 @@ const NEXT_STEPS = [
] as const satisfies readonly { icon: IconName; text: string; tone: string }[];
/**
- * The end of registration for a creator: identity under review (the dashboard's badge), news by
- * SMS and notification, prices can be set now, posting opens after approval. Focus moves to the
- * heading so screen readers hear it.
+ * The end of registration for a creator (R2-CompleteProfile 1.8, 3.3): identity under review (the
+ * dashboard's badge), news by SMS and notification, prices can be set now, posting opens after
+ * approval. «رفتن به کانال» goes to the page that asked for login, else the channel. Focus moves
+ * to the heading so screen readers hear it.
*/
-export function CompletedView({
- username,
+export function CreatorProfileDoneStep({
size,
supportPlacement,
-}: CompletedViewProps) {
+}: CreatorProfileDoneStepProps) {
const { t } = useTranslation('auth');
const { t: tCommon } = useTranslation('common');
+ const routes = useAuthRoutes();
+ const { username, isLeaving } = useCreatorProfileDonePage({
+ formHref: routes.profile.creator,
+ });
const headingRef = useRef(null);
- useEffect(() => headingRef.current?.focus(), []);
+ useEffect(() => headingRef.current?.focus(), [isLeaving]);
+ if (isLeaving) {
+ return ;
+ }
return (
-
- {NEXT_STEPS.map(({ icon, text, tone }) => (
-
-
-
- {t(`register.profile.done.${text}`)}
-
-
- ))}
+
+
+ {NEXT_STEPS.map(({ icon, text, tone }) => (
+
+
+
+ {t(`register.profile.done.${text}`)}
+
+
+ ))}
+