feat(apps): creator plans, finance and pricing routes in bull and bear
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
parent
163005429d
commit
000c42bd74
|
|
@ -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 (
|
||||||
|
<FlexBox direction="flex-col" className="min-h-dvh bg-bg-page">
|
||||||
|
<DesktopHeader />
|
||||||
|
<FlexBox
|
||||||
|
tag="main"
|
||||||
|
justifyContent="justify-center"
|
||||||
|
className="px-8 py-10"
|
||||||
|
>
|
||||||
|
<FlexBox direction="flex-col" gap="gap-4" className="w-full max-w-form">
|
||||||
|
<DesktopPageTitle title={i18n.t('pricing:title')} />
|
||||||
|
<PricingFormSkeleton
|
||||||
|
layout="desktop"
|
||||||
|
label={i18n.t('pricing:loading')}
|
||||||
|
delayed
|
||||||
|
/>
|
||||||
|
</FlexBox>
|
||||||
|
</FlexBox>
|
||||||
|
</FlexBox>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
@ -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 = (
|
||||||
|
<PricingFormSkeleton layout="desktop" label={i18n.t('pricing:loading')} />
|
||||||
|
);
|
||||||
|
|
||||||
|
return (
|
||||||
|
<FlexBox direction="flex-col" className="min-h-dvh bg-bg-page">
|
||||||
|
<DesktopHeader />
|
||||||
|
<FlexBox
|
||||||
|
tag="main"
|
||||||
|
justifyContent="justify-center"
|
||||||
|
className="px-8 py-10"
|
||||||
|
>
|
||||||
|
<FlexBox direction="flex-col" gap="gap-4" className="w-full max-w-form">
|
||||||
|
<DesktopPageTitle title={i18n.t('pricing:title')} />
|
||||||
|
<PartBoundary
|
||||||
|
name="pricing-form"
|
||||||
|
description={i18n.t('pricing:error')}
|
||||||
|
framed
|
||||||
|
>
|
||||||
|
<AuthGuard role="creator" fallback={skeleton}>
|
||||||
|
<Suspense fallback={skeleton}>
|
||||||
|
<PricingForm layout="desktop" />
|
||||||
|
</Suspense>
|
||||||
|
</AuthGuard>
|
||||||
|
</PartBoundary>
|
||||||
|
</FlexBox>
|
||||||
|
</FlexBox>
|
||||||
|
</FlexBox>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
@ -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 (
|
||||||
|
<FlexBox direction="flex-col" gap="gap-3">
|
||||||
|
<BalanceSummarySkeleton
|
||||||
|
layout="desktop"
|
||||||
|
label={i18n.t('finance:balance.loading')}
|
||||||
|
delayed
|
||||||
|
/>
|
||||||
|
<PayoutAccountSkeleton
|
||||||
|
layout="desktop"
|
||||||
|
label={i18n.t('finance:account.loading')}
|
||||||
|
delayed
|
||||||
|
/>
|
||||||
|
<LedgerSkeleton
|
||||||
|
layout="desktop"
|
||||||
|
label={i18n.t('finance:ledger.loading')}
|
||||||
|
delayed
|
||||||
|
/>
|
||||||
|
</FlexBox>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
@ -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 = (
|
||||||
|
<BalanceSummarySkeleton
|
||||||
|
layout="desktop"
|
||||||
|
label={i18n.t('finance:balance.loading')}
|
||||||
|
/>
|
||||||
|
);
|
||||||
|
const accountSkeleton = (
|
||||||
|
<PayoutAccountSkeleton
|
||||||
|
layout="desktop"
|
||||||
|
label={i18n.t('finance:account.loading')}
|
||||||
|
/>
|
||||||
|
);
|
||||||
|
const ledgerSkeleton = (
|
||||||
|
<LedgerSkeleton layout="desktop" label={i18n.t('finance:ledger.loading')} />
|
||||||
|
);
|
||||||
|
|
||||||
|
return (
|
||||||
|
<FlexBox direction="flex-col" gap="gap-3">
|
||||||
|
<PayoutScheduleNotice
|
||||||
|
labels={{
|
||||||
|
before: i18n.t('finance:notice.before'),
|
||||||
|
day: i18n.t(`finance:weekdays.${PAYOUT_WEEKDAY}`),
|
||||||
|
after: i18n.t('finance:notice.after'),
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
<AuthGuard
|
||||||
|
role="creator"
|
||||||
|
fallback={
|
||||||
|
<FlexBox direction="flex-col" gap="gap-3">
|
||||||
|
{balanceSkeleton}
|
||||||
|
{accountSkeleton}
|
||||||
|
{ledgerSkeleton}
|
||||||
|
</FlexBox>
|
||||||
|
}
|
||||||
|
>
|
||||||
|
<FlexBox direction="flex-col" gap="gap-3">
|
||||||
|
<PartBoundary
|
||||||
|
name="balance-summary"
|
||||||
|
description={i18n.t('finance:balance.error')}
|
||||||
|
framed
|
||||||
|
>
|
||||||
|
<Suspense fallback={balanceSkeleton}>
|
||||||
|
<BalanceSummary layout="desktop" />
|
||||||
|
</Suspense>
|
||||||
|
</PartBoundary>
|
||||||
|
<PartBoundary
|
||||||
|
name="payout-account"
|
||||||
|
description={i18n.t('finance:account.error')}
|
||||||
|
framed
|
||||||
|
>
|
||||||
|
<Suspense fallback={accountSkeleton}>
|
||||||
|
<PayoutAccount layout="desktop" />
|
||||||
|
</Suspense>
|
||||||
|
</PartBoundary>
|
||||||
|
<PartBoundary
|
||||||
|
name="ledger"
|
||||||
|
description={i18n.t('finance:ledger.error')}
|
||||||
|
framed
|
||||||
|
>
|
||||||
|
<Suspense fallback={ledgerSkeleton}>
|
||||||
|
<Ledger layout="desktop" />
|
||||||
|
</Suspense>
|
||||||
|
</PartBoundary>
|
||||||
|
</FlexBox>
|
||||||
|
</AuthGuard>
|
||||||
|
</FlexBox>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
@ -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 (
|
||||||
|
<OnboardingGuard>
|
||||||
|
<FlexBox
|
||||||
|
tag="main"
|
||||||
|
justifyContent="justify-center"
|
||||||
|
className="px-8 py-10"
|
||||||
|
>
|
||||||
|
<FlexBox
|
||||||
|
direction="flex-col"
|
||||||
|
gap="gap-4"
|
||||||
|
className="w-full max-w-content"
|
||||||
|
>
|
||||||
|
<Typography tag="h1" variant="heading-lg">
|
||||||
|
{i18n.t('common:nav.dashboard')}
|
||||||
|
</Typography>
|
||||||
|
<DashboardTabs layout="desktop" role="creator" />
|
||||||
|
{children}
|
||||||
|
</FlexBox>
|
||||||
|
</FlexBox>
|
||||||
|
</OnboardingGuard>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
@ -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 (
|
||||||
|
<FlexBox direction="flex-col" gap="gap-4">
|
||||||
|
<PricingCardSkeleton
|
||||||
|
layout="desktop"
|
||||||
|
label={i18n.t('pricing:card.loading')}
|
||||||
|
delayed
|
||||||
|
/>
|
||||||
|
<SubscriberListSkeleton
|
||||||
|
layout="desktop"
|
||||||
|
label={i18n.t('dashboard:subscribers.loading')}
|
||||||
|
delayed
|
||||||
|
/>
|
||||||
|
</FlexBox>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
@ -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 = (
|
||||||
|
<PricingCardSkeleton
|
||||||
|
layout="desktop"
|
||||||
|
label={i18n.t('pricing:card.loading')}
|
||||||
|
/>
|
||||||
|
);
|
||||||
|
const subscribersSkeleton = (
|
||||||
|
<SubscriberListSkeleton
|
||||||
|
layout="desktop"
|
||||||
|
label={i18n.t('dashboard:subscribers.loading')}
|
||||||
|
/>
|
||||||
|
);
|
||||||
|
|
||||||
|
return (
|
||||||
|
<AuthGuard
|
||||||
|
role="creator"
|
||||||
|
fallback={
|
||||||
|
<FlexBox direction="flex-col" gap="gap-4">
|
||||||
|
{pricingSkeleton}
|
||||||
|
{subscribersSkeleton}
|
||||||
|
</FlexBox>
|
||||||
|
}
|
||||||
|
>
|
||||||
|
<FlexBox direction="flex-col" gap="gap-4">
|
||||||
|
<PartBoundary
|
||||||
|
name="pricing-card"
|
||||||
|
description={i18n.t('pricing:card.error')}
|
||||||
|
framed
|
||||||
|
>
|
||||||
|
<Suspense fallback={pricingSkeleton}>
|
||||||
|
<PricingCard layout="desktop" />
|
||||||
|
</Suspense>
|
||||||
|
</PartBoundary>
|
||||||
|
<PartBoundary
|
||||||
|
name="subscriber-list"
|
||||||
|
description={i18n.t('dashboard:subscribers.error')}
|
||||||
|
framed
|
||||||
|
>
|
||||||
|
<Suspense fallback={subscribersSkeleton}>
|
||||||
|
<SubscriberList layout="desktop" />
|
||||||
|
</Suspense>
|
||||||
|
</PartBoundary>
|
||||||
|
</FlexBox>
|
||||||
|
</AuthGuard>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
@ -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 (
|
||||||
|
<FlexBox direction="flex-col" className="min-h-dvh bg-bg-page">
|
||||||
|
<MobileTopBar title={i18n.t('pricing:title')} />
|
||||||
|
<FlexBox tag="main" direction="flex-col" className="flex-1 p-4">
|
||||||
|
<PricingFormSkeleton
|
||||||
|
layout="mobile"
|
||||||
|
label={i18n.t('pricing:loading')}
|
||||||
|
delayed
|
||||||
|
/>
|
||||||
|
</FlexBox>
|
||||||
|
</FlexBox>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
@ -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 = (
|
||||||
|
<PricingFormSkeleton layout="mobile" label={i18n.t('pricing:loading')} />
|
||||||
|
);
|
||||||
|
|
||||||
|
return (
|
||||||
|
<FlexBox direction="flex-col" className="min-h-dvh bg-bg-page">
|
||||||
|
<MobileTopBar title={i18n.t('pricing:title')} />
|
||||||
|
<FlexBox tag="main" direction="flex-col" className="flex-1 p-4">
|
||||||
|
<PartBoundary
|
||||||
|
name="pricing-form"
|
||||||
|
description={i18n.t('pricing:error')}
|
||||||
|
framed
|
||||||
|
>
|
||||||
|
<AuthGuard role="creator" fallback={skeleton}>
|
||||||
|
<Suspense fallback={skeleton}>
|
||||||
|
<PricingForm layout="mobile" />
|
||||||
|
</Suspense>
|
||||||
|
</AuthGuard>
|
||||||
|
</PartBoundary>
|
||||||
|
</FlexBox>
|
||||||
|
</FlexBox>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
@ -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 (
|
||||||
|
<FlexBox direction="flex-col" gap="gap-3">
|
||||||
|
<BalanceSummarySkeleton
|
||||||
|
layout="mobile"
|
||||||
|
label={i18n.t('finance:balance.loading')}
|
||||||
|
delayed
|
||||||
|
/>
|
||||||
|
<PayoutAccountSkeleton
|
||||||
|
layout="mobile"
|
||||||
|
label={i18n.t('finance:account.loading')}
|
||||||
|
delayed
|
||||||
|
/>
|
||||||
|
<LedgerSkeleton
|
||||||
|
layout="mobile"
|
||||||
|
label={i18n.t('finance:ledger.loading')}
|
||||||
|
delayed
|
||||||
|
/>
|
||||||
|
</FlexBox>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
@ -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 = (
|
||||||
|
<BalanceSummarySkeleton
|
||||||
|
layout="mobile"
|
||||||
|
label={i18n.t('finance:balance.loading')}
|
||||||
|
/>
|
||||||
|
);
|
||||||
|
const accountSkeleton = (
|
||||||
|
<PayoutAccountSkeleton
|
||||||
|
layout="mobile"
|
||||||
|
label={i18n.t('finance:account.loading')}
|
||||||
|
/>
|
||||||
|
);
|
||||||
|
const ledgerSkeleton = (
|
||||||
|
<LedgerSkeleton layout="mobile" label={i18n.t('finance:ledger.loading')} />
|
||||||
|
);
|
||||||
|
|
||||||
|
return (
|
||||||
|
<FlexBox direction="flex-col" gap="gap-3">
|
||||||
|
<PayoutScheduleNotice
|
||||||
|
labels={{
|
||||||
|
before: i18n.t('finance:notice.before'),
|
||||||
|
day: i18n.t(`finance:weekdays.${PAYOUT_WEEKDAY}`),
|
||||||
|
after: i18n.t('finance:notice.after'),
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
<AuthGuard
|
||||||
|
role="creator"
|
||||||
|
fallback={
|
||||||
|
<FlexBox direction="flex-col" gap="gap-3">
|
||||||
|
{balanceSkeleton}
|
||||||
|
{accountSkeleton}
|
||||||
|
{ledgerSkeleton}
|
||||||
|
</FlexBox>
|
||||||
|
}
|
||||||
|
>
|
||||||
|
<FlexBox direction="flex-col" gap="gap-3">
|
||||||
|
<PartBoundary
|
||||||
|
name="balance-summary"
|
||||||
|
description={i18n.t('finance:balance.error')}
|
||||||
|
framed
|
||||||
|
>
|
||||||
|
<Suspense fallback={balanceSkeleton}>
|
||||||
|
<BalanceSummary layout="mobile" />
|
||||||
|
</Suspense>
|
||||||
|
</PartBoundary>
|
||||||
|
<PartBoundary
|
||||||
|
name="payout-account"
|
||||||
|
description={i18n.t('finance:account.error')}
|
||||||
|
framed
|
||||||
|
>
|
||||||
|
<Suspense fallback={accountSkeleton}>
|
||||||
|
<PayoutAccount layout="mobile" />
|
||||||
|
</Suspense>
|
||||||
|
</PartBoundary>
|
||||||
|
<PartBoundary
|
||||||
|
name="ledger"
|
||||||
|
description={i18n.t('finance:ledger.error')}
|
||||||
|
framed
|
||||||
|
>
|
||||||
|
<Suspense fallback={ledgerSkeleton}>
|
||||||
|
<Ledger layout="mobile" />
|
||||||
|
</Suspense>
|
||||||
|
</PartBoundary>
|
||||||
|
</FlexBox>
|
||||||
|
</AuthGuard>
|
||||||
|
</FlexBox>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
@ -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 (
|
||||||
|
<OnboardingGuard>
|
||||||
|
<MobileTopBar isTab title={i18n.t('common:nav.dashboard')} />
|
||||||
|
<DashboardTabs layout="mobile" role="creator" />
|
||||||
|
<FlexBox tag="main" direction="flex-col" className="flex-1 p-4">
|
||||||
|
{children}
|
||||||
|
</FlexBox>
|
||||||
|
</OnboardingGuard>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
@ -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 (
|
||||||
|
<FlexBox direction="flex-col" gap="gap-4">
|
||||||
|
<PricingCardSkeleton
|
||||||
|
layout="mobile"
|
||||||
|
label={i18n.t('pricing:card.loading')}
|
||||||
|
delayed
|
||||||
|
/>
|
||||||
|
<SubscriberListSkeleton
|
||||||
|
layout="mobile"
|
||||||
|
label={i18n.t('dashboard:subscribers.loading')}
|
||||||
|
delayed
|
||||||
|
/>
|
||||||
|
</FlexBox>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
@ -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 = (
|
||||||
|
<PricingCardSkeleton
|
||||||
|
layout="mobile"
|
||||||
|
label={i18n.t('pricing:card.loading')}
|
||||||
|
/>
|
||||||
|
);
|
||||||
|
const subscribersSkeleton = (
|
||||||
|
<SubscriberListSkeleton
|
||||||
|
layout="mobile"
|
||||||
|
label={i18n.t('dashboard:subscribers.loading')}
|
||||||
|
/>
|
||||||
|
);
|
||||||
|
|
||||||
|
return (
|
||||||
|
<AuthGuard
|
||||||
|
role="creator"
|
||||||
|
fallback={
|
||||||
|
<FlexBox direction="flex-col" gap="gap-4">
|
||||||
|
{pricingSkeleton}
|
||||||
|
{subscribersSkeleton}
|
||||||
|
</FlexBox>
|
||||||
|
}
|
||||||
|
>
|
||||||
|
<FlexBox direction="flex-col" gap="gap-4">
|
||||||
|
<PartBoundary
|
||||||
|
name="pricing-card"
|
||||||
|
description={i18n.t('pricing:card.error')}
|
||||||
|
framed
|
||||||
|
>
|
||||||
|
<Suspense fallback={pricingSkeleton}>
|
||||||
|
<PricingCard layout="mobile" />
|
||||||
|
</Suspense>
|
||||||
|
</PartBoundary>
|
||||||
|
<PartBoundary
|
||||||
|
name="subscriber-list"
|
||||||
|
description={i18n.t('dashboard:subscribers.error')}
|
||||||
|
framed
|
||||||
|
>
|
||||||
|
<Suspense fallback={subscribersSkeleton}>
|
||||||
|
<SubscriberList layout="mobile" />
|
||||||
|
</Suspense>
|
||||||
|
</PartBoundary>
|
||||||
|
</FlexBox>
|
||||||
|
</AuthGuard>
|
||||||
|
);
|
||||||
|
}
|
||||||
Loading…
Reference in New Issue