From cb0891c77ca071247feb204b0a7d2d08ac113b52 Mon Sep 17 00:00:00 2001 From: Amiram_se Date: Tue, 6 Oct 2026 21:47:26 +0400 Subject: [PATCH] feat(market): complete entering and onboarding MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Login, registration steps 1–4 and step 5 now follow the design (S6, R2-Register, R2-CompleteProfile). - Login: hourly code limit and blocks open the code step with their wait; wrong-code message no longer replaced while retyping; suspended screen on its own route with the admin's reason; «log in to subscribe» variant. - Registration: focus on the first card or empty upload box; typed number kept; «تمدید زمان» renews the token; live username check with ✓; leave prompt for in-app links; creator ID accepts PDF and maps server field errors. - Step 5: square photo crop, stricter link rules, done screen on its own route; the session's `needsProfile` keeps unfinished creators out of publishing and pricing (OnboardingGuard) and sends them back to step 5 at login. - Every auth and onboarding route has its own loading skeleton matching its frame. Co-Authored-By: Claude Opus 5.5 --- .../(auth)/auth/login/(number)/loading.tsx | 13 +++ .../(auth)/auth/login/{ => (number)}/page.tsx | 4 +- .../(auth)/auth/login/suspended/loading.tsx | 13 +++ .../app/(auth)/auth/login/suspended/page.tsx | 36 ++++++++ .../app/(auth)/auth/login/verify/loading.tsx | 13 +++ .../(auth)/auth/register/(type)/loading.tsx | 18 ++++ .../auth/register/{ => (type)}/page.tsx | 4 +- .../(auth)/auth/register/details/loading.tsx | 18 ++++ .../(auth)/auth/register/phone/loading.tsx | 18 ++++ .../(auth)/auth/register/verify/loading.tsx | 18 ++++ apps/bear/src/app/(auth)/loading.tsx | 13 --- apps/bear/src/app/(flow)/compose/layout.tsx | 2 + .../src/app/(main)/dashboard/pricing/.gitkeep | 0 .../app/(main)/dashboard/pricing/layout.tsx | 2 + apps/bear/src/app/(onboarding)/loading.tsx | 13 --- .../onboarding/creator-identity/.gitkeep | 0 .../creator-profile/(form)/loading.tsx | 16 ++++ .../creator-profile/{ => (form)}/page.tsx | 4 +- .../creator-profile/done/loading.tsx | 13 +++ .../onboarding/creator-profile/done/page.tsx | 36 ++++++++ .../onboarding/investor-profile/loading.tsx | 13 +++ .../onboarding/investor-profile/page.tsx | 12 +-- .../(auth)/auth/login/(number)/loading.tsx | 14 +++ .../(auth)/auth/login/{ => (number)}/page.tsx | 6 +- .../(auth)/auth/login/suspended/loading.tsx | 14 +++ .../app/(auth)/auth/login/suspended/page.tsx | 37 ++++++++ .../app/(auth)/auth/login/verify/loading.tsx | 19 ++++ .../src/app/(auth)/auth/login/verify/page.tsx | 18 +--- .../(auth)/auth/register/(type)/loading.tsx | 19 ++++ .../auth/register/{ => (type)}/page.tsx | 6 +- .../(auth)/auth/register/details/loading.tsx | 21 +++++ .../(auth)/auth/register/phone/loading.tsx | 27 ++++++ .../app/(auth)/auth/register/phone/page.tsx | 18 +--- .../(auth)/auth/register/verify/loading.tsx | 27 ++++++ .../app/(auth)/auth/register/verify/page.tsx | 18 +--- apps/bull/src/app/(auth)/loading.tsx | 14 --- apps/bull/src/app/(flow)/compose/layout.tsx | 2 + .../src/app/(main)/dashboard/pricing/.gitkeep | 0 .../app/(main)/dashboard/pricing/layout.tsx | 2 + apps/bull/src/app/(onboarding)/loading.tsx | 16 ---- .../onboarding/creator-identity/.gitkeep | 0 .../creator-profile/(form)/loading.tsx | 19 ++++ .../creator-profile/{ => (form)}/page.tsx | 6 +- .../creator-profile/done/loading.tsx | 14 +++ .../onboarding/creator-profile/done/page.tsx | 38 ++++++++ .../onboarding/investor-profile/loading.tsx | 16 ++++ .../onboarding/investor-profile/page.tsx | 12 +-- .../app/organisms/auth-top-bar/AuthTopBar.tsx | 15 +-- .../auth-top-bar/components/BackButton.tsx | 23 +++++ .../src/app/organisms/auth-top-bar/types.ts | 9 +- .../src/app/guards/guest-guard/GuestGuard.tsx | 16 +++- .../src/app/guards/onboarding-guard/.gitkeep | 0 .../onboarding-guard/OnboardingGuard.tsx | 31 +++++++ .../src/app/guards/onboarding-guard/index.ts | 2 + .../src/app/guards/onboarding-guard/types.ts | 3 + .../market/src/app/navigation/constants.ts | 3 + .../app/navigation/hooks/use-auth-routes.ts | 27 +++++- platforms/market/src/app/navigation/index.ts | 7 +- .../market/src/app/navigation/navigation.ts | 16 +++- platforms/market/src/app/navigation/types.ts | 7 +- .../login/organisms/login-step/LoginStep.tsx | 40 ++++---- .../LoginSuspendedStep.tsx | 74 +++++++++++++++ .../organisms/login-suspended-step/index.ts | 2 + .../organisms/login-suspended-step/types.ts | 9 ++ .../login-verify-step/LoginVerifyStep.tsx | 11 +-- .../components/SuspendedNotice.tsx | 55 ----------- .../organisms/login-verify-step/types.ts | 2 - .../auth/organisms/code-step/CodeStep.tsx | 13 ++- .../components/CreatorIdentityForm.tsx | 10 +- .../components/DetailsFrame.tsx | 6 +- .../components/ExpiryWarning.tsx | 25 ++++- .../components/InvestorDetailsForm.tsx | 3 +- .../components/UsernameField.tsx | 71 ++++++++++---- .../organisms/register-details-step/types.ts | 10 +- .../register-type-step/RegisterTypeStep.tsx | 4 +- .../register-phone-step/RegisterPhoneStep.tsx | 15 +-- .../CreatorProfileDoneStep.tsx} | 70 ++++++++------ .../CreatorProfileDoneStepSkeleton.tsx | 37 ++++++++ .../creator-profile-done-step/index.ts | 6 ++ .../creator-profile-done-step/types.ts | 12 +++ .../CreatorProfileStep.tsx | 29 +++--- .../components/LinksSection.tsx | 5 + .../organisms/creator-profile-step/types.ts | 7 -- .../InvestorProfileStepSkeleton.tsx | 64 +++++++++++++ .../organisms/investor-profile-step/index.ts | 6 +- .../organisms/investor-profile-step/types.ts | 5 + .../features/auth/actions/login/actions.ts | 34 ++++--- .../src/features/auth/actions/login/types.ts | 4 +- .../auth/actions/register-creator/actions.ts | 6 +- .../auth/actions/register-investor/actions.ts | 2 +- .../actions/renew-registration/actions.ts | 36 ++++++++ .../auth/actions/renew-registration/index.ts | 1 + .../auth/actions/restore-session/actions.ts | 7 +- .../actions/save-investor-profile/actions.ts | 4 +- .../auth/actions/send-code/actions.ts | 35 +++++-- .../market/src/features/auth/constants.ts | 10 +- platforms/market/src/features/auth/index.ts | 17 +++- .../features/auth/models/code-step/types.ts | 8 +- .../auth/models/code-step/use-code-step.ts | 38 +++++--- .../auth/models/code-step/use-lift-at.ts | 10 ++ .../use-investor-profile-page.ts | 20 +++- .../auth/models/login-suspended/index.ts | 5 + .../auth/models/login-suspended/types.ts | 11 +++ .../use-login-suspended-page.ts | 29 ++++++ .../auth/models/login-verify/index.ts | 1 - .../auth/models/login-verify/types.ts | 7 +- .../login-verify/use-login-verify-page.ts | 39 +++----- .../src/features/auth/models/login/index.ts | 6 +- .../src/features/auth/models/login/types.ts | 26 +++--- .../auth/models/login/use-login-page.ts | 68 +++++--------- .../features/auth/models/phone-step/index.ts | 2 + .../features/auth/models/phone-step/types.ts | 23 +++++ .../auth/models/phone-step/use-phone-step.ts | 80 ++++++++++++++++ .../auth/models/register-details/index.ts | 2 + .../auth/models/register-details/types.ts | 16 ++++ .../use-creator-identity-part.ts | 77 +++++++++++----- .../use-investor-details-part.ts | 25 ++++- .../register-details/use-leave-guard.ts | 51 +++++++++- .../use-register-details-page.ts | 45 ++++++++- .../use-username-availability.ts | 79 ++++++++++++++++ .../auth/models/register-phone/types.ts | 15 +-- .../register-phone/use-register-phone-page.ts | 70 +++++--------- .../features/auth/repositories/auth/auth.ts | 37 ++++++++ .../auth/repositories/auth/constants.ts | 29 ++++++ .../features/auth/repositories/auth/errors.ts | 92 +++++++++++++++---- .../features/auth/repositories/auth/index.ts | 13 ++- .../auth/repositories/auth/mappers.ts | 49 +++++++++- .../features/auth/repositories/auth/types.ts | 44 ++++++++- platforms/market/src/features/auth/types.ts | 1 + .../market/src/features/channel/index.ts | 1 + .../channel/repositories/channel/channel.ts | 18 +++- .../channel/repositories/channel/constants.ts | 4 + .../channel/repositories/channel/index.ts | 1 + .../channel/repositories/channel/types.ts | 3 + .../complete-creator-profile/actions.ts | 5 +- .../market/src/features/profile/index.ts | 7 +- .../models/creator-profile-done/index.ts | 5 + .../models/creator-profile-done/types.ts | 10 ++ .../use-creator-profile-done-page.ts | 33 +++++++ .../profile/models/creator-profile/index.ts | 2 +- .../profile/models/creator-profile/types.ts | 16 +++- .../creator-profile/use-creator-photo-part.ts | 21 +++-- .../use-creator-profile-page.ts | 45 +++++++-- .../use-session-follows-profile.ts | 13 +++ platforms/market/src/index.ts | 3 + .../market/src/shared/locales/fa/auth.json | 35 +++++-- .../market/src/shared/locales/fa/errors.json | 10 +- .../src/shared/utils/apply-server-errors.ts | 7 +- platforms/market/src/shared/utils/index.ts | 3 + .../src/shared/utils/show-action-error.ts | 4 +- .../market/src/shared/utils/social-links.ts | 33 +++++-- .../market/src/shared/utils/square-photo.ts | 77 ++++++++++++++++ .../shared/validations/auth-validations.ts | 10 +- .../src/shared/validations/constants.ts | 8 +- .../market/src/shared/validations/index.ts | 1 + .../shared/validations/profile-validations.ts | 12 ++- .../src/stores/auth-flow/auth-flow-store.ts | 23 ++++- .../market/src/stores/auth-flow/index.ts | 1 + .../market/src/stores/auth-flow/types.ts | 16 +++- .../market/src/stores/auth/auth-store.ts | 10 ++ platforms/market/src/stores/auth/index.ts | 7 +- platforms/market/src/stores/auth/types.ts | 13 ++- 162 files changed, 2393 insertions(+), 650 deletions(-) create mode 100644 apps/bear/src/app/(auth)/auth/login/(number)/loading.tsx rename apps/bear/src/app/(auth)/auth/login/{ => (number)}/page.tsx (87%) create mode 100644 apps/bear/src/app/(auth)/auth/login/suspended/loading.tsx create mode 100644 apps/bear/src/app/(auth)/auth/login/suspended/page.tsx create mode 100644 apps/bear/src/app/(auth)/auth/login/verify/loading.tsx create mode 100644 apps/bear/src/app/(auth)/auth/register/(type)/loading.tsx rename apps/bear/src/app/(auth)/auth/register/{ => (type)}/page.tsx (89%) create mode 100644 apps/bear/src/app/(auth)/auth/register/details/loading.tsx create mode 100644 apps/bear/src/app/(auth)/auth/register/phone/loading.tsx create mode 100644 apps/bear/src/app/(auth)/auth/register/verify/loading.tsx delete mode 100644 apps/bear/src/app/(auth)/loading.tsx create mode 100644 apps/bear/src/app/(flow)/compose/layout.tsx delete mode 100644 apps/bear/src/app/(main)/dashboard/pricing/.gitkeep create mode 100644 apps/bear/src/app/(main)/dashboard/pricing/layout.tsx delete mode 100644 apps/bear/src/app/(onboarding)/loading.tsx delete mode 100644 apps/bear/src/app/(onboarding)/onboarding/creator-identity/.gitkeep create mode 100644 apps/bear/src/app/(onboarding)/onboarding/creator-profile/(form)/loading.tsx rename apps/bear/src/app/(onboarding)/onboarding/creator-profile/{ => (form)}/page.tsx (91%) create mode 100644 apps/bear/src/app/(onboarding)/onboarding/creator-profile/done/loading.tsx create mode 100644 apps/bear/src/app/(onboarding)/onboarding/creator-profile/done/page.tsx create mode 100644 apps/bear/src/app/(onboarding)/onboarding/investor-profile/loading.tsx create mode 100644 apps/bull/src/app/(auth)/auth/login/(number)/loading.tsx rename apps/bull/src/app/(auth)/auth/login/{ => (number)}/page.tsx (82%) create mode 100644 apps/bull/src/app/(auth)/auth/login/suspended/loading.tsx create mode 100644 apps/bull/src/app/(auth)/auth/login/suspended/page.tsx create mode 100644 apps/bull/src/app/(auth)/auth/login/verify/loading.tsx create mode 100644 apps/bull/src/app/(auth)/auth/register/(type)/loading.tsx rename apps/bull/src/app/(auth)/auth/register/{ => (type)}/page.tsx (84%) create mode 100644 apps/bull/src/app/(auth)/auth/register/details/loading.tsx create mode 100644 apps/bull/src/app/(auth)/auth/register/phone/loading.tsx create mode 100644 apps/bull/src/app/(auth)/auth/register/verify/loading.tsx delete mode 100644 apps/bull/src/app/(auth)/loading.tsx create mode 100644 apps/bull/src/app/(flow)/compose/layout.tsx delete mode 100644 apps/bull/src/app/(main)/dashboard/pricing/.gitkeep create mode 100644 apps/bull/src/app/(main)/dashboard/pricing/layout.tsx delete mode 100644 apps/bull/src/app/(onboarding)/loading.tsx delete mode 100644 apps/bull/src/app/(onboarding)/onboarding/creator-identity/.gitkeep create mode 100644 apps/bull/src/app/(onboarding)/onboarding/creator-profile/(form)/loading.tsx rename apps/bull/src/app/(onboarding)/onboarding/creator-profile/{ => (form)}/page.tsx (87%) create mode 100644 apps/bull/src/app/(onboarding)/onboarding/creator-profile/done/loading.tsx create mode 100644 apps/bull/src/app/(onboarding)/onboarding/creator-profile/done/page.tsx create mode 100644 apps/bull/src/app/(onboarding)/onboarding/investor-profile/loading.tsx create mode 100644 apps/bull/src/app/organisms/auth-top-bar/components/BackButton.tsx delete mode 100644 platforms/market/src/app/guards/onboarding-guard/.gitkeep create mode 100644 platforms/market/src/app/guards/onboarding-guard/OnboardingGuard.tsx create mode 100644 platforms/market/src/app/guards/onboarding-guard/index.ts create mode 100644 platforms/market/src/app/guards/onboarding-guard/types.ts create mode 100644 platforms/market/src/app/screens/(auth)/auth/login/suspended/organisms/login-suspended-step/LoginSuspendedStep.tsx create mode 100644 platforms/market/src/app/screens/(auth)/auth/login/suspended/organisms/login-suspended-step/index.ts create mode 100644 platforms/market/src/app/screens/(auth)/auth/login/suspended/organisms/login-suspended-step/types.ts delete mode 100644 platforms/market/src/app/screens/(auth)/auth/login/verify/organisms/login-verify-step/components/SuspendedNotice.tsx rename platforms/market/src/app/screens/(onboarding)/onboarding/creator-profile/{organisms/creator-profile-step/components/CompletedView.tsx => done/organisms/creator-profile-done-step/CreatorProfileDoneStep.tsx} (57%) create mode 100644 platforms/market/src/app/screens/(onboarding)/onboarding/creator-profile/done/organisms/creator-profile-done-step/CreatorProfileDoneStepSkeleton.tsx create mode 100644 platforms/market/src/app/screens/(onboarding)/onboarding/creator-profile/done/organisms/creator-profile-done-step/index.ts create mode 100644 platforms/market/src/app/screens/(onboarding)/onboarding/creator-profile/done/organisms/creator-profile-done-step/types.ts create mode 100644 platforms/market/src/app/screens/(onboarding)/onboarding/investor-profile/organisms/investor-profile-step/InvestorProfileStepSkeleton.tsx create mode 100644 platforms/market/src/features/auth/actions/renew-registration/actions.ts create mode 100644 platforms/market/src/features/auth/actions/renew-registration/index.ts create mode 100644 platforms/market/src/features/auth/models/code-step/use-lift-at.ts create mode 100644 platforms/market/src/features/auth/models/login-suspended/index.ts create mode 100644 platforms/market/src/features/auth/models/login-suspended/types.ts create mode 100644 platforms/market/src/features/auth/models/login-suspended/use-login-suspended-page.ts create mode 100644 platforms/market/src/features/auth/models/phone-step/index.ts create mode 100644 platforms/market/src/features/auth/models/phone-step/types.ts create mode 100644 platforms/market/src/features/auth/models/phone-step/use-phone-step.ts create mode 100644 platforms/market/src/features/auth/models/register-details/use-username-availability.ts create mode 100644 platforms/market/src/features/profile/models/creator-profile-done/index.ts create mode 100644 platforms/market/src/features/profile/models/creator-profile-done/types.ts create mode 100644 platforms/market/src/features/profile/models/creator-profile-done/use-creator-profile-done-page.ts create mode 100644 platforms/market/src/features/profile/models/creator-profile/use-session-follows-profile.ts create mode 100644 platforms/market/src/shared/utils/square-photo.ts 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 && ( - + {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}`)} + + + ))} +