refactor(market,apps): share the registration frame with onboarding

Registration step 5 lives under (onboarding), so the pieces both route groups
use move to the nearest level they share. No behavior change.

- SupportEntry and RegisterProgress move from screens/(auth) to
  screens/organisms.
- bull's AuthTopBar and both apps' AuthTemplate move from the (auth) group to
  the app root's organisms/ and templates/.
- MARKETS and Market move from the profile feature to shared/constants, so
  features other than profile (the investor's interests) can use them.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Amiram_se 2026-10-05 22:32:05 +04:00
parent 46958936dc
commit 02e543d95d
53 changed files with 72 additions and 83 deletions

View File

@ -4,7 +4,7 @@ import { LoginStep } from '@lumina/market/app/screens/(auth)/auth/login/organism
import type { Metadata } from 'next';
import { i18n } from '../../../../i18n';
import { AuthTemplate } from '../../templates/auth-template';
import { AuthTemplate } from '../../../templates/auth-template';
export function generateMetadata(): Metadata {
return { title: i18n.t('auth:login.meta-title'), robots: { index: false } };

View File

@ -4,7 +4,7 @@ import { LoginVerifyStep } from '@lumina/market/app/screens/(auth)/auth/login/ve
import type { Metadata } from 'next';
import { i18n } from '../../../../../i18n';
import { AuthTemplate } from '../../../templates/auth-template';
import { AuthTemplate } from '../../../../templates/auth-template';
export function generateMetadata(): Metadata {
return {

View File

@ -4,7 +4,7 @@ import { RegisterDetailsStep } from '@lumina/market/app/screens/(auth)/auth/regi
import type { Metadata } from 'next';
import { i18n } from '../../../../../i18n';
import { AuthTemplate } from '../../../templates/auth-template';
import { AuthTemplate } from '../../../../templates/auth-template';
export function generateMetadata(): Metadata {
return {

View File

@ -4,7 +4,7 @@ import { RegisterTypeStep } from '@lumina/market/app/screens/(auth)/auth/registe
import type { Metadata } from 'next';
import { i18n } from '../../../../i18n';
import { AuthTemplate } from '../../templates/auth-template';
import { AuthTemplate } from '../../../templates/auth-template';
export function generateMetadata(): Metadata {
return {

View File

@ -4,7 +4,7 @@ import { RegisterPhoneStep } from '@lumina/market/app/screens/(auth)/auth/regist
import type { Metadata } from 'next';
import { i18n } from '../../../../../i18n';
import { AuthTemplate } from '../../../templates/auth-template';
import { AuthTemplate } from '../../../../templates/auth-template';
export function generateMetadata(): Metadata {
return {

View File

@ -4,7 +4,7 @@ import { RegisterVerifyStep } from '@lumina/market/app/screens/(auth)/auth/regis
import type { Metadata } from 'next';
import { i18n } from '../../../../../i18n';
import { AuthTemplate } from '../../../templates/auth-template';
import { AuthTemplate } from '../../../../templates/auth-template';
export function generateMetadata(): Metadata {
return {

View File

@ -1,7 +1,7 @@
import { SkeletonPreset } from '@lumina/island/organisms/skeleton-preset';
import { i18n } from '../../i18n';
import { AuthTemplate } from './templates/auth-template';
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() {

View File

@ -3,10 +3,10 @@ import { Typography } from '@lumina/island/atoms/typography';
import { Card } from '@lumina/island/molecules/card';
import { cn } from '@lumina/island/tools/cn';
import { ROUTES } from '@lumina/market/app/navigation';
import { SupportEntry } from '@lumina/market/app/screens/(auth)/organisms/support-entry';
import { SupportEntry } from '@lumina/market/app/screens/organisms/support-entry';
import NextLink from 'next/link';
import { i18n } from '../../../../i18n';
import { i18n } from '../../../i18n';
import type { AuthTemplateProps } from './types';
/**

View File

@ -4,8 +4,8 @@ import { LoginStep } from '@lumina/market/app/screens/(auth)/auth/login/organism
import type { Metadata } from 'next';
import { i18n } from '../../../../i18n';
import { AuthTopBar } from '../../organisms/auth-top-bar';
import { AuthTemplate } from '../../templates/auth-template';
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 } };

View File

@ -5,8 +5,8 @@ import { LoginVerifyStep } from '@lumina/market/app/screens/(auth)/auth/login/ve
import type { Metadata } from 'next';
import { i18n } from '../../../../../i18n';
import { AuthTopBar } from '../../../organisms/auth-top-bar';
import { AuthTemplate } from '../../../templates/auth-template';
import { AuthTopBar } from '../../../../organisms/auth-top-bar';
import { AuthTemplate } from '../../../../templates/auth-template';
export function generateMetadata(): Metadata {
return {

View File

@ -4,8 +4,8 @@ import { RegisterDetailsStep } from '@lumina/market/app/screens/(auth)/auth/regi
import type { Metadata } from 'next';
import { i18n } from '../../../../../i18n';
import { AuthTopBar } from '../../../organisms/auth-top-bar';
import { AuthTemplate } from '../../../templates/auth-template';
import { AuthTopBar } from '../../../../organisms/auth-top-bar';
import { AuthTemplate } from '../../../../templates/auth-template';
export function generateMetadata(): Metadata {
return {

View File

@ -4,8 +4,8 @@ import { RegisterTypeStep } from '@lumina/market/app/screens/(auth)/auth/registe
import type { Metadata } from 'next';
import { i18n } from '../../../../i18n';
import { AuthTopBar } from '../../organisms/auth-top-bar';
import { AuthTemplate } from '../../templates/auth-template';
import { AuthTopBar } from '../../../organisms/auth-top-bar';
import { AuthTemplate } from '../../../templates/auth-template';
export function generateMetadata(): Metadata {
return {

View File

@ -5,8 +5,8 @@ import { RegisterPhoneStep } from '@lumina/market/app/screens/(auth)/auth/regist
import type { Metadata } from 'next';
import { i18n } from '../../../../../i18n';
import { AuthTopBar } from '../../../organisms/auth-top-bar';
import { AuthTemplate } from '../../../templates/auth-template';
import { AuthTopBar } from '../../../../organisms/auth-top-bar';
import { AuthTemplate } from '../../../../templates/auth-template';
export function generateMetadata(): Metadata {
return {

View File

@ -5,8 +5,8 @@ import { RegisterVerifyStep } from '@lumina/market/app/screens/(auth)/auth/regis
import type { Metadata } from 'next';
import { i18n } from '../../../../../i18n';
import { AuthTopBar } from '../../../organisms/auth-top-bar';
import { AuthTemplate } from '../../../templates/auth-template';
import { AuthTopBar } from '../../../../organisms/auth-top-bar';
import { AuthTemplate } from '../../../../templates/auth-template';
export function generateMetadata(): Metadata {
return {

View File

@ -1,8 +1,8 @@
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';
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() {

View File

@ -2,10 +2,10 @@ 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';
import { SupportEntry } from '@lumina/market/app/screens/(auth)/organisms/support-entry';
import { SupportEntry } from '@lumina/market/app/screens/organisms/support-entry';
import NextLink from 'next/link';
import { i18n } from '../../../../i18n';
import { i18n } from '../../../i18n';
import type { AuthTopBarProps } from './types';
/**

View File

@ -13,7 +13,7 @@ import { useTranslation } from 'react-i18next';
import { useLoginPage } from '../../../../../../../features/auth';
import { translateMessage } from '../../../../../../../shared/utils';
import { useAuthRoutes } from '../../../../../../navigation';
import { SupportEntry } from '../../../../organisms/support-entry';
import { SupportEntry } from '../../../../../organisms/support-entry';
import type { LoginStepProps } from './types';
/**

View File

@ -1,4 +1,4 @@
import type { SupportEntryProps } from '../../../../organisms/support-entry';
import type { SupportEntryProps } from '../../../../../organisms/support-entry';
export type LoginStepProps = {
/** `lg` on mobile, `md` on desktop. */

View File

@ -6,7 +6,7 @@ import { Typography } from '@lumina/island/atoms/typography';
import { useEffect, useRef } from 'react';
import { useTranslation } from 'react-i18next';
import { SupportEntry } from '../../../../../../organisms/support-entry';
import { SupportEntry } from '../../../../../../../organisms/support-entry';
import type { SuspendedNoticeProps } from '../types';
/**

View File

@ -1,4 +1,4 @@
import type { SupportEntryProps } from '../../../../../organisms/support-entry';
import type { SupportEntryProps } from '../../../../../../organisms/support-entry';
export type LoginVerifyStepProps = {
/** `lg` on mobile, `md` on desktop. */

View File

@ -12,7 +12,7 @@ import { Controller } from 'react-hook-form';
import { useTranslation } from 'react-i18next';
import { formatMobile, translateMessage } from '../../../../../../shared/utils';
import { SupportEntry } from '../../../organisms/support-entry';
import { SupportEntry } from '../../../../organisms/support-entry';
import type { CodeStepProps } from './types';
/**

View File

@ -1,7 +1,7 @@
import type { ReactNode } from 'react';
import type { CodeStepModel } from '../../../../../../features/auth';
import type { SupportEntryProps } from '../../../organisms/support-entry';
import type { SupportEntryProps } from '../../../../organisms/support-entry';
export type CodeStepProps = {
/** The page model's code step (`useCodeStep`). */

View File

@ -6,8 +6,8 @@ import { Banner } from '@lumina/island/molecules/banner';
import type { FormEvent } from 'react';
import { useTranslation } from 'react-i18next';
import { SupportEntry } from '../../../../../../organisms/support-entry';
import { RegisterProgress } from '../../../../organisms/register-progress';
import { SupportEntry } from '../../../../../../../organisms/support-entry';
import { RegisterProgress } from '../../../../../../../organisms/register-progress';
import type { DetailsFrameProps } from '../types';
import { ExpiryHalt } from './ExpiryHalt';
import { ExpiryWarning } from './ExpiryWarning';

View File

@ -5,7 +5,7 @@ import type {
RegisterDetailsPageModel,
UseDetailsPartOptions,
} from '../../../../../../../../features/auth';
import type { SupportEntryProps } from '../../../../../organisms/support-entry';
import type { SupportEntryProps } from '../../../../../../organisms/support-entry';
export type RegisterDetailsStepProps = {
/** `lg` on mobile, `md` on desktop. */

View File

@ -14,8 +14,8 @@ import { useRegisterTypePage } from '../../../../../../../features/auth';
import type { UserRole } from '../../../../../../../features/auth';
import { translateMessage } from '../../../../../../../shared/utils';
import { useAuthRoutes } from '../../../../../../navigation';
import { SupportEntry } from '../../../../organisms/support-entry';
import { RegisterProgress } from '../register-progress';
import { SupportEntry } from '../../../../../organisms/support-entry';
import { RegisterProgress } from '../../../../../organisms/register-progress';
import type { RegisterTypeStepProps } from './types';
const ACCOUNT_TYPES = [

View File

@ -1,4 +1,4 @@
import type { SupportEntryProps } from '../../../../organisms/support-entry';
import type { SupportEntryProps } from '../../../../../organisms/support-entry';
export type RegisterTypeStepProps = {
/** `lg` on mobile, `md` on desktop. */

View File

@ -15,8 +15,8 @@ import { useTranslation } from 'react-i18next';
import { useRegisterPhonePage } from '../../../../../../../../features/auth';
import { translateMessage } from '../../../../../../../../shared/utils';
import { useAuthRoutes } from '../../../../../../../navigation';
import { SupportEntry } from '../../../../../organisms/support-entry';
import { RegisterProgress } from '../../../organisms/register-progress';
import { SupportEntry } from '../../../../../../organisms/support-entry';
import { RegisterProgress } from '../../../../../../organisms/register-progress';
import type { RegisterPhoneStepProps } from './types';
/**

View File

@ -1,4 +1,4 @@
import type { SupportEntryProps } from '../../../../../organisms/support-entry';
import type { SupportEntryProps } from '../../../../../../organisms/support-entry';
export type RegisterPhoneStepProps = {
/** `lg` on mobile, `md` on desktop. */

View File

@ -6,7 +6,7 @@ import { useTranslation } from 'react-i18next';
import { useRegisterVerifyPage } from '../../../../../../../../features/auth';
import { useAuthRoutes } from '../../../../../../../navigation';
import { CodeStep } from '../../../../organisms/code-step';
import { RegisterProgress } from '../../../organisms/register-progress';
import { RegisterProgress } from '../../../../../../organisms/register-progress';
import type { RegisterVerifyStepProps } from './types';
/**

View File

@ -1,4 +1,4 @@
import type { SupportEntryProps } from '../../../../../organisms/support-entry';
import type { SupportEntryProps } from '../../../../../../organisms/support-entry';
export type RegisterVerifyStepProps = {
/** `lg` on mobile, `md` on desktop. */

View File

@ -1,4 +1,4 @@
import type { UserRole } from '../../../../../../../features/auth';
import type { UserRole } from '../../../../features/auth';
export type RegisterProgressProps = {
/** 0-based: account type, number, code, details or identity, profile. */

View File

@ -7,8 +7,8 @@ import { SupportSheet } from '@lumina/island/organisms/support-sheet';
import { useState } from 'react';
import { useTranslation } from 'react-i18next';
import { getEnv } from '../../../../../env';
import { ROUTES } from '../../../../navigation';
import { getEnv } from '../../../../env';
import { ROUTES } from '../../../navigation';
import { SUPPORT_CHAT_URLS } from './constants';
import type { SupportEntryProps } from './types';

View File

@ -1,4 +1,5 @@
import type { Market, TradingStyle } from '../../../profile';
import type { Market } from '../../../../shared/constants';
import type { TradingStyle } from '../../../profile';
/**
* trader-service's public projection of an approved creator (`toPublicProfile`). `id` is the

View File

@ -1,8 +1,9 @@
import type {
BillingPeriod,
CompareSource,
Market,
} from '../../../../shared/constants';
import type { Market, SocialLinkPayload, TradingStyle } from '../../../profile';
import type { SocialLinkPayload, TradingStyle } from '../../../profile';
import type { PublicCreatorEntity } from '../../entities/public-creator';
import type { PublicTierEntity } from '../../entities/public-tier';

View File

@ -1,16 +1,4 @@
import type { Market, TradingStyle } from './entities/creator-profile';
/** Every market, in the server's order, for pickers. */
export const MARKETS: readonly Market[] = [
'crypto',
'gold',
'equities',
'forex',
'funds',
'real_estate',
'automotive',
'USDT',
];
import type { TradingStyle } from './entities/creator-profile';
/** Every trading style, in the server's order, for pickers. */
export const TRADING_STYLES: readonly TradingStyle[] = [

View File

@ -1,7 +1,6 @@
export type {
CreatorProfileEntity,
KycStatus,
Market,
SocialLinkEntity,
TradingStyle,
} from './types';

View File

@ -1,15 +1,4 @@
import type { VerificationStatus } from '../../../../shared/constants';
/** The markets a creator analyses (`MARKETS` in creator-profile-setup.dto). `USDT` is the dollar/tether market. */
export type Market =
| 'crypto'
| 'gold'
| 'equities'
| 'forex'
| 'funds'
| 'real_estate'
| 'automotive'
| 'USDT';
import type { Market, VerificationStatus } from '../../../../shared/constants';
/** How a creator trades (`TRADING_STYLES` in creator-profile-setup.dto). */
export type TradingStyle =

View File

@ -1,9 +1,5 @@
export { MARKETS, PROFILE_LIMITS, TRADING_STYLES } from './constants';
export type {
KycStatus,
Market,
TradingStyle,
} from './entities/creator-profile';
export { PROFILE_LIMITS, TRADING_STYLES } from './constants';
export type { KycStatus, TradingStyle } from './entities/creator-profile';
export { profileKeys, profileRepository } from './repositories/profile';
export type {
CreatorProfilePayload,

View File

@ -1,8 +1,10 @@
import type { VerificationStatus } from '../../../../shared/constants';
import type {
Market,
VerificationStatus,
} from '../../../../shared/constants';
import type {
CreatorProfileEntity,
KycStatus,
Market,
TradingStyle,
} from '../../entities/creator-profile';

View File

@ -71,6 +71,7 @@ export {
COMPARE_SOURCES,
CONFIRMATION_LANDINGS,
CONFIRMATION_PHASES,
MARKETS,
PAYMENT_STATUSES,
PAYMENT_UI_STATUSES,
SUBSCRIPTION_RECORD_STATUSES,
@ -82,13 +83,13 @@ export type {
CompareSource,
ConfirmationLanding,
ConfirmationPhase,
Market,
PaymentStatus,
PaymentUiStatus,
SubscriptionRecordStatus,
VerificationStatus,
} from './shared/constants';
export {
MARKETS,
PROFILE_LIMITS,
profileKeys,
profileRepository,
@ -97,7 +98,6 @@ export {
export type {
CreatorProfilePayload,
KycStatus,
Market,
SocialLinkArgs,
SocialLinkPayload,
TradingStyle,

View File

@ -37,6 +37,19 @@ export type ConfirmationPhase = (typeof CONFIRMATION_PHASES)[number];
export const CONFIRMATION_LANDINGS = ['wait', 'channel', 'checkout'] as const;
export type ConfirmationLanding = (typeof CONFIRMATION_LANDINGS)[number];
/** The markets creators analyse and investors follow (`MARKETS` in creator-profile-setup.dto). `USDT` is the dollar/tether market. */
export const MARKETS = [
'crypto',
'gold',
'equities',
'forex',
'funds',
'real_estate',
'automotive',
'USDT',
] as const;
export type Market = (typeof MARKETS)[number];
/**
* `subscription_payments.status` as stored. A pending payment turns `pending_review` after a while
* and `expired` after its 30-minute TTL.