From 000c42bd744a01c28517f6d73c9fab3f3c391bc5 Mon Sep 17 00:00:00 2001 From: Amiram_se Date: Fri, 9 Oct 2026 16:11:12 +0400 Subject: [PATCH] feat(apps): creator plans, finance and pricing routes in bull and bear Co-Authored-By: Claude Opus 5.5 --- .../dashboard/pricing/layout.tsx | 0 .../app/(flow)/dashboard/pricing/loading.tsx | 28 +++++ .../src/app/(flow)/dashboard/pricing/page.tsx | 56 ++++++++++ .../dashboard/(creator)/finance/loading.tsx | 29 +++++ .../dashboard/(creator)/finance/page.tsx | 103 ++++++++++++++++++ .../app/(main)/dashboard/(creator)/layout.tsx | 41 +++++++ .../dashboard/(creator)/plans/loading.tsx | 23 ++++ .../(main)/dashboard/(creator)/plans/page.tsx | 74 +++++++++++++ .../(main)/dashboard/finance/ledger/.gitkeep | 0 .../(main)/dashboard/finance/sheba/.gitkeep | 0 .../dashboard/pricing/layout.tsx | 0 .../app/(flow)/dashboard/pricing/loading.tsx | 21 ++++ .../src/app/(flow)/dashboard/pricing/page.tsx | 49 +++++++++ .../dashboard/(creator)/finance/loading.tsx | 29 +++++ .../dashboard/(creator)/finance/page.tsx | 103 ++++++++++++++++++ .../app/(main)/dashboard/(creator)/layout.tsx | 28 +++++ .../dashboard/(creator)/plans/loading.tsx | 23 ++++ .../(main)/dashboard/(creator)/plans/page.tsx | 74 +++++++++++++ .../(main)/dashboard/finance/ledger/.gitkeep | 0 .../(main)/dashboard/finance/sheba/.gitkeep | 0 20 files changed, 681 insertions(+) rename apps/bear/src/app/{(main) => (flow)}/dashboard/pricing/layout.tsx (100%) create mode 100644 apps/bear/src/app/(flow)/dashboard/pricing/loading.tsx create mode 100644 apps/bear/src/app/(flow)/dashboard/pricing/page.tsx create mode 100644 apps/bear/src/app/(main)/dashboard/(creator)/finance/loading.tsx create mode 100644 apps/bear/src/app/(main)/dashboard/(creator)/finance/page.tsx create mode 100644 apps/bear/src/app/(main)/dashboard/(creator)/layout.tsx create mode 100644 apps/bear/src/app/(main)/dashboard/(creator)/plans/loading.tsx create mode 100644 apps/bear/src/app/(main)/dashboard/(creator)/plans/page.tsx delete mode 100644 apps/bear/src/app/(main)/dashboard/finance/ledger/.gitkeep delete mode 100644 apps/bear/src/app/(main)/dashboard/finance/sheba/.gitkeep rename apps/bull/src/app/{(main) => (flow)}/dashboard/pricing/layout.tsx (100%) create mode 100644 apps/bull/src/app/(flow)/dashboard/pricing/loading.tsx create mode 100644 apps/bull/src/app/(flow)/dashboard/pricing/page.tsx create mode 100644 apps/bull/src/app/(main)/dashboard/(creator)/finance/loading.tsx create mode 100644 apps/bull/src/app/(main)/dashboard/(creator)/finance/page.tsx create mode 100644 apps/bull/src/app/(main)/dashboard/(creator)/layout.tsx create mode 100644 apps/bull/src/app/(main)/dashboard/(creator)/plans/loading.tsx create mode 100644 apps/bull/src/app/(main)/dashboard/(creator)/plans/page.tsx delete mode 100644 apps/bull/src/app/(main)/dashboard/finance/ledger/.gitkeep delete mode 100644 apps/bull/src/app/(main)/dashboard/finance/sheba/.gitkeep diff --git a/apps/bear/src/app/(main)/dashboard/pricing/layout.tsx b/apps/bear/src/app/(flow)/dashboard/pricing/layout.tsx similarity index 100% rename from apps/bear/src/app/(main)/dashboard/pricing/layout.tsx rename to apps/bear/src/app/(flow)/dashboard/pricing/layout.tsx diff --git a/apps/bear/src/app/(flow)/dashboard/pricing/loading.tsx b/apps/bear/src/app/(flow)/dashboard/pricing/loading.tsx new file mode 100644 index 0000000..2787c6e --- /dev/null +++ b/apps/bear/src/app/(flow)/dashboard/pricing/loading.tsx @@ -0,0 +1,28 @@ +import { FlexBox } from '@lumina/island/atoms/flex-box'; +import { DesktopHeader, DesktopPageTitle } from '@lumina/market/app/navigation'; +import { PricingFormSkeleton } from '@lumina/market/app/screens/(flow)/dashboard/pricing/organisms/pricing-form'; + +import { i18n } from '../../../../i18n'; + +/** C7 before the page arrives, card for card, under the header and its title. */ +export default function Loading() { + return ( + + + + + + + + + + ); +} diff --git a/apps/bear/src/app/(flow)/dashboard/pricing/page.tsx b/apps/bear/src/app/(flow)/dashboard/pricing/page.tsx new file mode 100644 index 0000000..23ed088 --- /dev/null +++ b/apps/bear/src/app/(flow)/dashboard/pricing/page.tsx @@ -0,0 +1,56 @@ +import { FlexBox } from '@lumina/island/atoms/flex-box'; +import { PartBoundary } from '@lumina/market/app/error-boundaries'; +import { AuthGuard } from '@lumina/market/app/guards/auth-guard'; +import { DesktopHeader, DesktopPageTitle } from '@lumina/market/app/navigation'; +import { + PricingForm, + PricingFormSkeleton, +} from '@lumina/market/app/screens/(flow)/dashboard/pricing/organisms/pricing-form'; +import type { Metadata } from 'next'; +import { Suspense } from 'react'; + +import { i18n } from '../../../../i18n'; + +export function generateMetadata(): Metadata { + return { + title: i18n.t('pricing:meta-title'), + robots: { index: false }, + }; +} + +/** + * C7, «ویرایش قیمت‌ها» on desktop (C7 ۸.۱): the creator header with داشبورد on, back beside the + * title, and the form in the 560 column. The form is the creator's own, so it renders in the + * browser behind cards of the same size. + */ +export default function PricingPage() { + const skeleton = ( + + ); + + return ( + + + + + + + + + + + + + + + + ); +} diff --git a/apps/bear/src/app/(main)/dashboard/(creator)/finance/loading.tsx b/apps/bear/src/app/(main)/dashboard/(creator)/finance/loading.tsx new file mode 100644 index 0000000..fdc6bf7 --- /dev/null +++ b/apps/bear/src/app/(main)/dashboard/(creator)/finance/loading.tsx @@ -0,0 +1,29 @@ +import { FlexBox } from '@lumina/island/atoms/flex-box'; +import { BalanceSummarySkeleton } from '@lumina/market/app/screens/(main)/dashboard/finance/organisms/balance-summary'; +import { LedgerSkeleton } from '@lumina/market/app/screens/(main)/dashboard/finance/organisms/ledger'; +import { PayoutAccountSkeleton } from '@lumina/market/app/screens/(main)/dashboard/finance/organisms/payout-account'; + +import { i18n } from '../../../../../i18n'; + +/** مالی before it arrives, block for block; the layout keeps the bar and the tabs. */ +export default function Loading() { + return ( + + + + + + ); +} diff --git a/apps/bear/src/app/(main)/dashboard/(creator)/finance/page.tsx b/apps/bear/src/app/(main)/dashboard/(creator)/finance/page.tsx new file mode 100644 index 0000000..de56f62 --- /dev/null +++ b/apps/bear/src/app/(main)/dashboard/(creator)/finance/page.tsx @@ -0,0 +1,103 @@ +import { FlexBox } from '@lumina/island/atoms/flex-box'; +import { PartBoundary } from '@lumina/market/app/error-boundaries'; +import { AuthGuard } from '@lumina/market/app/guards/auth-guard'; +import { + BalanceSummary, + BalanceSummarySkeleton, +} from '@lumina/market/app/screens/(main)/dashboard/finance/organisms/balance-summary'; +import { + Ledger, + LedgerSkeleton, +} from '@lumina/market/app/screens/(main)/dashboard/finance/organisms/ledger'; +import { + PayoutAccount, + PayoutAccountSkeleton, +} from '@lumina/market/app/screens/(main)/dashboard/finance/organisms/payout-account'; +import { PayoutScheduleNotice } from '@lumina/market/app/screens/(main)/dashboard/finance/organisms/payout-schedule-notice'; +import { PAYOUT_WEEKDAY } from '@lumina/market/shared/constants'; +import type { Metadata } from 'next'; +import { Suspense } from 'react'; + +import { i18n } from '../../../../../i18n'; + +export function generateMetadata(): Metadata { + return { + title: i18n.t('dashboard:finance.meta-title'), + robots: { index: false }, + }; +} + +/** + * داشبورد › مالی (brief §4; C19, C20), in this order: when payouts are made (the same for every + * creator, so from the server), then the creator's own balance, شبا and گردش حساب, each loading + * and failing on its own, so a failed balance never hides the ledger (C20 ۲.۴). + */ +export default function FinancePage() { + const balanceSkeleton = ( + + ); + const accountSkeleton = ( + + ); + const ledgerSkeleton = ( + + ); + + return ( + + + + {balanceSkeleton} + {accountSkeleton} + {ledgerSkeleton} + + } + > + + + + + + + + + + + + + + + + + + + + ); +} diff --git a/apps/bear/src/app/(main)/dashboard/(creator)/layout.tsx b/apps/bear/src/app/(main)/dashboard/(creator)/layout.tsx new file mode 100644 index 0000000..0119bf4 --- /dev/null +++ b/apps/bear/src/app/(main)/dashboard/(creator)/layout.tsx @@ -0,0 +1,41 @@ +import { FlexBox } from '@lumina/island/atoms/flex-box'; +import { Typography } from '@lumina/island/atoms/typography'; +import { OnboardingGuard } from '@lumina/market/app/guards/onboarding-guard'; +import { DashboardTabs } from '@lumina/market/app/screens/(main)/dashboard/organisms/dashboard-tabs'; +import type { ReactNode } from 'react'; + +import { i18n } from '../../../../i18n'; + +/** + * The creator's داشبورد on desktop (Creator Dashboard ۵.۱): the 640 column under the header, with + * the «داشبورد» heading, the two tabs «طرح‌های اشتراک» · «مالی», then the tab. Each tab is its own + * route with its own loading, so the heading and the tabs stay while one loads. Locked until + * registration step 5 is done (0016). + */ +export default function CreatorDashboardLayout({ + children, +}: { + children: ReactNode; +}) { + return ( + + + + + {i18n.t('common:nav.dashboard')} + + + {children} + + + + ); +} diff --git a/apps/bear/src/app/(main)/dashboard/(creator)/plans/loading.tsx b/apps/bear/src/app/(main)/dashboard/(creator)/plans/loading.tsx new file mode 100644 index 0000000..21024b3 --- /dev/null +++ b/apps/bear/src/app/(main)/dashboard/(creator)/plans/loading.tsx @@ -0,0 +1,23 @@ +import { FlexBox } from '@lumina/island/atoms/flex-box'; +import { PricingCardSkeleton } from '@lumina/market/app/screens/(main)/dashboard/plans/organisms/pricing-card'; +import { SubscriberListSkeleton } from '@lumina/market/app/screens/(main)/dashboard/plans/organisms/subscriber-list'; + +import { i18n } from '../../../../../i18n'; + +/** طرح‌های اشتراک before it arrives, card for card; the layout keeps the bar and the tabs. */ +export default function Loading() { + return ( + + + + + ); +} diff --git a/apps/bear/src/app/(main)/dashboard/(creator)/plans/page.tsx b/apps/bear/src/app/(main)/dashboard/(creator)/plans/page.tsx new file mode 100644 index 0000000..be7c0aa --- /dev/null +++ b/apps/bear/src/app/(main)/dashboard/(creator)/plans/page.tsx @@ -0,0 +1,74 @@ +import { FlexBox } from '@lumina/island/atoms/flex-box'; +import { PartBoundary } from '@lumina/market/app/error-boundaries'; +import { AuthGuard } from '@lumina/market/app/guards/auth-guard'; +import { + PricingCard, + PricingCardSkeleton, +} from '@lumina/market/app/screens/(main)/dashboard/plans/organisms/pricing-card'; +import { + SubscriberList, + SubscriberListSkeleton, +} from '@lumina/market/app/screens/(main)/dashboard/plans/organisms/subscriber-list'; +import type { Metadata } from 'next'; +import { Suspense } from 'react'; + +import { i18n } from '../../../../../i18n'; + +export function generateMetadata(): Metadata { + return { + title: i18n.t('dashboard:plans.meta-title'), + robots: { index: false }, + }; +} + +/** + * داشبورد › طرح‌های اشتراک (Creator Dashboard §۲): «قیمت طرح‌ها» over مشترکان, the creator's own, + * in the browser only. Each card loads and fails on its own (۲.۶); the tabs stay. + */ +export default function PlansPage() { + const pricingSkeleton = ( + + ); + const subscribersSkeleton = ( + + ); + + return ( + + {pricingSkeleton} + {subscribersSkeleton} + + } + > + + + + + + + + + + + + + + ); +} diff --git a/apps/bear/src/app/(main)/dashboard/finance/ledger/.gitkeep b/apps/bear/src/app/(main)/dashboard/finance/ledger/.gitkeep deleted file mode 100644 index e69de29..0000000 diff --git a/apps/bear/src/app/(main)/dashboard/finance/sheba/.gitkeep b/apps/bear/src/app/(main)/dashboard/finance/sheba/.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/(flow)/dashboard/pricing/layout.tsx similarity index 100% rename from apps/bull/src/app/(main)/dashboard/pricing/layout.tsx rename to apps/bull/src/app/(flow)/dashboard/pricing/layout.tsx diff --git a/apps/bull/src/app/(flow)/dashboard/pricing/loading.tsx b/apps/bull/src/app/(flow)/dashboard/pricing/loading.tsx new file mode 100644 index 0000000..fe9b8cf --- /dev/null +++ b/apps/bull/src/app/(flow)/dashboard/pricing/loading.tsx @@ -0,0 +1,21 @@ +import { FlexBox } from '@lumina/island/atoms/flex-box'; +import { MobileTopBar } from '@lumina/market/app/navigation'; +import { PricingFormSkeleton } from '@lumina/market/app/screens/(flow)/dashboard/pricing/organisms/pricing-form'; + +import { i18n } from '../../../../i18n'; + +/** C7 before the page arrives, card for card, under its bar. */ +export default function Loading() { + return ( + + + + + + + ); +} diff --git a/apps/bull/src/app/(flow)/dashboard/pricing/page.tsx b/apps/bull/src/app/(flow)/dashboard/pricing/page.tsx new file mode 100644 index 0000000..a76ae4f --- /dev/null +++ b/apps/bull/src/app/(flow)/dashboard/pricing/page.tsx @@ -0,0 +1,49 @@ +import { FlexBox } from '@lumina/island/atoms/flex-box'; +import { PartBoundary } from '@lumina/market/app/error-boundaries'; +import { AuthGuard } from '@lumina/market/app/guards/auth-guard'; +import { MobileTopBar } from '@lumina/market/app/navigation'; +import { + PricingForm, + PricingFormSkeleton, +} from '@lumina/market/app/screens/(flow)/dashboard/pricing/organisms/pricing-form'; +import type { Metadata } from 'next'; +import { Suspense } from 'react'; + +import { i18n } from '../../../../i18n'; + +export function generateMetadata(): Metadata { + return { + title: i18n.t('pricing:meta-title'), + robots: { index: false }, + }; +} + +/** + * C7, «ویرایش قیمت‌ها» on mobile: a task page pushed from the «قیمت طرح‌ها» card, back · title · + * support and no bottom nav (Creator Dashboard ۴.۱; consistency rules R7, R8). The form is the + * creator's own, so it renders in the browser behind cards of the same size. + */ +export default function PricingPage() { + const skeleton = ( + + ); + + return ( + + + + + + + + + + + + + ); +} diff --git a/apps/bull/src/app/(main)/dashboard/(creator)/finance/loading.tsx b/apps/bull/src/app/(main)/dashboard/(creator)/finance/loading.tsx new file mode 100644 index 0000000..67467d5 --- /dev/null +++ b/apps/bull/src/app/(main)/dashboard/(creator)/finance/loading.tsx @@ -0,0 +1,29 @@ +import { FlexBox } from '@lumina/island/atoms/flex-box'; +import { BalanceSummarySkeleton } from '@lumina/market/app/screens/(main)/dashboard/finance/organisms/balance-summary'; +import { LedgerSkeleton } from '@lumina/market/app/screens/(main)/dashboard/finance/organisms/ledger'; +import { PayoutAccountSkeleton } from '@lumina/market/app/screens/(main)/dashboard/finance/organisms/payout-account'; + +import { i18n } from '../../../../../i18n'; + +/** مالی before it arrives, block for block; the layout keeps the bar and the tabs. */ +export default function Loading() { + return ( + + + + + + ); +} diff --git a/apps/bull/src/app/(main)/dashboard/(creator)/finance/page.tsx b/apps/bull/src/app/(main)/dashboard/(creator)/finance/page.tsx new file mode 100644 index 0000000..6ac2035 --- /dev/null +++ b/apps/bull/src/app/(main)/dashboard/(creator)/finance/page.tsx @@ -0,0 +1,103 @@ +import { FlexBox } from '@lumina/island/atoms/flex-box'; +import { PartBoundary } from '@lumina/market/app/error-boundaries'; +import { AuthGuard } from '@lumina/market/app/guards/auth-guard'; +import { + BalanceSummary, + BalanceSummarySkeleton, +} from '@lumina/market/app/screens/(main)/dashboard/finance/organisms/balance-summary'; +import { + Ledger, + LedgerSkeleton, +} from '@lumina/market/app/screens/(main)/dashboard/finance/organisms/ledger'; +import { + PayoutAccount, + PayoutAccountSkeleton, +} from '@lumina/market/app/screens/(main)/dashboard/finance/organisms/payout-account'; +import { PayoutScheduleNotice } from '@lumina/market/app/screens/(main)/dashboard/finance/organisms/payout-schedule-notice'; +import { PAYOUT_WEEKDAY } from '@lumina/market/shared/constants'; +import type { Metadata } from 'next'; +import { Suspense } from 'react'; + +import { i18n } from '../../../../../i18n'; + +export function generateMetadata(): Metadata { + return { + title: i18n.t('dashboard:finance.meta-title'), + robots: { index: false }, + }; +} + +/** + * داشبورد › مالی (brief §4; C19, C20), in this order: when payouts are made (the same for every + * creator, so from the server), then the creator's own balance, شبا and گردش حساب, each loading + * and failing on its own, so a failed balance never hides the ledger (C20 ۲.۴). + */ +export default function FinancePage() { + const balanceSkeleton = ( + + ); + const accountSkeleton = ( + + ); + const ledgerSkeleton = ( + + ); + + return ( + + + + {balanceSkeleton} + {accountSkeleton} + {ledgerSkeleton} + + } + > + + + + + + + + + + + + + + + + + + + + ); +} diff --git a/apps/bull/src/app/(main)/dashboard/(creator)/layout.tsx b/apps/bull/src/app/(main)/dashboard/(creator)/layout.tsx new file mode 100644 index 0000000..aeb317f --- /dev/null +++ b/apps/bull/src/app/(main)/dashboard/(creator)/layout.tsx @@ -0,0 +1,28 @@ +import { FlexBox } from '@lumina/island/atoms/flex-box'; +import { OnboardingGuard } from '@lumina/market/app/guards/onboarding-guard'; +import { MobileTopBar } from '@lumina/market/app/navigation'; +import { DashboardTabs } from '@lumina/market/app/screens/(main)/dashboard/organisms/dashboard-tabs'; +import type { ReactNode } from 'react'; + +import { i18n } from '../../../../i18n'; + +/** + * The creator's داشبورد on mobile (Creator Dashboard ۱.۱): the tab bar «داشبورد», the two tabs + * «طرح‌های اشتراک» · «مالی», then the tab. Each tab is its own route with its own loading, so the + * bar and the tabs stay while one loads. Locked until registration step 5 is done (0016). + */ +export default function CreatorDashboardLayout({ + children, +}: { + children: ReactNode; +}) { + return ( + + + + + {children} + + + ); +} diff --git a/apps/bull/src/app/(main)/dashboard/(creator)/plans/loading.tsx b/apps/bull/src/app/(main)/dashboard/(creator)/plans/loading.tsx new file mode 100644 index 0000000..824514c --- /dev/null +++ b/apps/bull/src/app/(main)/dashboard/(creator)/plans/loading.tsx @@ -0,0 +1,23 @@ +import { FlexBox } from '@lumina/island/atoms/flex-box'; +import { PricingCardSkeleton } from '@lumina/market/app/screens/(main)/dashboard/plans/organisms/pricing-card'; +import { SubscriberListSkeleton } from '@lumina/market/app/screens/(main)/dashboard/plans/organisms/subscriber-list'; + +import { i18n } from '../../../../../i18n'; + +/** طرح‌های اشتراک before it arrives, card for card; the layout keeps the bar and the tabs. */ +export default function Loading() { + return ( + + + + + ); +} diff --git a/apps/bull/src/app/(main)/dashboard/(creator)/plans/page.tsx b/apps/bull/src/app/(main)/dashboard/(creator)/plans/page.tsx new file mode 100644 index 0000000..c74b635 --- /dev/null +++ b/apps/bull/src/app/(main)/dashboard/(creator)/plans/page.tsx @@ -0,0 +1,74 @@ +import { FlexBox } from '@lumina/island/atoms/flex-box'; +import { PartBoundary } from '@lumina/market/app/error-boundaries'; +import { AuthGuard } from '@lumina/market/app/guards/auth-guard'; +import { + PricingCard, + PricingCardSkeleton, +} from '@lumina/market/app/screens/(main)/dashboard/plans/organisms/pricing-card'; +import { + SubscriberList, + SubscriberListSkeleton, +} from '@lumina/market/app/screens/(main)/dashboard/plans/organisms/subscriber-list'; +import type { Metadata } from 'next'; +import { Suspense } from 'react'; + +import { i18n } from '../../../../../i18n'; + +export function generateMetadata(): Metadata { + return { + title: i18n.t('dashboard:plans.meta-title'), + robots: { index: false }, + }; +} + +/** + * داشبورد › طرح‌های اشتراک (Creator Dashboard §۲): «قیمت طرح‌ها» over مشترکان, the creator's own, + * in the browser only. Each card loads and fails on its own (۲.۶); the tabs stay. + */ +export default function PlansPage() { + const pricingSkeleton = ( + + ); + const subscribersSkeleton = ( + + ); + + return ( + + {pricingSkeleton} + {subscribersSkeleton} + + } + > + + + + + + + + + + + + + + ); +} diff --git a/apps/bull/src/app/(main)/dashboard/finance/ledger/.gitkeep b/apps/bull/src/app/(main)/dashboard/finance/ledger/.gitkeep deleted file mode 100644 index e69de29..0000000 diff --git a/apps/bull/src/app/(main)/dashboard/finance/sheba/.gitkeep b/apps/bull/src/app/(main)/dashboard/finance/sheba/.gitkeep deleted file mode 100644 index e69de29..0000000