Compare commits
15 Commits
e5c7ec54d7
...
7a6cd93b41
| Author | SHA1 | Date |
|---|---|---|
|
|
7a6cd93b41 | |
|
|
e945e646fc | |
|
|
92a5e5410d | |
|
|
3e0cf9628d | |
|
|
c801ab6d8e | |
|
|
7c0b86bfb8 | |
|
|
907bc23e25 | |
|
|
85cedf9f98 | |
|
|
5eba6775f8 | |
|
|
f65d3c76a1 | |
|
|
75e8fe08fe | |
|
|
d3137973ab | |
|
|
48166c17db | |
|
|
0005b18d2a | |
|
|
c6c1aa33b2 |
|
|
@ -61,3 +61,6 @@ Thumbs.db
|
|||
|
||||
# graft's local graph cache — regenerable, not committed (run `graft build`).
|
||||
/graft/
|
||||
|
||||
# Written by the pwa lib's writeServiceWorker on every build or dev start.
|
||||
apps/*/public/sw.js
|
||||
|
|
|
|||
|
|
@ -4,6 +4,11 @@ NEXT_PUBLIC_BALE_HANDLE=lumina_support
|
|||
NEXT_PUBLIC_TELEGRAM_HANDLE=lumina_support
|
||||
NEXT_PUBLIC_SUPPORT_HOURS=شنبه تا پنجشنبه، ۹ تا ۱۸
|
||||
|
||||
# The service worker that keeps JS, CSS, fonts and the icon sprite on the device (pwa lib). Off in
|
||||
# development: a dev chunk keeps its name while its code changes. Production sets true; false
|
||||
# there unregisters the worker for every visitor on their next page load (the kill switch).
|
||||
NEXT_PUBLIC_SERVICE_WORKER_ENABLED=false
|
||||
|
||||
# Server only: the gateway's origin from inside the deployment network. Server requests go
|
||||
# there, and so does the browser's /api proxy (next.config rewrite, fixed at build time).
|
||||
API_INTERNAL_ORIGIN=http://localhost:3000
|
||||
|
|
|
|||
|
|
@ -1,6 +1,12 @@
|
|||
import { withFontCopy } from '@lumina/island/tools/font-copy-plugin';
|
||||
import { withIconSprite } from '@lumina/island/tools/icon-sprite-plugin';
|
||||
import {
|
||||
SERVICE_WORKER_HEADERS,
|
||||
SERVICE_WORKER_URL,
|
||||
writeServiceWorker,
|
||||
} from '@lumina/libs/pwa/plugin';
|
||||
import type { NextConfig } from 'next';
|
||||
import path from 'node:path';
|
||||
|
||||
import { API_PROXY_PATH, API_PROXY_TIMEOUT_MS } from './src/constants';
|
||||
import { apiInternalUrl } from './src/env/env.config';
|
||||
|
|
@ -12,6 +18,9 @@ const immutable = [
|
|||
];
|
||||
|
||||
const nextConfig: NextConfig = {
|
||||
// Every visitor gets the metadata in <head>, where Chrome looks for the manifest and Safari for
|
||||
// its home-screen tags; Next.js would otherwise stream it to the end of <body> (0054).
|
||||
htmlLimitedBots: /.*/,
|
||||
// The `/api` proxy's wait for the gateway (0018); uploads outlast Next.js's 30-second default.
|
||||
experimental: { proxyTimeout: API_PROXY_TIMEOUT_MS },
|
||||
// Workspace packages export TypeScript source, so Next.js compiles them.
|
||||
|
|
@ -42,9 +51,21 @@ const nextConfig: NextConfig = {
|
|||
];
|
||||
},
|
||||
async headers() {
|
||||
// Only Next calls `headers()`, on `next dev` and `next build`, so the worker is written here, as
|
||||
// island's plugins write theirs. Next runs from the app's folder, as every Nx target does.
|
||||
writeServiceWorker({ publicDir: path.join(process.cwd(), 'public') });
|
||||
return [
|
||||
{ source: '/fonts/:path*', headers: immutable },
|
||||
{ source: '/icons/:path*', headers: immutable },
|
||||
// Revalidated on every update check, so a new worker reaches visitors at their next
|
||||
// navigation; never immutable. /sw.js is never renamed or removed (pwa lib).
|
||||
{
|
||||
source: SERVICE_WORKER_URL,
|
||||
headers: Object.entries(SERVICE_WORKER_HEADERS).map(([key, value]) => ({
|
||||
key,
|
||||
value,
|
||||
})),
|
||||
},
|
||||
];
|
||||
},
|
||||
// One canonical URL per channel: send direct `/channels/…` hits to `/@…`.
|
||||
|
|
|
|||
|
|
@ -15,7 +15,8 @@
|
|||
"{projectRoot}/.next/!(cache)/**/*",
|
||||
"{projectRoot}/.next/!(cache)",
|
||||
"{projectRoot}/public/icons",
|
||||
"{projectRoot}/public/fonts"
|
||||
"{projectRoot}/public/fonts",
|
||||
"{projectRoot}/public/sw.js"
|
||||
]
|
||||
},
|
||||
"dev": {
|
||||
|
|
|
|||
Binary file not shown.
|
After Width: | Height: | Size: 3.2 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 9.9 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 5.8 KiB |
|
|
@ -6,9 +6,10 @@ import type { Metadata } from 'next';
|
|||
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 } };
|
||||
}
|
||||
export const metadata: Metadata = {
|
||||
title: i18n.t('auth:login.meta-title'),
|
||||
robots: { index: false },
|
||||
};
|
||||
|
||||
/** Login, the number. The frame renders on the server; the step only in the browser (0013). */
|
||||
export default function LoginPage() {
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@ 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 (
|
||||
<AuthTemplate width="wide">
|
||||
<AuthTemplate>
|
||||
<SkeletonPreset preset="state" delayed label={i18n.t('auth:loading')} />
|
||||
</AuthTemplate>
|
||||
);
|
||||
|
|
|
|||
|
|
@ -6,12 +6,10 @@ 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 },
|
||||
};
|
||||
}
|
||||
export const metadata: Metadata = {
|
||||
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
|
||||
|
|
@ -19,7 +17,7 @@ export function generateMetadata(): Metadata {
|
|||
*/
|
||||
export default function LoginSuspendedPage() {
|
||||
return (
|
||||
<AuthTemplate width="wide">
|
||||
<AuthTemplate>
|
||||
<GuestGuard
|
||||
fallback={
|
||||
<SkeletonPreset preset="state" label={i18n.t('auth:loading')} />
|
||||
|
|
|
|||
|
|
@ -1,4 +1,5 @@
|
|||
import { SkeletonPreset } from '@lumina/island/organisms/skeleton-preset';
|
||||
import { ROUTES } from '@lumina/market/app/navigation';
|
||||
|
||||
import { i18n } from '../../../../../i18n';
|
||||
import { AuthTemplate } from '../../../../templates/auth-template';
|
||||
|
|
@ -6,7 +7,7 @@ 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 (
|
||||
<AuthTemplate>
|
||||
<AuthTemplate back={ROUTES.login}>
|
||||
<SkeletonPreset preset="form" delayed label={i18n.t('auth:loading')} />
|
||||
</AuthTemplate>
|
||||
);
|
||||
|
|
|
|||
|
|
@ -1,22 +1,21 @@
|
|||
import { SkeletonPreset } from '@lumina/island/organisms/skeleton-preset';
|
||||
import { GuestGuard } from '@lumina/market/app/guards/guest-guard';
|
||||
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';
|
||||
|
||||
import { i18n } from '../../../../../i18n';
|
||||
import { AuthTemplate } from '../../../../templates/auth-template';
|
||||
|
||||
export function generateMetadata(): Metadata {
|
||||
return {
|
||||
title: i18n.t('auth:login.verify-meta-title'),
|
||||
robots: { index: false },
|
||||
};
|
||||
}
|
||||
export const metadata: Metadata = {
|
||||
title: i18n.t('auth:login.verify-meta-title'),
|
||||
robots: { index: false },
|
||||
};
|
||||
|
||||
/** Login, the code. The frame renders on the server; the step only in the browser (0013). */
|
||||
export default function LoginVerifyPage() {
|
||||
return (
|
||||
<AuthTemplate>
|
||||
<AuthTemplate back={ROUTES.login}>
|
||||
<GuestGuard
|
||||
fallback={
|
||||
<SkeletonPreset preset="form" label={i18n.t('auth:loading')} />
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@ 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 (
|
||||
<AuthTemplate width="wide">
|
||||
<AuthTemplate>
|
||||
<SkeletonPreset
|
||||
preset="form"
|
||||
count={2}
|
||||
|
|
|
|||
|
|
@ -6,17 +6,15 @@ import type { Metadata } from 'next';
|
|||
import { i18n } from '../../../../../i18n';
|
||||
import { AuthTemplate } from '../../../../templates/auth-template';
|
||||
|
||||
export function generateMetadata(): Metadata {
|
||||
return {
|
||||
title: i18n.t('auth:register.meta-title'),
|
||||
robots: { index: false },
|
||||
};
|
||||
}
|
||||
export const metadata: Metadata = {
|
||||
title: i18n.t('auth:register.meta-title'),
|
||||
robots: { index: false },
|
||||
};
|
||||
|
||||
/** Registration step 1, the account type. The frame renders on the server; the step only in the browser (0013). */
|
||||
export default function RegisterTypePage() {
|
||||
return (
|
||||
<AuthTemplate width="wide">
|
||||
<AuthTemplate>
|
||||
<GuestGuard
|
||||
fallback={
|
||||
<SkeletonPreset
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@ 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 (
|
||||
<AuthTemplate width="wide">
|
||||
<AuthTemplate>
|
||||
<SkeletonPreset
|
||||
preset="form"
|
||||
count={3}
|
||||
|
|
|
|||
|
|
@ -6,17 +6,15 @@ import type { Metadata } from 'next';
|
|||
import { i18n } from '../../../../../i18n';
|
||||
import { AuthTemplate } from '../../../../templates/auth-template';
|
||||
|
||||
export function generateMetadata(): Metadata {
|
||||
return {
|
||||
title: i18n.t('auth:register.details.meta-title'),
|
||||
robots: { index: false },
|
||||
};
|
||||
}
|
||||
export const metadata: Metadata = {
|
||||
title: i18n.t('auth:register.details.meta-title'),
|
||||
robots: { index: false },
|
||||
};
|
||||
|
||||
/** Registration step 4, account details or identity. The frame renders on the server; the step only in the browser (0013). */
|
||||
export default function RegisterDetailsPage() {
|
||||
return (
|
||||
<AuthTemplate width="wide">
|
||||
<AuthTemplate>
|
||||
<GuestGuard
|
||||
fallback={
|
||||
<SkeletonPreset
|
||||
|
|
|
|||
|
|
@ -1,4 +1,5 @@
|
|||
import { SkeletonPreset } from '@lumina/island/organisms/skeleton-preset';
|
||||
import { ROUTES } from '@lumina/market/app/navigation';
|
||||
|
||||
import { i18n } from '../../../../../i18n';
|
||||
import { AuthTemplate } from '../../../../templates/auth-template';
|
||||
|
|
@ -6,7 +7,7 @@ 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 (
|
||||
<AuthTemplate>
|
||||
<AuthTemplate back={ROUTES.register.type}>
|
||||
<SkeletonPreset
|
||||
preset="form"
|
||||
count={1}
|
||||
|
|
|
|||
|
|
@ -1,22 +1,21 @@
|
|||
import { SkeletonPreset } from '@lumina/island/organisms/skeleton-preset';
|
||||
import { GuestGuard } from '@lumina/market/app/guards/guest-guard';
|
||||
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';
|
||||
|
||||
import { i18n } from '../../../../../i18n';
|
||||
import { AuthTemplate } from '../../../../templates/auth-template';
|
||||
|
||||
export function generateMetadata(): Metadata {
|
||||
return {
|
||||
title: i18n.t('auth:register.meta-title'),
|
||||
robots: { index: false },
|
||||
};
|
||||
}
|
||||
export const metadata: Metadata = {
|
||||
title: i18n.t('auth:register.meta-title'),
|
||||
robots: { index: false },
|
||||
};
|
||||
|
||||
/** Registration step 2, the number. The frame renders on the server; the step only in the browser (0013). */
|
||||
export default function RegisterPhonePage() {
|
||||
return (
|
||||
<AuthTemplate>
|
||||
<AuthTemplate back={ROUTES.register.type}>
|
||||
<GuestGuard
|
||||
fallback={
|
||||
<SkeletonPreset
|
||||
|
|
|
|||
|
|
@ -1,4 +1,5 @@
|
|||
import { SkeletonPreset } from '@lumina/island/organisms/skeleton-preset';
|
||||
import { ROUTES } from '@lumina/market/app/navigation';
|
||||
|
||||
import { i18n } from '../../../../../i18n';
|
||||
import { AuthTemplate } from '../../../../templates/auth-template';
|
||||
|
|
@ -6,7 +7,7 @@ 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 (
|
||||
<AuthTemplate>
|
||||
<AuthTemplate back={ROUTES.register.phone}>
|
||||
<SkeletonPreset
|
||||
preset="form"
|
||||
count={1}
|
||||
|
|
|
|||
|
|
@ -1,22 +1,21 @@
|
|||
import { SkeletonPreset } from '@lumina/island/organisms/skeleton-preset';
|
||||
import { GuestGuard } from '@lumina/market/app/guards/guest-guard';
|
||||
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';
|
||||
|
||||
import { i18n } from '../../../../../i18n';
|
||||
import { AuthTemplate } from '../../../../templates/auth-template';
|
||||
|
||||
export function generateMetadata(): Metadata {
|
||||
return {
|
||||
title: i18n.t('auth:register.verify.meta-title'),
|
||||
robots: { index: false },
|
||||
};
|
||||
}
|
||||
export const metadata: Metadata = {
|
||||
title: i18n.t('auth:register.verify.meta-title'),
|
||||
robots: { index: false },
|
||||
};
|
||||
|
||||
/** Registration step 3, the code. The frame renders on the server; the step only in the browser (0013). */
|
||||
export default function RegisterVerifyPage() {
|
||||
return (
|
||||
<AuthTemplate>
|
||||
<AuthTemplate back={ROUTES.register.phone}>
|
||||
<GuestGuard
|
||||
fallback={
|
||||
<SkeletonPreset
|
||||
|
|
|
|||
|
|
@ -1,3 +1,11 @@
|
|||
'use client';
|
||||
|
||||
export { PageError as default } from '@lumina/market/app/screens/organisms/page-error';
|
||||
import { PageError } from '@lumina/market/app/screens/organisms/page-error';
|
||||
import type { PageErrorProps } from '@lumina/market/app/screens/organisms/page-error';
|
||||
|
||||
/** A failed page of this group on desktop: the header over the state in the 640 column. */
|
||||
export default function GroupError(
|
||||
props: Pick<PageErrorProps, 'error' | 'retry'>,
|
||||
) {
|
||||
return <PageError {...props} layout="desktop" standalone />;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,35 @@
|
|||
import { FlexBox } from '@lumina/island/atoms/flex-box';
|
||||
import {
|
||||
DesktopHeader,
|
||||
DesktopPageTitle,
|
||||
ROUTES,
|
||||
} from '@lumina/market/app/navigation';
|
||||
import { InvestorProfileFormSkeleton } from '@lumina/market/app/screens/(flow)/account/profile/organisms/investor-profile-form';
|
||||
|
||||
import { i18n } from '../../../../i18n';
|
||||
|
||||
/** «اطلاعات کاربری» before it arrives, 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('account:profile.title')}
|
||||
parentHref={ROUTES.account.root}
|
||||
/>
|
||||
<InvestorProfileFormSkeleton
|
||||
layout="desktop"
|
||||
label={i18n.t('account:profile.loading')}
|
||||
delayed
|
||||
/>
|
||||
</FlexBox>
|
||||
</FlexBox>
|
||||
</FlexBox>
|
||||
);
|
||||
}
|
||||
|
|
@ -0,0 +1,58 @@
|
|||
import { FlexBox } from '@lumina/island/atoms/flex-box';
|
||||
import { AuthGuard } from '@lumina/market/app/guards/auth-guard';
|
||||
import {
|
||||
DesktopHeader,
|
||||
DesktopPageTitle,
|
||||
ROUTES,
|
||||
} from '@lumina/market/app/navigation';
|
||||
import { AccountProfile } from '@lumina/market/app/screens/(flow)/account/profile/organisms/account-profile';
|
||||
import { InvestorProfileFormSkeleton } from '@lumina/market/app/screens/(flow)/account/profile/organisms/investor-profile-form';
|
||||
import type { Metadata } from 'next';
|
||||
|
||||
import { i18n } from '../../../../i18n';
|
||||
|
||||
export const metadata: Metadata = {
|
||||
title: i18n.t('account:profile.title'),
|
||||
robots: { index: false },
|
||||
};
|
||||
|
||||
/**
|
||||
* «اطلاعات کاربری» on desktop, from the account menu or حساب کاربری: the header, then one route for
|
||||
* both roles (an investor's J12-2 in the 560 column, an analyst's J03-1 in the 640 one). Who is
|
||||
* looking is known only in the browser, so the server sends the investor's title and skeleton
|
||||
* (most members); then each role's page brings its own «بازگشت» and title, which ask about unsaved
|
||||
* changes.
|
||||
*/
|
||||
export default function AccountProfilePage() {
|
||||
return (
|
||||
<FlexBox direction="flex-col" className="min-h-dvh bg-bg-page">
|
||||
<DesktopHeader />
|
||||
<FlexBox
|
||||
tag="main"
|
||||
justifyContent="justify-center"
|
||||
className="px-8 py-10"
|
||||
>
|
||||
<AuthGuard
|
||||
fallback={
|
||||
<FlexBox
|
||||
direction="flex-col"
|
||||
gap="gap-4"
|
||||
className="w-full max-w-form"
|
||||
>
|
||||
<DesktopPageTitle
|
||||
title={i18n.t('account:profile.title')}
|
||||
parentHref={ROUTES.account.root}
|
||||
/>
|
||||
<InvestorProfileFormSkeleton
|
||||
layout="desktop"
|
||||
label={i18n.t('account:profile.loading')}
|
||||
/>
|
||||
</FlexBox>
|
||||
}
|
||||
>
|
||||
<AccountProfile layout="desktop" />
|
||||
</AuthGuard>
|
||||
</FlexBox>
|
||||
</FlexBox>
|
||||
);
|
||||
}
|
||||
|
|
@ -9,12 +9,10 @@ import { CheckoutTemplate } from './templates/checkout-template';
|
|||
|
||||
type CheckoutPageProps = { params: Promise<{ username: string }> };
|
||||
|
||||
export function generateMetadata(): Metadata {
|
||||
return {
|
||||
title: i18n.t('payment:checkout.title'),
|
||||
robots: { index: false },
|
||||
};
|
||||
}
|
||||
export const metadata: Metadata = {
|
||||
title: i18n.t('payment:checkout.title'),
|
||||
robots: { index: false },
|
||||
};
|
||||
|
||||
/**
|
||||
* Checkout for a creator's channel (U9), reached only from its «اشتراک». The server renders the
|
||||
|
|
|
|||
|
|
@ -31,7 +31,10 @@ export function CheckoutTemplate({ channel }: CheckoutTemplateProps) {
|
|||
gap="gap-4"
|
||||
className="w-full max-w-checkout"
|
||||
>
|
||||
<DesktopPageTitle title={t('checkout.title')} />
|
||||
<DesktopPageTitle
|
||||
title={t('checkout.title')}
|
||||
parentHref={ROUTES.channel(channel.username)}
|
||||
/>
|
||||
<PartBoundary
|
||||
name="checkout"
|
||||
description={t('checkout.error')}
|
||||
|
|
@ -41,12 +44,7 @@ export function CheckoutTemplate({ channel }: CheckoutTemplateProps) {
|
|||
creatorId={channel.creatorId}
|
||||
channelHref={ROUTES.channel(channel.username)}
|
||||
layout="desktop"
|
||||
creator={
|
||||
<CheckoutCreator
|
||||
creator={channel}
|
||||
labels={{ verified: t('checkout.verified') }}
|
||||
/>
|
||||
}
|
||||
creator={<CheckoutCreator creator={channel} />}
|
||||
/>
|
||||
</PartBoundary>
|
||||
</FlexBox>
|
||||
|
|
|
|||
|
|
@ -11,12 +11,10 @@ import { i18n } from '../../../../../i18n';
|
|||
|
||||
type EditPostPageProps = { params: Promise<{ id: string }> };
|
||||
|
||||
export function generateMetadata(): Metadata {
|
||||
return {
|
||||
title: i18n.t('content:composer.edit-title'),
|
||||
robots: { index: false },
|
||||
};
|
||||
}
|
||||
export const metadata: Metadata = {
|
||||
title: i18n.t('content:composer.edit-title'),
|
||||
robots: { index: false },
|
||||
};
|
||||
|
||||
/** Editing a published post, in its first 15 minutes; in the browser only. */
|
||||
export default async function EditPostPage({ params }: EditPostPageProps) {
|
||||
|
|
|
|||
|
|
@ -7,12 +7,10 @@ import type { Metadata } from 'next';
|
|||
|
||||
import { i18n } from '../../../../i18n';
|
||||
|
||||
export function generateMetadata(): Metadata {
|
||||
return {
|
||||
title: i18n.t('content:composer.new-title'),
|
||||
robots: { index: false },
|
||||
};
|
||||
}
|
||||
export const metadata: Metadata = {
|
||||
title: i18n.t('content:composer.new-title'),
|
||||
robots: { index: false },
|
||||
};
|
||||
|
||||
/** A new post (C4 ۷.۳): the 640px composer under the header, in the browser only. */
|
||||
export default function ComposePostPage() {
|
||||
|
|
|
|||
|
|
@ -0,0 +1,27 @@
|
|||
import { FlexBox } from '@lumina/island/atoms/flex-box';
|
||||
import { SkeletonPreset } from '@lumina/island/organisms/skeleton-preset';
|
||||
import { DesktopHeader } from '@lumina/market/app/navigation';
|
||||
|
||||
import { i18n } from '../../../../i18n';
|
||||
|
||||
/** The prediction composer before it arrives, under the real header. */
|
||||
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"
|
||||
>
|
||||
<SkeletonPreset
|
||||
preset="form"
|
||||
count={3}
|
||||
delayed
|
||||
label={i18n.t('predictions:composer.loading')}
|
||||
className="w-full max-w-240"
|
||||
/>
|
||||
</FlexBox>
|
||||
</FlexBox>
|
||||
);
|
||||
}
|
||||
|
|
@ -0,0 +1,44 @@
|
|||
import { FlexBox } from '@lumina/island/atoms/flex-box';
|
||||
import { SkeletonPreset } from '@lumina/island/organisms/skeleton-preset';
|
||||
import { AuthGuard } from '@lumina/market/app/guards/auth-guard';
|
||||
import { DesktopHeader } from '@lumina/market/app/navigation';
|
||||
import { PredictionComposer } from '@lumina/market/app/screens/(flow)/compose/prediction/organisms/prediction-composer';
|
||||
import type { Metadata } from 'next';
|
||||
|
||||
import { i18n } from '../../../../i18n';
|
||||
|
||||
export const metadata: Metadata = {
|
||||
title: i18n.t('predictions:composer.title'),
|
||||
robots: { index: false },
|
||||
};
|
||||
|
||||
/**
|
||||
* «پیشبینی جدید» on a direct load (J09-1-D): the 960px composer under the header, in the browser
|
||||
* only. From a page, the `@modal` slot opens it as a dialog over that page instead (0023).
|
||||
*/
|
||||
export default function ComposePredictionPage() {
|
||||
return (
|
||||
<FlexBox direction="flex-col" className="min-h-dvh bg-bg-page">
|
||||
<DesktopHeader />
|
||||
<FlexBox
|
||||
tag="main"
|
||||
justifyContent="justify-center"
|
||||
className="px-8 py-10"
|
||||
>
|
||||
<AuthGuard
|
||||
role="creator"
|
||||
fallback={
|
||||
<SkeletonPreset
|
||||
preset="form"
|
||||
count={3}
|
||||
label={i18n.t('predictions:composer.loading')}
|
||||
className="w-full max-w-240"
|
||||
/>
|
||||
}
|
||||
>
|
||||
<PredictionComposer layout="desktop" />
|
||||
</AuthGuard>
|
||||
</FlexBox>
|
||||
</FlexBox>
|
||||
);
|
||||
}
|
||||
|
|
@ -1,5 +1,9 @@
|
|||
import { FlexBox } from '@lumina/island/atoms/flex-box';
|
||||
import { DesktopHeader, DesktopPageTitle } from '@lumina/market/app/navigation';
|
||||
import {
|
||||
DesktopHeader,
|
||||
DesktopPageTitle,
|
||||
ROUTES,
|
||||
} from '@lumina/market/app/navigation';
|
||||
import { PricingFormSkeleton } from '@lumina/market/app/screens/(flow)/dashboard/pricing/organisms/pricing-form';
|
||||
|
||||
import { i18n } from '../../../../i18n';
|
||||
|
|
@ -15,7 +19,10 @@ export default function Loading() {
|
|||
className="px-8 py-10"
|
||||
>
|
||||
<FlexBox direction="flex-col" gap="gap-4" className="w-full max-w-form">
|
||||
<DesktopPageTitle title={i18n.t('pricing:title')} />
|
||||
<DesktopPageTitle
|
||||
title={i18n.t('pricing:title')}
|
||||
parentHref={ROUTES.dashboard.plans}
|
||||
/>
|
||||
<PricingFormSkeleton
|
||||
layout="desktop"
|
||||
label={i18n.t('pricing:loading')}
|
||||
|
|
|
|||
|
|
@ -1,7 +1,11 @@
|
|||
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 {
|
||||
DesktopHeader,
|
||||
DesktopPageTitle,
|
||||
ROUTES,
|
||||
} from '@lumina/market/app/navigation';
|
||||
import {
|
||||
PricingForm,
|
||||
PricingFormSkeleton,
|
||||
|
|
@ -11,16 +15,14 @@ import { Suspense } from 'react';
|
|||
|
||||
import { i18n } from '../../../../i18n';
|
||||
|
||||
export function generateMetadata(): Metadata {
|
||||
return {
|
||||
title: i18n.t('pricing:meta-title'),
|
||||
robots: { index: false },
|
||||
};
|
||||
}
|
||||
export const metadata: Metadata = {
|
||||
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
|
||||
* C7, «ویرایش قیمتها» on desktop (C7 ۸.۱): the creator header with داشبورد on, «بازگشت» above
|
||||
* the title (to طرحهای اشتراک when opened on its own, R14), 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() {
|
||||
|
|
@ -37,7 +39,10 @@ export default function PricingPage() {
|
|||
className="px-8 py-10"
|
||||
>
|
||||
<FlexBox direction="flex-col" gap="gap-4" className="w-full max-w-form">
|
||||
<DesktopPageTitle title={i18n.t('pricing:title')} />
|
||||
<DesktopPageTitle
|
||||
title={i18n.t('pricing:title')}
|
||||
parentHref={ROUTES.dashboard.plans}
|
||||
/>
|
||||
<PartBoundary
|
||||
name="pricing-form"
|
||||
description={i18n.t('pricing:error')}
|
||||
|
|
|
|||
|
|
@ -1,3 +1,11 @@
|
|||
'use client';
|
||||
|
||||
export { PageError as default } from '@lumina/market/app/screens/organisms/page-error';
|
||||
import { PageError } from '@lumina/market/app/screens/organisms/page-error';
|
||||
import type { PageErrorProps } from '@lumina/market/app/screens/organisms/page-error';
|
||||
|
||||
/** A failed page of this group on desktop: the header over the state in the 640 column. */
|
||||
export default function GroupError(
|
||||
props: Pick<PageErrorProps, 'error' | 'retry'>,
|
||||
) {
|
||||
return <PageError {...props} layout="desktop" standalone />;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
import { FlexBox } from '@lumina/island/atoms/flex-box';
|
||||
import { DesktopHeader } from '@lumina/market/app/navigation';
|
||||
import { DeskBack, DesktopHeader, ROUTES } from '@lumina/market/app/navigation';
|
||||
import { PaymentResultSkeleton } from '@lumina/market/app/screens/(flow)/payment/result/[paymentId]/organisms/payment-result';
|
||||
|
||||
import { i18n } from '../../../../../i18n';
|
||||
|
|
@ -14,7 +14,13 @@ export default function Loading() {
|
|||
justifyContent="justify-center"
|
||||
className="px-8 py-10"
|
||||
>
|
||||
<FlexBox direction="flex-col" className="w-full max-w-checkout">
|
||||
<FlexBox
|
||||
direction="flex-col"
|
||||
gap="gap-4"
|
||||
className="w-full max-w-checkout"
|
||||
>
|
||||
{/* To the channel paid for once the payment loads (R14), never to the bank. */}
|
||||
<DeskBack href={ROUTES.dashboard.subscriptions} />
|
||||
<PaymentResultSkeleton
|
||||
layout="desktop"
|
||||
label={i18n.t('payment:result.loading')}
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
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 } from '@lumina/market/app/navigation';
|
||||
import { DeskBack, DesktopHeader, ROUTES } from '@lumina/market/app/navigation';
|
||||
import {
|
||||
PaymentResult,
|
||||
PaymentResultSkeleton,
|
||||
|
|
@ -12,14 +12,15 @@ import { i18n } from '../../../../../i18n';
|
|||
|
||||
type PaymentResultPageProps = { params: Promise<{ paymentId: string }> };
|
||||
|
||||
export function generateMetadata(): Metadata {
|
||||
return {
|
||||
title: i18n.t('payment:result.meta-title'),
|
||||
robots: { index: false },
|
||||
};
|
||||
}
|
||||
export const metadata: Metadata = {
|
||||
title: i18n.t('payment:result.meta-title'),
|
||||
robots: { index: false },
|
||||
};
|
||||
|
||||
/** «نتیجه پرداخت» on desktop (U10 ۹.۴, ۹.۵): one panel in the 480 column under the header. */
|
||||
/**
|
||||
* «نتیجه پرداخت» on desktop (U10 ۹.۴, ۹.۵): «بازگشت», then one panel in the 480 column under the
|
||||
* header. Back goes to the channel paid for (R14), which the payment declares once it loads.
|
||||
*/
|
||||
export default async function PaymentResultPage({
|
||||
params,
|
||||
}: PaymentResultPageProps) {
|
||||
|
|
@ -39,7 +40,13 @@ export default async function PaymentResultPage({
|
|||
justifyContent="justify-center"
|
||||
className="px-8 py-10"
|
||||
>
|
||||
<FlexBox direction="flex-col" className="w-full max-w-checkout">
|
||||
<FlexBox
|
||||
direction="flex-col"
|
||||
gap="gap-4"
|
||||
className="w-full max-w-checkout"
|
||||
>
|
||||
{/* To the channel paid for once the payment loads (R14), never to the bank. */}
|
||||
<DeskBack href={ROUTES.dashboard.subscriptions} />
|
||||
<PartBoundary
|
||||
name="payment-result"
|
||||
description={i18n.t('payment:result.error')}
|
||||
|
|
|
|||
|
|
@ -10,12 +10,10 @@ type PaymentReturnPageProps = {
|
|||
searchParams: Promise<{ paymentId?: string | string[] }>;
|
||||
};
|
||||
|
||||
export function generateMetadata(): Metadata {
|
||||
return {
|
||||
title: i18n.t('payment:confirm.meta-title'),
|
||||
robots: { index: false },
|
||||
};
|
||||
}
|
||||
export const metadata: Metadata = {
|
||||
title: i18n.t('payment:confirm.meta-title'),
|
||||
robots: { index: false },
|
||||
};
|
||||
|
||||
/**
|
||||
* Back from the bank (U10 ۱.۱): «در حال تأیید پرداخت...» while the payment settles, then its
|
||||
|
|
|
|||
|
|
@ -0,0 +1,10 @@
|
|||
import { ROUTES } from '@lumina/market/app/navigation';
|
||||
import { redirect } from 'next/navigation';
|
||||
|
||||
/**
|
||||
* `/terms`, the address the boards give «شرایط اشتراک» (G-2), sends on to the page at its own
|
||||
* address. Temporary, so `/terms` can become a page of its own later.
|
||||
*/
|
||||
export default function TermsPage(): never {
|
||||
redirect(ROUTES.terms);
|
||||
}
|
||||
|
|
@ -1,3 +1,7 @@
|
|||
// First: the static `metadata` below reads a server-only namespace, which the server bootstrap
|
||||
// adds to i18n when this module loads, whichever module Next loads first (0055).
|
||||
import '../../../../bootstrap/bootstrap.server';
|
||||
|
||||
import { FlexBox } from '@lumina/island/atoms/flex-box';
|
||||
import { Card } from '@lumina/island/molecules/card';
|
||||
import { DesktopHeader, DesktopPageTitle } from '@lumina/market/app/navigation';
|
||||
|
|
@ -11,12 +15,10 @@ import type { Metadata } from 'next';
|
|||
|
||||
import { i18n } from '../../../../i18n';
|
||||
|
||||
export function generateMetadata(): Metadata {
|
||||
return {
|
||||
title: i18n.t('terms:meta-title'),
|
||||
description: i18n.t('terms:meta-description'),
|
||||
};
|
||||
}
|
||||
export const metadata: Metadata = {
|
||||
title: i18n.t('terms:meta-title'),
|
||||
description: i18n.t('terms:meta-description'),
|
||||
};
|
||||
|
||||
/**
|
||||
* «شرایط اشتراک» on desktop (S5 ۲.۱): the text in a panel of the 640 column under the header,
|
||||
|
|
|
|||
|
|
@ -1,3 +1,11 @@
|
|||
'use client';
|
||||
|
||||
export { PageError as default } from '@lumina/market/app/screens/organisms/page-error';
|
||||
import { PageError } from '@lumina/market/app/screens/organisms/page-error';
|
||||
import type { PageErrorProps } from '@lumina/market/app/screens/organisms/page-error';
|
||||
|
||||
/** A failed page of this group on desktop: the header over the state in the 640 column. */
|
||||
export default function GroupError(
|
||||
props: Pick<PageErrorProps, 'error' | 'retry'>,
|
||||
) {
|
||||
return <PageError {...props} layout="desktop" standalone />;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,3 +1,7 @@
|
|||
// First: the static `metadata` below reads a server-only namespace, which the server bootstrap
|
||||
// adds to i18n when this module loads, whichever module Next loads first (0055).
|
||||
import '../../bootstrap/bootstrap.server';
|
||||
|
||||
import { Element } from '@lumina/island/primitives/element';
|
||||
import { LandingRedirect } from '@lumina/market/app/guards/landing-redirect';
|
||||
import { faqEntries } from '@lumina/market/app/screens/(landing)/organisms/landing-faq';
|
||||
|
|
@ -22,12 +26,10 @@ import { i18n } from '../../i18n';
|
|||
export const dynamic = 'force-static';
|
||||
export const revalidate = 600;
|
||||
|
||||
export function generateMetadata(): Metadata {
|
||||
return landingMetadata({
|
||||
title: i18n.t('landing:meta.title'),
|
||||
description: i18n.t('landing:hero.lead'),
|
||||
});
|
||||
}
|
||||
export const metadata: Metadata = landingMetadata({
|
||||
title: i18n.t('landing:meta.title'),
|
||||
description: i18n.t('landing:hero.lead'),
|
||||
});
|
||||
|
||||
/**
|
||||
* The landing, `/`: what Lumina is, for a signed-out visitor, and the way to registration. A
|
||||
|
|
|
|||
|
|
@ -0,0 +1,26 @@
|
|||
import { AuthGuard } from '@lumina/market/app/guards/auth-guard';
|
||||
import {
|
||||
PostComposerDialog,
|
||||
PostComposerDialogSkeleton,
|
||||
} from '@lumina/market/app/screens/(flow)/compose/post/organisms/post-composer';
|
||||
import { POST_ID_PATTERN } from '@lumina/market/features/post';
|
||||
import { notFound } from 'next/navigation';
|
||||
|
||||
type EditPostDialogProps = { params: Promise<{ id: string }> };
|
||||
|
||||
/**
|
||||
* Editing a post opened from a main page (J08-4-D, 0023): the 640px «ویرایش پست» dialog over that
|
||||
* page, the URL /compose/post/:id; a direct load of that URL gets the full page instead. In the
|
||||
* browser only: the dialog's skeleton until the viewer and the post are known, then the composer
|
||||
* for the post's creator, or why it can't be edited.
|
||||
*/
|
||||
export default async function EditPostDialog({ params }: EditPostDialogProps) {
|
||||
const { id } = await params;
|
||||
// The API answers a malformed id with a 500, not a 404.
|
||||
if (!POST_ID_PATTERN.test(id)) notFound();
|
||||
return (
|
||||
<AuthGuard fallback={<PostComposerDialogSkeleton edit />}>
|
||||
<PostComposerDialog postId={id} />
|
||||
</AuthGuard>
|
||||
);
|
||||
}
|
||||
|
|
@ -0,0 +1,19 @@
|
|||
import { AuthGuard } from '@lumina/market/app/guards/auth-guard';
|
||||
import {
|
||||
PredictionComposerDialog,
|
||||
PredictionComposerDialogSkeleton,
|
||||
} from '@lumina/market/app/screens/(flow)/compose/prediction/organisms/prediction-composer';
|
||||
|
||||
/**
|
||||
* «پیشبینی جدید» opened from a main page (J09-1-D, 0023): the 960px composer dialog over that
|
||||
* page, the URL /compose/prediction; a direct load of that URL gets the full page instead. In the
|
||||
* browser only: the dialog's skeleton until the viewer is known, then the composer for a creator
|
||||
* who may publish, why not for one who may not, or the no-access state for anyone else.
|
||||
*/
|
||||
export default function ComposePredictionDialog() {
|
||||
return (
|
||||
<AuthGuard fallback={<PredictionComposerDialogSkeleton />}>
|
||||
<PredictionComposerDialog />
|
||||
</AuthGuard>
|
||||
);
|
||||
}
|
||||
|
|
@ -0,0 +1,25 @@
|
|||
import { FlexBox } from '@lumina/island/atoms/flex-box';
|
||||
import { DesktopPageTitle, ROUTES } from '@lumina/market/app/navigation';
|
||||
import { InstallAppSkeleton } from '@lumina/market/app/screens/(main)/account/install/organisms/install-app';
|
||||
|
||||
import { i18n } from '../../../../i18n';
|
||||
|
||||
/** نصب اپلیکیشن before it arrives, in its column. */
|
||||
export default function Loading() {
|
||||
return (
|
||||
<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('account:install.title')}
|
||||
parentHref={ROUTES.account.root}
|
||||
backToPrevious
|
||||
/>
|
||||
<InstallAppSkeleton
|
||||
layout="desktop"
|
||||
delayed
|
||||
label={i18n.t('account:install.loading')}
|
||||
/>
|
||||
</FlexBox>
|
||||
</FlexBox>
|
||||
);
|
||||
}
|
||||
|
|
@ -0,0 +1,44 @@
|
|||
import { FlexBox } from '@lumina/island/atoms/flex-box';
|
||||
import { AuthGuard } from '@lumina/market/app/guards/auth-guard';
|
||||
import { DesktopPageTitle, ROUTES } from '@lumina/market/app/navigation';
|
||||
import {
|
||||
InstallApp,
|
||||
InstallAppSkeleton,
|
||||
} from '@lumina/market/app/screens/(main)/account/install/organisms/install-app';
|
||||
import type { Metadata } from 'next';
|
||||
|
||||
import { i18n } from '../../../../i18n';
|
||||
|
||||
export const metadata: Metadata = {
|
||||
title: i18n.t('account:install.title'),
|
||||
robots: { index: false },
|
||||
};
|
||||
|
||||
/**
|
||||
* نصب اپلیکیشن on desktop (J12-4, Chrome and Edge): «بازگشت» to حساب کاربری and the page's name,
|
||||
* then the offer in a panel in the 560 column. What the browser can do is known only in the
|
||||
* browser, so the server sends the skeleton.
|
||||
*/
|
||||
export default function InstallPage() {
|
||||
return (
|
||||
<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('account:install.title')}
|
||||
parentHref={ROUTES.account.root}
|
||||
backToPrevious
|
||||
/>
|
||||
<AuthGuard
|
||||
fallback={
|
||||
<InstallAppSkeleton
|
||||
layout="desktop"
|
||||
label={i18n.t('account:install.loading')}
|
||||
/>
|
||||
}
|
||||
>
|
||||
<InstallApp layout="desktop" />
|
||||
</AuthGuard>
|
||||
</FlexBox>
|
||||
</FlexBox>
|
||||
);
|
||||
}
|
||||
|
|
@ -0,0 +1,21 @@
|
|||
import { FlexBox } from '@lumina/island/atoms/flex-box';
|
||||
import { DesktopPageTitle } from '@lumina/market/app/navigation';
|
||||
import { AccountOverviewSkeleton } from '@lumina/market/app/screens/(main)/account/organisms/account-overview';
|
||||
|
||||
import { i18n } from '../../../i18n';
|
||||
|
||||
/** حساب کاربری before it arrives, in its column. */
|
||||
export default function Loading() {
|
||||
return (
|
||||
<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('account:title')} />
|
||||
<AccountOverviewSkeleton
|
||||
layout="desktop"
|
||||
label={i18n.t('account:loading')}
|
||||
delayed
|
||||
/>
|
||||
</FlexBox>
|
||||
</FlexBox>
|
||||
);
|
||||
}
|
||||
|
|
@ -0,0 +1,24 @@
|
|||
import { FlexBox } from '@lumina/island/atoms/flex-box';
|
||||
import { DesktopPageTitle, ROUTES } from '@lumina/market/app/navigation';
|
||||
import { NotificationSettingsSkeleton } from '@lumina/market/app/screens/(main)/account/notifications/organisms/notification-settings';
|
||||
|
||||
import { i18n } from '../../../../i18n';
|
||||
|
||||
/** تنظیمات اعلانها before it arrives, in its column. */
|
||||
export default function Loading() {
|
||||
return (
|
||||
<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('account:notifications.title')}
|
||||
parentHref={ROUTES.account.root}
|
||||
/>
|
||||
<NotificationSettingsSkeleton
|
||||
layout="desktop"
|
||||
label={i18n.t('account:notifications.loading')}
|
||||
delayed
|
||||
/>
|
||||
</FlexBox>
|
||||
</FlexBox>
|
||||
);
|
||||
}
|
||||
|
|
@ -0,0 +1,53 @@
|
|||
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 { DesktopPageTitle, ROUTES } from '@lumina/market/app/navigation';
|
||||
import {
|
||||
NotificationSettings,
|
||||
NotificationSettingsSkeleton,
|
||||
} from '@lumina/market/app/screens/(main)/account/notifications/organisms/notification-settings';
|
||||
import type { Metadata } from 'next';
|
||||
import { Suspense } from 'react';
|
||||
|
||||
import { i18n } from '../../../../i18n';
|
||||
|
||||
export const metadata: Metadata = {
|
||||
title: i18n.t('account:notifications.title'),
|
||||
robots: { index: false },
|
||||
};
|
||||
|
||||
/**
|
||||
* تنظیمات اعلانها on desktop (J12-3 D), from the account menu or حساب کاربری: «بازگشت» (to حساب
|
||||
* کاربری when opened on its own), the title and the switches in the 560 column, in the browser
|
||||
* only, behind cards of the same size.
|
||||
*/
|
||||
export default function NotificationSettingsPage() {
|
||||
const skeleton = (
|
||||
<NotificationSettingsSkeleton
|
||||
layout="desktop"
|
||||
label={i18n.t('account:notifications.loading')}
|
||||
/>
|
||||
);
|
||||
|
||||
return (
|
||||
<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('account:notifications.title')}
|
||||
parentHref={ROUTES.account.root}
|
||||
/>
|
||||
<PartBoundary
|
||||
name="notification-settings"
|
||||
description={i18n.t('account:notifications.error')}
|
||||
framed
|
||||
>
|
||||
<AuthGuard fallback={skeleton}>
|
||||
<Suspense fallback={skeleton}>
|
||||
<NotificationSettings layout="desktop" />
|
||||
</Suspense>
|
||||
</AuthGuard>
|
||||
</PartBoundary>
|
||||
</FlexBox>
|
||||
</FlexBox>
|
||||
);
|
||||
}
|
||||
|
|
@ -0,0 +1,46 @@
|
|||
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 { DesktopPageTitle } from '@lumina/market/app/navigation';
|
||||
import {
|
||||
AccountOverview,
|
||||
AccountOverviewSkeleton,
|
||||
} from '@lumina/market/app/screens/(main)/account/organisms/account-overview';
|
||||
import type { Metadata } from 'next';
|
||||
|
||||
import { i18n } from '../../../i18n';
|
||||
|
||||
export const metadata: Metadata = {
|
||||
title: i18n.t('account:title'),
|
||||
robots: { index: false },
|
||||
};
|
||||
|
||||
/**
|
||||
* حساب کاربری on desktop (J12-1 D), the account menu's first item: «بازگشت», the title, and the
|
||||
* member's own account in the 560 column, in the browser only, behind a skeleton of the same size.
|
||||
*/
|
||||
export default function AccountPage() {
|
||||
return (
|
||||
<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('account:title')} />
|
||||
<PartBoundary
|
||||
name="account-overview"
|
||||
description={i18n.t('account:error')}
|
||||
framed
|
||||
>
|
||||
<AuthGuard
|
||||
fallback={
|
||||
<AccountOverviewSkeleton
|
||||
layout="desktop"
|
||||
label={i18n.t('account:loading')}
|
||||
/>
|
||||
}
|
||||
>
|
||||
<AccountOverview layout="desktop" />
|
||||
</AuthGuard>
|
||||
</PartBoundary>
|
||||
</FlexBox>
|
||||
</FlexBox>
|
||||
);
|
||||
}
|
||||
|
|
@ -0,0 +1,19 @@
|
|||
import { AnalystListSkeleton } from '@lumina/market/app/screens/(main)/organisms/analyst-list';
|
||||
|
||||
import { i18n } from '../../../i18n';
|
||||
import { AnalystsTemplate } from './templates/analysts-template';
|
||||
|
||||
/** «تحلیلگران منتخب» before it arrives: its frame, then analyst cards of the same size. */
|
||||
export default function Loading() {
|
||||
return (
|
||||
<AnalystsTemplate>
|
||||
<AnalystListSkeleton
|
||||
layout="desktop"
|
||||
columns={3}
|
||||
count={3}
|
||||
delayed
|
||||
label={i18n.t('home:analysts.loading')}
|
||||
/>
|
||||
</AnalystsTemplate>
|
||||
);
|
||||
}
|
||||
|
|
@ -0,0 +1,30 @@
|
|||
import { AnalystsDirectory } from '@lumina/market/app/screens/(main)/analysts/organisms/analysts-directory';
|
||||
import { getFeaturedCreators, readOnServer } from '@lumina/market/server';
|
||||
import type { Metadata } from 'next';
|
||||
|
||||
import { i18n } from '../../../i18n';
|
||||
import { AnalystsTemplate } from './templates/analysts-template';
|
||||
|
||||
export const metadata: Metadata = {
|
||||
title: i18n.t('home:analysts.title'),
|
||||
robots: { index: false },
|
||||
};
|
||||
|
||||
/**
|
||||
* «تحلیلگران منتخب», `/analysts` (J04-3): every featured analyst, read on the server, the same for
|
||||
* every visitor; follow (an investor) and the free registration card (a guest) join in the
|
||||
* browser. Signed-in visitors are not sent anywhere. A failed read is the page's error state with
|
||||
* its retry, never a partial list.
|
||||
*/
|
||||
export default async function AnalystsPage() {
|
||||
const featured = await readOnServer(() => getFeaturedCreators());
|
||||
|
||||
return (
|
||||
<AnalystsTemplate>
|
||||
<AnalystsDirectory
|
||||
analysts={featured.status === 'ok' ? featured.data : []}
|
||||
layout="desktop"
|
||||
/>
|
||||
</AnalystsTemplate>
|
||||
);
|
||||
}
|
||||
|
|
@ -0,0 +1,23 @@
|
|||
import { FlexBox } from '@lumina/island/atoms/flex-box';
|
||||
import { PageHeader } from '@lumina/island/molecules/page-header';
|
||||
import { DeskBack } from '@lumina/market/app/navigation';
|
||||
|
||||
import { i18n } from '../../../../../i18n';
|
||||
import type { AnalystsTemplateProps } from './types';
|
||||
|
||||
/**
|
||||
* «تحلیلگران منتخب» on desktop, shared by the page and its loading: the wide column under the
|
||||
* header, «بازگشت» (R14; to خانه, or the landing for a guest opened on its own), the title, then the
|
||||
* analysts three by three (J04-3).
|
||||
*/
|
||||
export function AnalystsTemplate({ children }: AnalystsTemplateProps) {
|
||||
return (
|
||||
<FlexBox tag="main" justifyContent="justify-center" className="px-8 py-10">
|
||||
<FlexBox direction="flex-col" gap="gap-5" className="w-full max-w-wide">
|
||||
<DeskBack />
|
||||
<PageHeader title={i18n.t('home:analysts.title')} />
|
||||
{children}
|
||||
</FlexBox>
|
||||
</FlexBox>
|
||||
);
|
||||
}
|
||||
|
|
@ -0,0 +1,2 @@
|
|||
export { AnalystsTemplate } from './AnalystsTemplate';
|
||||
export type { AnalystsTemplateProps } from './types';
|
||||
|
|
@ -0,0 +1,6 @@
|
|||
import type { ReactNode } from 'react';
|
||||
|
||||
export type AnalystsTemplateProps = {
|
||||
/** The featured analysts, or their skeleton. */
|
||||
children: ReactNode;
|
||||
};
|
||||
|
|
@ -1,10 +1,14 @@
|
|||
import { FlexBox } from '@lumina/island/atoms/flex-box';
|
||||
import { Card } from '@lumina/island/molecules/card';
|
||||
import { SkeletonPreset } from '@lumina/island/organisms/skeleton-preset';
|
||||
import { DeskBack } from '@lumina/market/app/navigation';
|
||||
|
||||
import { i18n } from '../../../../i18n';
|
||||
|
||||
/** The channel before it arrives: the header panel, then a post, in the 640 column. */
|
||||
/**
|
||||
* The channel before it arrives, in the 640 column and its reading order: «بازگشت», the header
|
||||
* panel, the track record, then a post.
|
||||
*/
|
||||
export default function Loading() {
|
||||
const t = i18n.getFixedT(null, 'channel');
|
||||
return (
|
||||
|
|
@ -14,9 +18,11 @@ export default function Loading() {
|
|||
gap="gap-4"
|
||||
className="w-full max-w-content"
|
||||
>
|
||||
<DeskBack />
|
||||
<Card padding="lg">
|
||||
<SkeletonPreset preset="header" framed delayed label={t('loading')} />
|
||||
</Card>
|
||||
<SkeletonPreset preset="stats" delayed label={t('stats.loading')} />
|
||||
<SkeletonPreset preset="post-media" delayed label={t('feed.loading')} />
|
||||
</FlexBox>
|
||||
</FlexBox>
|
||||
|
|
|
|||
|
|
@ -15,6 +15,9 @@ import { ChannelTemplate } from './templates/channel-template';
|
|||
|
||||
type ChannelPageProps = { params: Promise<{ username: string }> };
|
||||
|
||||
// The one kind of route whose metadata names its data (0055): it reads through the same per-request
|
||||
// cache as the page, so the first byte, held for the metadata in <head> (0054), waits for that
|
||||
// one read.
|
||||
export async function generateMetadata({
|
||||
params,
|
||||
}: ChannelPageProps): Promise<Metadata> {
|
||||
|
|
|
|||
|
|
@ -2,12 +2,14 @@ import { FlexBox } from '@lumina/island/atoms/flex-box';
|
|||
import { Skeleton, SkeletonRegion } from '@lumina/island/atoms/skeleton';
|
||||
import { Card } from '@lumina/island/molecules/card';
|
||||
import { SkeletonPreset } from '@lumina/island/organisms/skeleton-preset';
|
||||
import { DeskBack } from '@lumina/market/app/navigation';
|
||||
|
||||
import { i18n } from '../../../../../../i18n';
|
||||
|
||||
/**
|
||||
* The post before it arrives, in the 640 column (C4b ۱.۵): the channel bar's panel with the author
|
||||
* row and the subscribe and follow row, then the post with its media. No lock is guessed meanwhile.
|
||||
* The post before it arrives, in the 640 column (C4b ۱.۵): «بازگشت», the channel bar's panel
|
||||
* with the author row and the subscribe and follow row, then the post with its media. No lock is
|
||||
* guessed meanwhile.
|
||||
*/
|
||||
export default function Loading() {
|
||||
const t = i18n.getFixedT(null, 'channel');
|
||||
|
|
@ -18,6 +20,7 @@ export default function Loading() {
|
|||
gap="gap-4"
|
||||
className="w-full max-w-content"
|
||||
>
|
||||
<DeskBack />
|
||||
<Card padding="lg">
|
||||
<SkeletonRegion delayed label={t('loading')}>
|
||||
<FlexBox
|
||||
|
|
|
|||
|
|
@ -33,6 +33,9 @@ async function readPostPage(username: string, id: string) {
|
|||
return { channel: channel.data, post: found };
|
||||
}
|
||||
|
||||
// The one kind of route whose metadata names its data (0055): it reads through the same per-request
|
||||
// cache as the page, so the first byte, held for the metadata in <head> (0054), waits for that
|
||||
// one read.
|
||||
export async function generateMetadata({
|
||||
params,
|
||||
}: PostPageProps): Promise<Metadata> {
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
import { FlexBox } from '@lumina/island/atoms/flex-box';
|
||||
import { PartBoundary } from '@lumina/market/app/error-boundaries';
|
||||
import { DeskBack, ROUTES } from '@lumina/market/app/navigation';
|
||||
import { ChannelActions } from '@lumina/market/app/screens/(main)/channels/[username]/organisms/channel-actions';
|
||||
import { ChannelUnavailable } from '@lumina/market/app/screens/(main)/channels/[username]/organisms/channel-unavailable';
|
||||
import { PostChannelBar } from '@lumina/market/app/screens/(main)/channels/[username]/posts/[id]/organisms/post-channel-bar';
|
||||
|
|
@ -10,8 +11,8 @@ import { i18n } from '../../../../../../../../i18n';
|
|||
import type { PostTemplateProps } from './types';
|
||||
|
||||
/**
|
||||
* The post on desktop, in the 640 column: the creator with subscribe and follow, then the post in
|
||||
* full. The action area loads in the browser.
|
||||
* The post on desktop, in the 640 column under «بازگشت»: the creator with subscribe and follow,
|
||||
* then the post in full. The action area loads in the browser.
|
||||
*/
|
||||
export function PostTemplate({
|
||||
channel,
|
||||
|
|
@ -28,6 +29,11 @@ export function PostTemplate({
|
|||
gap="gap-4"
|
||||
className="w-full max-w-content"
|
||||
>
|
||||
{/* A link opened on its own goes back to the post's channel (R14). */}
|
||||
<DeskBack
|
||||
parentHref={ROUTES.channel(channel.username)}
|
||||
backToPrevious
|
||||
/>
|
||||
{channel.suspended ? (
|
||||
<ChannelUnavailable context="post" />
|
||||
) : post ? (
|
||||
|
|
@ -50,6 +56,7 @@ export function PostTemplate({
|
|||
<PostView
|
||||
post={post}
|
||||
username={channel.username}
|
||||
displayName={channel.displayName}
|
||||
avatarUrl={channel.avatarUrl}
|
||||
now={now}
|
||||
layout="desktop"
|
||||
|
|
|
|||
|
|
@ -2,6 +2,7 @@ import { FlexBox } from '@lumina/island/atoms/flex-box';
|
|||
import { SkeletonPreset } from '@lumina/island/organisms/skeleton-preset';
|
||||
import { PartBoundary } from '@lumina/market/app/error-boundaries';
|
||||
import { ChannelActions } from '@lumina/market/app/screens/(main)/channels/[username]/organisms/channel-actions';
|
||||
import { ChannelDeskBack } from '@lumina/market/app/screens/(main)/channels/[username]/organisms/channel-desk-back';
|
||||
import { ChannelFeed } from '@lumina/market/app/screens/(main)/channels/[username]/organisms/channel-feed/server';
|
||||
import {
|
||||
ChannelHeader,
|
||||
|
|
@ -10,6 +11,7 @@ import {
|
|||
import { ChannelShare } from '@lumina/market/app/screens/(main)/channels/[username]/organisms/channel-share';
|
||||
import { ChannelStats } from '@lumina/market/app/screens/(main)/channels/[username]/organisms/channel-stats/server';
|
||||
import { ChannelUnavailable } from '@lumina/market/app/screens/(main)/channels/[username]/organisms/channel-unavailable';
|
||||
import { FollowNotice } from '@lumina/market/app/screens/(main)/channels/[username]/organisms/follow-notice';
|
||||
import { creatorStatsLabels } from '@lumina/market/shared/labels';
|
||||
import { Suspense } from 'react';
|
||||
|
||||
|
|
@ -17,9 +19,10 @@ import { i18n } from '../../../../../../i18n';
|
|||
import type { ChannelTemplateProps } from './types';
|
||||
|
||||
/**
|
||||
* The channel on desktop: one 640px column, no side rail. The header panel renders at once; the
|
||||
* track record and the feed stream in reading order, each in its own boundary, and the action
|
||||
* area loads in the browser.
|
||||
* The channel on desktop: one 640px column, no side rail, under «بازگشت» (R14; none on the
|
||||
* creator's own tab). The header panel renders at once; the first follow's notice and the track
|
||||
* record follow it, then the feed, streaming in reading order, each in its own boundary, and the
|
||||
* action area loads in the browser.
|
||||
*/
|
||||
export function ChannelTemplate({
|
||||
channel,
|
||||
|
|
@ -36,7 +39,12 @@ export function ChannelTemplate({
|
|||
justifyContent="justify-center"
|
||||
className="px-8 py-10"
|
||||
>
|
||||
<FlexBox direction="flex-col" className="w-full max-w-content">
|
||||
<FlexBox
|
||||
direction="flex-col"
|
||||
gap="gap-4"
|
||||
className="w-full max-w-content"
|
||||
>
|
||||
<ChannelDeskBack creatorId={channel.creatorId} />
|
||||
<ChannelUnavailable
|
||||
context="channel"
|
||||
channel={channel}
|
||||
|
|
@ -55,9 +63,9 @@ export function ChannelTemplate({
|
|||
gap="gap-4"
|
||||
className="w-full max-w-content"
|
||||
>
|
||||
<ChannelDeskBack creatorId={channel.creatorId} />
|
||||
<ChannelHeader
|
||||
channel={channel}
|
||||
channelUrl={channelUrl}
|
||||
layout="desktop"
|
||||
share={
|
||||
<ChannelShare
|
||||
|
|
@ -68,23 +76,26 @@ export function ChannelTemplate({
|
|||
/>
|
||||
}
|
||||
stats={
|
||||
<PartBoundary
|
||||
name="channel-stats"
|
||||
title={t('stats.error-title')}
|
||||
description={t('stats.error-description')}
|
||||
framed
|
||||
>
|
||||
<Suspense
|
||||
fallback={
|
||||
<SkeletonPreset preset="stats" label={t('stats.loading')} />
|
||||
}
|
||||
<>
|
||||
<FollowNotice creatorId={channel.creatorId} />
|
||||
<PartBoundary
|
||||
name="channel-stats"
|
||||
title={t('stats.error-title')}
|
||||
description={t('stats.error-description')}
|
||||
framed
|
||||
>
|
||||
<ChannelStats
|
||||
creatorId={channel.creatorId}
|
||||
labels={creatorStatsLabels(i18n.getFixedT(null, 'content'))}
|
||||
/>
|
||||
</Suspense>
|
||||
</PartBoundary>
|
||||
<Suspense
|
||||
fallback={
|
||||
<SkeletonPreset preset="stats" label={t('stats.loading')} />
|
||||
}
|
||||
>
|
||||
<ChannelStats
|
||||
creatorId={channel.creatorId}
|
||||
labels={creatorStatsLabels(i18n.getFixedT(null, 'content'))}
|
||||
/>
|
||||
</Suspense>
|
||||
</PartBoundary>
|
||||
</>
|
||||
}
|
||||
actions={
|
||||
<PartBoundary name="channel-actions">
|
||||
|
|
|
|||
|
|
@ -2,15 +2,26 @@ 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 { PayoutScheduleNotice } from '@lumina/market/app/screens/(main)/dashboard/finance/organisms/payout-schedule-notice';
|
||||
import { PAYOUT_WEEKDAY } from '@lumina/market/shared/constants';
|
||||
|
||||
import { i18n } from '../../../../../i18n';
|
||||
|
||||
/** مالی before it arrives, block for block; the layout keeps the bar and the tabs. */
|
||||
/**
|
||||
* مالی before it arrives, block for block, 16px apart: the payout-day notice is static, so it is
|
||||
* already in place and the skeletons never jump under it. The layout keeps the bar and the tabs.
|
||||
*/
|
||||
export default function Loading() {
|
||||
return (
|
||||
<FlexBox direction="flex-col" gap="gap-3">
|
||||
<FlexBox direction="flex-col" gap="gap-4">
|
||||
<PayoutScheduleNotice
|
||||
labels={{
|
||||
before: i18n.t('finance:notice.before'),
|
||||
day: i18n.t(`finance:weekdays.${PAYOUT_WEEKDAY}`),
|
||||
after: i18n.t('finance:notice.after'),
|
||||
}}
|
||||
/>
|
||||
<BalanceSummarySkeleton
|
||||
layout="desktop"
|
||||
label={i18n.t('finance:balance.loading')}
|
||||
delayed
|
||||
/>
|
||||
|
|
|
|||
|
|
@ -3,6 +3,7 @@ import { PartBoundary } from '@lumina/market/app/error-boundaries';
|
|||
import { AuthGuard } from '@lumina/market/app/guards/auth-guard';
|
||||
import {
|
||||
BalanceSummary,
|
||||
BalanceSummaryBoundary,
|
||||
BalanceSummarySkeleton,
|
||||
} from '@lumina/market/app/screens/(main)/dashboard/finance/organisms/balance-summary';
|
||||
import {
|
||||
|
|
@ -20,24 +21,19 @@ import { Suspense } from 'react';
|
|||
|
||||
import { i18n } from '../../../../../i18n';
|
||||
|
||||
export function generateMetadata(): Metadata {
|
||||
return {
|
||||
title: i18n.t('dashboard:finance.meta-title'),
|
||||
robots: { index: false },
|
||||
};
|
||||
}
|
||||
export const metadata: Metadata = {
|
||||
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 ۲.۴).
|
||||
* داشبورد › مالی (brief §4; C19, C20), in this order, 16px apart: 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 ۲.۴; J10-6f).
|
||||
*/
|
||||
export default function FinancePage() {
|
||||
const balanceSkeleton = (
|
||||
<BalanceSummarySkeleton
|
||||
layout="desktop"
|
||||
label={i18n.t('finance:balance.loading')}
|
||||
/>
|
||||
<BalanceSummarySkeleton label={i18n.t('finance:balance.loading')} />
|
||||
);
|
||||
const accountSkeleton = (
|
||||
<PayoutAccountSkeleton
|
||||
|
|
@ -50,7 +46,7 @@ export default function FinancePage() {
|
|||
);
|
||||
|
||||
return (
|
||||
<FlexBox direction="flex-col" gap="gap-3">
|
||||
<FlexBox direction="flex-col" gap="gap-4">
|
||||
<PayoutScheduleNotice
|
||||
labels={{
|
||||
before: i18n.t('finance:notice.before'),
|
||||
|
|
@ -61,23 +57,19 @@ export default function FinancePage() {
|
|||
<AuthGuard
|
||||
role="creator"
|
||||
fallback={
|
||||
<FlexBox direction="flex-col" gap="gap-3">
|
||||
<FlexBox direction="flex-col" gap="gap-4">
|
||||
{balanceSkeleton}
|
||||
{accountSkeleton}
|
||||
{ledgerSkeleton}
|
||||
</FlexBox>
|
||||
}
|
||||
>
|
||||
<FlexBox direction="flex-col" gap="gap-3">
|
||||
<PartBoundary
|
||||
name="balance-summary"
|
||||
description={i18n.t('finance:balance.error')}
|
||||
framed
|
||||
>
|
||||
<FlexBox direction="flex-col" gap="gap-4">
|
||||
<BalanceSummaryBoundary>
|
||||
<Suspense fallback={balanceSkeleton}>
|
||||
<BalanceSummary layout="desktop" />
|
||||
<BalanceSummary />
|
||||
</Suspense>
|
||||
</PartBoundary>
|
||||
</BalanceSummaryBoundary>
|
||||
<PartBoundary
|
||||
name="payout-account"
|
||||
description={i18n.t('finance:account.error')}
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@ 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
|
||||
* the «داشبورد» heading, the three 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).
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -1,10 +1,11 @@
|
|||
import { FlexBox } from '@lumina/island/atoms/flex-box';
|
||||
import { AudienceStatsSkeleton } from '@lumina/market/app/screens/(main)/dashboard/plans/organisms/audience-stats';
|
||||
import { InviteCodeCardSkeleton } from '@lumina/market/app/screens/(main)/dashboard/plans/organisms/invite-code-card';
|
||||
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. */
|
||||
/** طرحهای اشتراک 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-4">
|
||||
|
|
@ -13,9 +14,13 @@ export default function Loading() {
|
|||
label={i18n.t('pricing:card.loading')}
|
||||
delayed
|
||||
/>
|
||||
<SubscriberListSkeleton
|
||||
<InviteCodeCardSkeleton
|
||||
layout="desktop"
|
||||
label={i18n.t('dashboard:subscribers.loading')}
|
||||
label={i18n.t('dashboard:invite.loading')}
|
||||
delayed
|
||||
/>
|
||||
<AudienceStatsSkeleton
|
||||
label={i18n.t('dashboard:audience.loading')}
|
||||
delayed
|
||||
/>
|
||||
</FlexBox>
|
||||
|
|
|
|||
|
|
@ -1,29 +1,32 @@
|
|||
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 {
|
||||
AudienceStats,
|
||||
AudienceStatsSkeleton,
|
||||
} from '@lumina/market/app/screens/(main)/dashboard/plans/organisms/audience-stats';
|
||||
import {
|
||||
InviteCodeCard,
|
||||
InviteCodeCardSkeleton,
|
||||
} from '@lumina/market/app/screens/(main)/dashboard/plans/organisms/invite-code-card';
|
||||
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 { clientEnv } from '../../../../../env';
|
||||
import { i18n } from '../../../../../i18n';
|
||||
|
||||
export function generateMetadata(): Metadata {
|
||||
return {
|
||||
title: i18n.t('dashboard:plans.meta-title'),
|
||||
robots: { index: false },
|
||||
};
|
||||
}
|
||||
export const metadata: Metadata = {
|
||||
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.
|
||||
* داشبورد › طرحهای اشتراک (J10-1): «قیمت طرحها», «کد دعوت» (only once approved) and «مخاطبان»,
|
||||
* the creator's own, in the browser only. Each block loads and fails on its own; the tabs stay.
|
||||
*/
|
||||
export default function PlansPage() {
|
||||
const pricingSkeleton = (
|
||||
|
|
@ -32,12 +35,15 @@ export default function PlansPage() {
|
|||
label={i18n.t('pricing:card.loading')}
|
||||
/>
|
||||
);
|
||||
const subscribersSkeleton = (
|
||||
<SubscriberListSkeleton
|
||||
const inviteSkeleton = (
|
||||
<InviteCodeCardSkeleton
|
||||
layout="desktop"
|
||||
label={i18n.t('dashboard:subscribers.loading')}
|
||||
label={i18n.t('dashboard:invite.loading')}
|
||||
/>
|
||||
);
|
||||
const audienceSkeleton = (
|
||||
<AudienceStatsSkeleton label={i18n.t('dashboard:audience.loading')} />
|
||||
);
|
||||
|
||||
return (
|
||||
<AuthGuard
|
||||
|
|
@ -45,7 +51,8 @@ export default function PlansPage() {
|
|||
fallback={
|
||||
<FlexBox direction="flex-col" gap="gap-4">
|
||||
{pricingSkeleton}
|
||||
{subscribersSkeleton}
|
||||
{inviteSkeleton}
|
||||
{audienceSkeleton}
|
||||
</FlexBox>
|
||||
}
|
||||
>
|
||||
|
|
@ -60,12 +67,24 @@ export default function PlansPage() {
|
|||
</Suspense>
|
||||
</PartBoundary>
|
||||
<PartBoundary
|
||||
name="subscriber-list"
|
||||
description={i18n.t('dashboard:subscribers.error')}
|
||||
name="invite-code-card"
|
||||
description={i18n.t('dashboard:invite.error')}
|
||||
framed
|
||||
>
|
||||
<Suspense fallback={subscribersSkeleton}>
|
||||
<SubscriberList layout="desktop" />
|
||||
<Suspense fallback={inviteSkeleton}>
|
||||
<InviteCodeCard
|
||||
layout="desktop"
|
||||
siteUrl={clientEnv.NEXT_PUBLIC_SITE_URL}
|
||||
/>
|
||||
</Suspense>
|
||||
</PartBoundary>
|
||||
<PartBoundary
|
||||
name="audience-stats"
|
||||
description={i18n.t('dashboard:audience.error')}
|
||||
framed
|
||||
>
|
||||
<Suspense fallback={audienceSkeleton}>
|
||||
<AudienceStats />
|
||||
</Suspense>
|
||||
</PartBoundary>
|
||||
</FlexBox>
|
||||
|
|
|
|||
|
|
@ -0,0 +1,10 @@
|
|||
import { PredictionsTabSkeleton } from '@lumina/market/app/screens/(main)/dashboard/predictions/organisms/predictions-tab';
|
||||
|
||||
import { i18n } from '../../../../../i18n';
|
||||
|
||||
/** پیشبینیها before it arrives, block for block; the layout keeps the bar and the tabs. */
|
||||
export default function Loading() {
|
||||
return (
|
||||
<PredictionsTabSkeleton label={i18n.t('predictions:tab.loading')} delayed />
|
||||
);
|
||||
}
|
||||
|
|
@ -0,0 +1,30 @@
|
|||
import { AuthGuard } from '@lumina/market/app/guards/auth-guard';
|
||||
import {
|
||||
PredictionsTab,
|
||||
PredictionsTabSkeleton,
|
||||
} from '@lumina/market/app/screens/(main)/dashboard/predictions/organisms/predictions-tab';
|
||||
import type { Metadata } from 'next';
|
||||
|
||||
import { i18n } from '../../../../../i18n';
|
||||
|
||||
export const metadata: Metadata = {
|
||||
title: i18n.t('predictions:tab.meta-title'),
|
||||
robots: { index: false },
|
||||
};
|
||||
|
||||
/**
|
||||
* داشبورد › پیشبینیها (J10-3): the creator's record, open and recently closed predictions, in the
|
||||
* browser only. Each block loads and fails on its own; the tabs stay.
|
||||
*/
|
||||
export default function PredictionsPage() {
|
||||
return (
|
||||
<AuthGuard
|
||||
role="creator"
|
||||
fallback={
|
||||
<PredictionsTabSkeleton label={i18n.t('predictions:tab.loading')} />
|
||||
}
|
||||
>
|
||||
<PredictionsTab layout="desktop" />
|
||||
</AuthGuard>
|
||||
);
|
||||
}
|
||||
|
|
@ -7,7 +7,6 @@ export default function Loading() {
|
|||
return (
|
||||
<SkeletonPreset
|
||||
preset="list"
|
||||
cards="lg"
|
||||
delayed
|
||||
label={i18n.t('dashboard:following.loading')}
|
||||
/>
|
||||
|
|
|
|||
|
|
@ -7,12 +7,10 @@ import { Suspense } from 'react';
|
|||
|
||||
import { i18n } from '../../../../../i18n';
|
||||
|
||||
export function generateMetadata(): Metadata {
|
||||
return {
|
||||
title: i18n.t('dashboard:following.meta-title'),
|
||||
robots: { index: false },
|
||||
};
|
||||
}
|
||||
export const metadata: Metadata = {
|
||||
title: i18n.t('dashboard:following.meta-title'),
|
||||
robots: { index: false },
|
||||
};
|
||||
|
||||
/**
|
||||
* داشبورد › دنبالشدهها (U8 ۶.۱): the investor's own list, in the browser only, behind rows of the
|
||||
|
|
@ -22,7 +20,6 @@ export default function FollowingPage() {
|
|||
const skeleton = (
|
||||
<SkeletonPreset
|
||||
preset="list"
|
||||
cards="lg"
|
||||
label={i18n.t('dashboard:following.loading')}
|
||||
/>
|
||||
);
|
||||
|
|
|
|||
|
|
@ -7,12 +7,10 @@ import { Suspense } from 'react';
|
|||
|
||||
import { i18n } from '../../../../../i18n';
|
||||
|
||||
export function generateMetadata(): Metadata {
|
||||
return {
|
||||
title: i18n.t('dashboard:subscriptions.meta-title'),
|
||||
robots: { index: false },
|
||||
};
|
||||
}
|
||||
export const metadata: Metadata = {
|
||||
title: i18n.t('dashboard:subscriptions.meta-title'),
|
||||
robots: { index: false },
|
||||
};
|
||||
|
||||
/**
|
||||
* داشبورد › اشتراکها (U2, U11): the investor's own subscriptions, in the browser only, behind
|
||||
|
|
|
|||
|
|
@ -7,7 +7,6 @@ export default function Loading() {
|
|||
return (
|
||||
<SkeletonPreset
|
||||
preset="list"
|
||||
cards="lg"
|
||||
avatar={false}
|
||||
delayed
|
||||
label={i18n.t('dashboard:transactions.loading')}
|
||||
|
|
|
|||
|
|
@ -7,12 +7,10 @@ import { Suspense } from 'react';
|
|||
|
||||
import { i18n } from '../../../../../i18n';
|
||||
|
||||
export function generateMetadata(): Metadata {
|
||||
return {
|
||||
title: i18n.t('dashboard:transactions.meta-title'),
|
||||
robots: { index: false },
|
||||
};
|
||||
}
|
||||
export const metadata: Metadata = {
|
||||
title: i18n.t('dashboard:transactions.meta-title'),
|
||||
robots: { index: false },
|
||||
};
|
||||
|
||||
/**
|
||||
* داشبورد › تراکنشها (U4): the investor's own payments, in the browser only, behind rows of the
|
||||
|
|
@ -22,7 +20,6 @@ export default function TransactionsPage() {
|
|||
const skeleton = (
|
||||
<SkeletonPreset
|
||||
preset="list"
|
||||
cards="lg"
|
||||
avatar={false}
|
||||
label={i18n.t('dashboard:transactions.loading')}
|
||||
/>
|
||||
|
|
|
|||
|
|
@ -0,0 +1,3 @@
|
|||
// Locked until a creator finishes registration step 5 (0016), as the tab is; the guard renders
|
||||
// the page as is.
|
||||
export { OnboardingGuard as default } from '@lumina/market/app/guards/onboarding-guard';
|
||||
|
|
@ -0,0 +1,27 @@
|
|||
import { FlexBox } from '@lumina/island/atoms/flex-box';
|
||||
import { DesktopPageTitle, ROUTES } from '@lumina/market/app/navigation';
|
||||
import { PredictionListSkeleton } from '@lumina/market/app/screens/(main)/dashboard/predictions/all/organisms/prediction-list';
|
||||
|
||||
import { i18n } from '../../../../../i18n';
|
||||
|
||||
/** «همه پیشبینیها» before it arrives, under its real title. */
|
||||
export default function Loading() {
|
||||
return (
|
||||
<FlexBox tag="main" justifyContent="justify-center" className="px-8 py-10">
|
||||
<FlexBox
|
||||
direction="flex-col"
|
||||
gap="gap-4"
|
||||
className="w-full max-w-content"
|
||||
>
|
||||
<DesktopPageTitle
|
||||
title={i18n.t('predictions:list.title')}
|
||||
parentHref={ROUTES.dashboard.predictions}
|
||||
/>
|
||||
<PredictionListSkeleton
|
||||
label={i18n.t('predictions:list.loading')}
|
||||
delayed
|
||||
/>
|
||||
</FlexBox>
|
||||
</FlexBox>
|
||||
);
|
||||
}
|
||||
|
|
@ -0,0 +1,53 @@
|
|||
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 { DesktopPageTitle, ROUTES } from '@lumina/market/app/navigation';
|
||||
import {
|
||||
PredictionList,
|
||||
PredictionListSkeleton,
|
||||
} from '@lumina/market/app/screens/(main)/dashboard/predictions/all/organisms/prediction-list';
|
||||
import type { Metadata } from 'next';
|
||||
import { Suspense } from 'react';
|
||||
|
||||
import { i18n } from '../../../../../i18n';
|
||||
|
||||
export const metadata: Metadata = {
|
||||
title: i18n.t('predictions:list.title'),
|
||||
robots: { index: false },
|
||||
};
|
||||
|
||||
/**
|
||||
* «همه پیشبینیها» on desktop (J10-3f): the same list in the 640 column, «بازگشت» over its title
|
||||
* back to the پیشبینیها tab. The creator's own, in the browser only.
|
||||
*/
|
||||
export default function PredictionListPage() {
|
||||
const skeleton = (
|
||||
<PredictionListSkeleton label={i18n.t('predictions:list.loading')} />
|
||||
);
|
||||
|
||||
return (
|
||||
<FlexBox tag="main" justifyContent="justify-center" className="px-8 py-10">
|
||||
<FlexBox
|
||||
direction="flex-col"
|
||||
gap="gap-4"
|
||||
className="w-full max-w-content"
|
||||
>
|
||||
<DesktopPageTitle
|
||||
title={i18n.t('predictions:list.title')}
|
||||
parentHref={ROUTES.dashboard.predictions}
|
||||
/>
|
||||
<PartBoundary
|
||||
name="prediction-list"
|
||||
description={i18n.t('predictions:list.error')}
|
||||
framed
|
||||
>
|
||||
<AuthGuard role="creator" fallback={skeleton}>
|
||||
<Suspense fallback={skeleton}>
|
||||
<PredictionList layout="desktop" />
|
||||
</Suspense>
|
||||
</AuthGuard>
|
||||
</PartBoundary>
|
||||
</FlexBox>
|
||||
</FlexBox>
|
||||
);
|
||||
}
|
||||
|
|
@ -1,3 +1,11 @@
|
|||
'use client';
|
||||
|
||||
export { PageError as default } from '@lumina/market/app/screens/organisms/page-error';
|
||||
import { PageError } from '@lumina/market/app/screens/organisms/page-error';
|
||||
import type { PageErrorProps } from '@lumina/market/app/screens/organisms/page-error';
|
||||
|
||||
/** A failed main page on desktop: the state in the 640 column; the layout keeps the header. */
|
||||
export default function GroupError(
|
||||
props: Pick<PageErrorProps, 'error' | 'retry'>,
|
||||
) {
|
||||
return <PageError {...props} layout="desktop" />;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@ import { HomeFeedSkeleton } from '@lumina/market/app/screens/(main)/organisms/ho
|
|||
import { i18n } from '../../../i18n';
|
||||
import { HomeTemplate } from './templates/home-template';
|
||||
|
||||
/** خانه before it arrives: the heading, then three post skeletons in the 640 column (S1-03). */
|
||||
/** خانه before it arrives: three post skeletons in the 640 column (S1-03). */
|
||||
export default function Loading() {
|
||||
return (
|
||||
<HomeTemplate>
|
||||
|
|
|
|||
|
|
@ -1,7 +1,5 @@
|
|||
import { PartBoundary } from '@lumina/market/app/error-boundaries';
|
||||
import { ROUTES } from '@lumina/market/app/navigation';
|
||||
import {
|
||||
EXAMPLE_CHANNEL_USERNAME,
|
||||
HomeFeed,
|
||||
HomeFeedSkeleton,
|
||||
HomeGuard,
|
||||
|
|
@ -9,19 +7,21 @@ import {
|
|||
import type { Metadata } from 'next';
|
||||
import { Suspense } from 'react';
|
||||
|
||||
import { displayUrl } from '../../../configs';
|
||||
import { i18n } from '../../../i18n';
|
||||
import { HomeTemplate } from './templates/home-template';
|
||||
|
||||
export function generateMetadata(): Metadata {
|
||||
return { title: i18n.t('home:meta.title'), robots: { index: false } };
|
||||
}
|
||||
export const metadata: Metadata = {
|
||||
title: i18n.t('home:meta.title'),
|
||||
robots: { index: false },
|
||||
};
|
||||
|
||||
/**
|
||||
* خانه, `/feed`: the investor's feed of the creators they follow. The server sends only the frame and
|
||||
* the feed's skeleton, the same for every visitor; the feed loads in the browser with the session.
|
||||
* A guest goes to login, which returns here, and a creator to their own channel. A failed feed
|
||||
* shows in a card in the column, as the desktop boards draw a state there (S3, S2-Desktop).
|
||||
* خانه, `/feed`: the investor's feed of the creators they follow, under the featured analysts' row,
|
||||
* or the featured analysts to follow while they follow nobody (J04-1, J04-2). The server sends
|
||||
* only the frame and the feed's skeleton, the same for every visitor; the feed loads in the
|
||||
* browser with the session. A guest goes to login, which returns here, and a creator to their own
|
||||
* channel. A failed feed shows in a card in the column, as the desktop boards draw a state there
|
||||
* (S3, S2-Desktop).
|
||||
*/
|
||||
export default function HomePage() {
|
||||
const skeleton = (
|
||||
|
|
@ -32,12 +32,7 @@ export default function HomePage() {
|
|||
<PartBoundary name="home-feed" framed>
|
||||
<HomeGuard fallback={skeleton}>
|
||||
<Suspense fallback={skeleton}>
|
||||
<HomeFeed
|
||||
layout="desktop"
|
||||
exampleChannelUrl={displayUrl(
|
||||
ROUTES.channel(EXAMPLE_CHANNEL_USERNAME),
|
||||
)}
|
||||
/>
|
||||
<HomeFeed layout="desktop" />
|
||||
</Suspense>
|
||||
</HomeGuard>
|
||||
</PartBoundary>
|
||||
|
|
|
|||
|
|
@ -1,26 +1,21 @@
|
|||
import { FlexBox } from '@lumina/island/atoms/flex-box';
|
||||
import { Typography } from '@lumina/island/atoms/typography';
|
||||
|
||||
import { i18n } from '../../../../../i18n';
|
||||
import type { HomeTemplateProps } from './types';
|
||||
|
||||
/**
|
||||
* خانه's frame on desktop, shared by the page and its loading: one 640 column under the header,
|
||||
* with no side content (U7 ۶.۱, Main C), the h2 «خانه» at its top as on mobile, then the feed.
|
||||
* The header comes from the main layout, خانه on.
|
||||
* with no side content (U7 ۶.۱, Main C). The empty خانه's featured analysts mark themselves
|
||||
* `data-home-wide`, and the column widens to the wide one for their grid (J04-2). The header comes
|
||||
* from the main layout, خانه on.
|
||||
*/
|
||||
export function HomeTemplate({ children }: HomeTemplateProps) {
|
||||
const t = i18n.getFixedT(null, 'home');
|
||||
return (
|
||||
<FlexBox tag="main" justifyContent="justify-center" className="px-8 py-10">
|
||||
<FlexBox
|
||||
direction="flex-col"
|
||||
gap="gap-4"
|
||||
className="w-full max-w-content"
|
||||
className="w-full max-w-content has-[[data-home-wide]]:max-w-wide"
|
||||
>
|
||||
<Typography tag="h2" variant="heading-sm">
|
||||
{t('heading')}
|
||||
</Typography>
|
||||
{children}
|
||||
</FlexBox>
|
||||
</FlexBox>
|
||||
|
|
|
|||
|
|
@ -9,12 +9,10 @@ import { Suspense } from 'react';
|
|||
|
||||
import { i18n } from '../../../i18n';
|
||||
|
||||
export function generateMetadata(): Metadata {
|
||||
return {
|
||||
title: i18n.t('notifications:title'),
|
||||
robots: { index: false },
|
||||
};
|
||||
}
|
||||
export const metadata: Metadata = {
|
||||
title: i18n.t('notifications:title'),
|
||||
robots: { index: false },
|
||||
};
|
||||
|
||||
/**
|
||||
* اعلانها at its own address on desktop, such as a link opened from elsewhere: the same centre the
|
||||
|
|
|
|||
|
|
@ -0,0 +1,17 @@
|
|||
import { SearchPanelSkeleton } from '@lumina/market/app/screens/(main)/search/organisms/search-panel';
|
||||
|
||||
import { i18n } from '../../../i18n';
|
||||
import { SearchTemplate } from './templates/search-template';
|
||||
|
||||
/** جستجو before it arrives: its frame, the field and the featured analysts' cards. */
|
||||
export default function Loading() {
|
||||
return (
|
||||
<SearchTemplate>
|
||||
<SearchPanelSkeleton
|
||||
layout="desktop"
|
||||
delayed
|
||||
label={i18n.t('home:featured.loading')}
|
||||
/>
|
||||
</SearchTemplate>
|
||||
);
|
||||
}
|
||||
|
|
@ -0,0 +1,41 @@
|
|||
import { PartBoundary } from '@lumina/market/app/error-boundaries';
|
||||
import { AuthGuard } from '@lumina/market/app/guards/auth-guard';
|
||||
import {
|
||||
SearchPanel,
|
||||
SearchPanelSkeleton,
|
||||
} from '@lumina/market/app/screens/(main)/search/organisms/search-panel';
|
||||
import type { Metadata } from 'next';
|
||||
import { Suspense } from 'react';
|
||||
|
||||
import { i18n } from '../../../i18n';
|
||||
import { SearchTemplate } from './templates/search-template';
|
||||
|
||||
export const metadata: Metadata = {
|
||||
title: i18n.t('home:search.title'),
|
||||
robots: { index: false },
|
||||
};
|
||||
|
||||
/**
|
||||
* جستجو, `/search?q=` (J04-4): an investor's analyst search, in the browser only, behind the
|
||||
* panel's skeleton until the viewer is known. A guest goes to login, which returns here; a creator
|
||||
* gets the no-access state.
|
||||
*/
|
||||
export default function SearchPage() {
|
||||
const skeleton = (
|
||||
<SearchPanelSkeleton
|
||||
layout="desktop"
|
||||
label={i18n.t('home:featured.loading')}
|
||||
/>
|
||||
);
|
||||
return (
|
||||
<SearchTemplate>
|
||||
<PartBoundary name="search" framed>
|
||||
<AuthGuard role="investor" fallback={skeleton}>
|
||||
<Suspense fallback={skeleton}>
|
||||
<SearchPanel layout="desktop" />
|
||||
</Suspense>
|
||||
</AuthGuard>
|
||||
</PartBoundary>
|
||||
</SearchTemplate>
|
||||
);
|
||||
}
|
||||
|
|
@ -0,0 +1,22 @@
|
|||
import { FlexBox } from '@lumina/island/atoms/flex-box';
|
||||
import { PageHeader } from '@lumina/island/molecules/page-header';
|
||||
import { DeskBack } from '@lumina/market/app/navigation';
|
||||
|
||||
import { i18n } from '../../../../../i18n';
|
||||
import type { SearchTemplateProps } from './types';
|
||||
|
||||
/**
|
||||
* جستجو's frame on desktop, shared by the page and its loading: the wide column under the header,
|
||||
* «بازگشت» (the header's field opened it, so it is pushed; R14), «جستجو», then the panel (J04-4).
|
||||
*/
|
||||
export function SearchTemplate({ children }: SearchTemplateProps) {
|
||||
return (
|
||||
<FlexBox tag="main" justifyContent="justify-center" className="px-8 py-10">
|
||||
<FlexBox direction="flex-col" gap="gap-5" className="w-full max-w-wide">
|
||||
<DeskBack />
|
||||
<PageHeader title={i18n.t('home:search.title')} size="sm" />
|
||||
{children}
|
||||
</FlexBox>
|
||||
</FlexBox>
|
||||
);
|
||||
}
|
||||
|
|
@ -0,0 +1,2 @@
|
|||
export { SearchTemplate } from './SearchTemplate';
|
||||
export type { SearchTemplateProps } from './types';
|
||||
|
|
@ -0,0 +1,6 @@
|
|||
import type { ReactNode } from 'react';
|
||||
|
||||
export type SearchTemplateProps = {
|
||||
/** The search panel, or its skeleton. */
|
||||
children: ReactNode;
|
||||
};
|
||||
|
|
@ -1,3 +1,11 @@
|
|||
'use client';
|
||||
|
||||
export { PageError as default } from '@lumina/market/app/screens/organisms/page-error';
|
||||
import { PageError } from '@lumina/market/app/screens/organisms/page-error';
|
||||
import type { PageErrorProps } from '@lumina/market/app/screens/organisms/page-error';
|
||||
|
||||
/** A failed page of this group on desktop: the header over the state in the 640 column. */
|
||||
export default function GroupError(
|
||||
props: Pick<PageErrorProps, 'error' | 'retry'>,
|
||||
) {
|
||||
return <PageError {...props} layout="desktop" standalone />;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -10,12 +10,10 @@ 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.meta-title'),
|
||||
robots: { index: false },
|
||||
};
|
||||
}
|
||||
export const metadata: Metadata = {
|
||||
title: i18n.t('auth:register.profile.meta-title'),
|
||||
robots: { index: false },
|
||||
};
|
||||
|
||||
/**
|
||||
* Registration step 5 for a creator, on the session: the form card beside its live preview. The
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@ 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 (
|
||||
<AuthTemplate brandHref={ROUTES.home} width="wide">
|
||||
<AuthTemplate brandHref={ROUTES.home}>
|
||||
<CreatorProfileDoneStepSkeleton label={i18n.t('auth:loading')} />
|
||||
</AuthTemplate>
|
||||
);
|
||||
|
|
|
|||
|
|
@ -10,12 +10,10 @@ 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 },
|
||||
};
|
||||
}
|
||||
export const metadata: Metadata = {
|
||||
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,
|
||||
|
|
@ -26,7 +24,7 @@ export default function CreatorProfileDonePage() {
|
|||
<CreatorProfileDoneStepSkeleton label={i18n.t('auth:loading')} />
|
||||
);
|
||||
return (
|
||||
<AuthTemplate brandHref={ROUTES.home} width="wide">
|
||||
<AuthTemplate brandHref={ROUTES.home}>
|
||||
<AuthGuard role="creator" fallback={skeleton}>
|
||||
<Suspense fallback={skeleton}>
|
||||
<CreatorProfileDoneStep size="md" supportPlacement="popover" />
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@ 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 (
|
||||
<AuthTemplate brandHref={ROUTES.home} width="wide">
|
||||
<AuthTemplate brandHref={ROUTES.home}>
|
||||
<InvestorProfileStepSkeleton label={i18n.t('auth:loading')} />
|
||||
</AuthTemplate>
|
||||
);
|
||||
|
|
|
|||
|
|
@ -9,12 +9,10 @@ import type { Metadata } from 'next';
|
|||
import { i18n } from '../../../../i18n';
|
||||
import { AuthTemplate } from '../../../templates/auth-template';
|
||||
|
||||
export function generateMetadata(): Metadata {
|
||||
return {
|
||||
title: i18n.t('auth:register.profile.meta-title'),
|
||||
robots: { index: false },
|
||||
};
|
||||
}
|
||||
export const metadata: Metadata = {
|
||||
title: i18n.t('auth:register.profile.meta-title'),
|
||||
robots: { index: false },
|
||||
};
|
||||
|
||||
/**
|
||||
* Registration step 5 for an investor, optional, on the session, in the 560 card. The frame
|
||||
|
|
@ -22,7 +20,7 @@ export function generateMetadata(): Metadata {
|
|||
*/
|
||||
export default function InvestorProfilePage() {
|
||||
return (
|
||||
<AuthTemplate brandHref={ROUTES.home} width="wide">
|
||||
<AuthTemplate brandHref={ROUTES.home}>
|
||||
<AuthGuard
|
||||
role="investor"
|
||||
fallback={
|
||||
|
|
|
|||
Binary file not shown.
|
After Width: | Height: | Size: 1.8 KiB |
|
|
@ -5,7 +5,7 @@ import '../bootstrap/bootstrap.client';
|
|||
import '../styles/app.css';
|
||||
|
||||
import { Element } from '@lumina/island/primitives/element';
|
||||
import { ErrorFallback } from '@lumina/market/app/error-boundaries';
|
||||
import { AppCrash } from '@lumina/market/app/error-boundaries';
|
||||
|
||||
import { i18n } from '../i18n/i18n.client';
|
||||
|
||||
|
|
@ -13,17 +13,16 @@ type GlobalErrorProps = {
|
|||
error: Error & { digest?: string };
|
||||
};
|
||||
|
||||
/** The app boundary (EB-W): the last resort when nothing below caught the error. */
|
||||
/**
|
||||
* The app boundary (EB-W): the last resort when nothing below caught the error. Its own document,
|
||||
* right to left, with the brand and the way back (G-4h).
|
||||
*/
|
||||
export default function GlobalError({ error }: GlobalErrorProps) {
|
||||
return (
|
||||
<Element tag="html" lang={i18n.language} dir={i18n.dir()}>
|
||||
<Element tag="body">
|
||||
<Element tag="meta" name="robots" content="noindex" />
|
||||
<ErrorFallback
|
||||
error={error}
|
||||
size="app"
|
||||
onRetry={() => window.location.reload()}
|
||||
/>
|
||||
<AppCrash error={error} />
|
||||
</Element>
|
||||
</Element>
|
||||
);
|
||||
|
|
|
|||
|
|
@ -3,6 +3,7 @@ import '../bootstrap/bootstrap.server';
|
|||
import '../styles/app.css';
|
||||
|
||||
import { CRITICAL_FONT_URL } from '@lumina/island/constants';
|
||||
import { ToastPlacementMarker } from '@lumina/island/molecules/toast';
|
||||
import { Element } from '@lumina/island/primitives/element';
|
||||
import type { Metadata } from 'next';
|
||||
import type { ReactNode } from 'react';
|
||||
|
|
@ -12,9 +13,7 @@ import { rootMetadata } from '../configs';
|
|||
import { i18n } from '../i18n';
|
||||
import { AppProviders } from './organisms/app-providers';
|
||||
|
||||
export function generateMetadata(): Metadata {
|
||||
return rootMetadata();
|
||||
}
|
||||
export const metadata: Metadata = rootMetadata();
|
||||
|
||||
export default function RootLayout({ children }: { children: ReactNode }) {
|
||||
// Only the face every page renders first; the Latin face loads where شبا is shown.
|
||||
|
|
@ -27,7 +26,11 @@ export default function RootLayout({ children }: { children: ReactNode }) {
|
|||
return (
|
||||
<Element tag="html" lang={i18n.language} dir={i18n.dir()}>
|
||||
<Element tag="body">
|
||||
<AppProviders>{children}</AppProviders>
|
||||
<AppProviders>
|
||||
{/* Desktop toasts: centred, 32px from the bottom, whatever the page shows. */}
|
||||
<ToastPlacementMarker placement="desktop" />
|
||||
{children}
|
||||
</AppProviders>
|
||||
</Element>
|
||||
</Element>
|
||||
);
|
||||
|
|
|
|||
|
|
@ -0,0 +1,22 @@
|
|||
import { buildManifest } from '@lumina/market/server';
|
||||
import type { MetadataRoute } from 'next';
|
||||
|
||||
import { i18n } from '../i18n';
|
||||
|
||||
// Every request renders fresh, as every metadata route does: nothing is cached on the server.
|
||||
export const dynamic = 'force-dynamic';
|
||||
|
||||
// Both apps serve this same manifest (0053). Browsers fetch it without cookies, so it speaks the
|
||||
// app's one locale, and it is the same bytes until the next deploy, so it is built once, when the
|
||||
// module loads; each request only serializes it.
|
||||
const MANIFEST = buildManifest({
|
||||
name: i18n.t('app.name'),
|
||||
description: i18n.t('app.description'),
|
||||
lang: i18n.language,
|
||||
dir: i18n.dir(),
|
||||
});
|
||||
|
||||
/** The web app manifest at `/manifest.webmanifest`; Next.js adds its `<link rel="manifest">`. */
|
||||
export default function manifest(): MetadataRoute.Manifest {
|
||||
return MANIFEST;
|
||||
}
|
||||
|
|
@ -1,9 +1,37 @@
|
|||
import { FlexBox } from '@lumina/island/atoms/flex-box';
|
||||
import { Element } from '@lumina/island/primitives/element';
|
||||
import { StatusEmptyState } from '@lumina/market/app/error-boundaries';
|
||||
import { DesktopHeader } from '@lumina/market/app/navigation';
|
||||
import type { Metadata } from 'next';
|
||||
import { Suspense } from 'react';
|
||||
|
||||
export const metadata: Metadata = { robots: { index: false } };
|
||||
|
||||
/** A missing channel, post or page: calm, with the way home. */
|
||||
/**
|
||||
* A missing page or post, outside every route group (G-4d): the header over the calm state in the
|
||||
* 640 column, with the way home.
|
||||
*/
|
||||
export default function NotFound() {
|
||||
return <StatusEmptyState variant="not-found" size="page" />;
|
||||
return (
|
||||
<FlexBox direction="flex-col" className="min-h-dvh bg-bg-page">
|
||||
{/* Prerendered outside every route group: the bar reads the address (its login link keeps
|
||||
the page), so it waits for the browser behind a same-size frame. */}
|
||||
<Suspense
|
||||
fallback={
|
||||
<Element className="min-h-16 border-b border-border-subtle bg-surface" />
|
||||
}
|
||||
>
|
||||
<DesktopHeader />
|
||||
</Suspense>
|
||||
<FlexBox
|
||||
tag="main"
|
||||
justifyContent="justify-center"
|
||||
className="flex-1 px-8 py-10"
|
||||
>
|
||||
<FlexBox direction="flex-col" className="w-full max-w-content">
|
||||
<StatusEmptyState variant="not-found" size="page" />
|
||||
</FlexBox>
|
||||
</FlexBox>
|
||||
</FlexBox>
|
||||
);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,61 +1,66 @@
|
|||
import { FlexBox } from '@lumina/island/atoms/flex-box';
|
||||
import { Typography } from '@lumina/island/atoms/typography';
|
||||
import { Card } from '@lumina/island/molecules/card';
|
||||
import { cn } from '@lumina/island/tools/cn';
|
||||
import { NetworkBar } from '@lumina/market/app/app-shell';
|
||||
import { ROUTES } from '@lumina/market/app/navigation';
|
||||
import { SupportEntry } from '@lumina/market/app/screens/organisms/support-entry';
|
||||
import NextLink from 'next/link';
|
||||
|
||||
import { i18n } from '../../../i18n';
|
||||
import { StepBack } from './components/StepBack';
|
||||
import type { AuthTemplateProps } from './types';
|
||||
|
||||
/**
|
||||
* Login and registration on desktop: the logged-out header (the brand and support) and each
|
||||
* step in one centred card, its buttons inside the card under the fields. Registration step 5
|
||||
* keeps the header, signed in: there is no nav until registration is complete. Browser back is the
|
||||
* way back; there is no back button.
|
||||
* Login and registration on desktop: the logged-out header (the brand and support, no login) and
|
||||
* each step in one card of the 560 column, its buttons inside the card under the fields. A pushed
|
||||
* step has «بازگشت» above the card (R14), to the step before it. Registration step 5 keeps the
|
||||
* header, signed in: there is no nav until registration is complete. The connection bar draws
|
||||
* under the header, in the same sticky box.
|
||||
*/
|
||||
export function AuthTemplate({
|
||||
width = 'narrow',
|
||||
framed = true,
|
||||
brandHref = ROUTES.landing,
|
||||
back,
|
||||
children,
|
||||
}: AuthTemplateProps) {
|
||||
return (
|
||||
<FlexBox direction="flex-col" className="min-h-dvh bg-bg-page">
|
||||
<FlexBox
|
||||
tag="header"
|
||||
alignItems="items-center"
|
||||
justifyContent="justify-between"
|
||||
className="min-h-16 border-b border-border-subtle bg-surface px-8"
|
||||
>
|
||||
<Typography
|
||||
tag={NextLink}
|
||||
href={brandHref}
|
||||
aria-label={i18n.t('auth:header.home')}
|
||||
variant="heading-sm"
|
||||
color="brand"
|
||||
className="rounded-xs no-underline focus-visible:focus-ring"
|
||||
<FlexBox direction="flex-col" className="sticky top-0 z-sticky">
|
||||
<FlexBox
|
||||
tag="header"
|
||||
alignItems="items-center"
|
||||
justifyContent="justify-between"
|
||||
className="min-h-16 border-b border-border-subtle bg-surface ps-8 pe-6"
|
||||
>
|
||||
{i18n.t('auth:header.brand')}
|
||||
</Typography>
|
||||
<SupportEntry trigger="icon" placement="popover" />
|
||||
<Typography
|
||||
tag={NextLink}
|
||||
href={brandHref}
|
||||
aria-label={i18n.t('auth:header.home')}
|
||||
variant="heading-md"
|
||||
className="rounded-xs leading-7.5 whitespace-nowrap no-underline focus-visible:focus-ring"
|
||||
>
|
||||
{i18n.t('auth:header.brand')}
|
||||
</Typography>
|
||||
<SupportEntry trigger="icon" placement="popover" />
|
||||
</FlexBox>
|
||||
<NetworkBar />
|
||||
</FlexBox>
|
||||
<FlexBox
|
||||
tag="main"
|
||||
justifyContent="justify-center"
|
||||
className="px-4 pt-28 pb-16"
|
||||
className="px-8 py-10"
|
||||
>
|
||||
{framed ? (
|
||||
<Card
|
||||
padding="none"
|
||||
className={cn(
|
||||
'w-full p-10',
|
||||
width === 'wide' ? 'max-w-form' : 'max-w-checkout',
|
||||
)}
|
||||
<FlexBox
|
||||
direction="flex-col"
|
||||
gap="gap-4"
|
||||
className="w-full max-w-form"
|
||||
>
|
||||
{children}
|
||||
</Card>
|
||||
{back && <StepBack step={back} />}
|
||||
<Card padding="none" className="px-10 pt-10 pb-8">
|
||||
{children}
|
||||
</Card>
|
||||
</FlexBox>
|
||||
) : (
|
||||
children
|
||||
)}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,16 @@
|
|||
'use client';
|
||||
|
||||
import { DeskBack, withReturnPath } from '@lumina/market/app/navigation';
|
||||
import { useSearchParams } from 'next/navigation';
|
||||
|
||||
import type { StepBackProps } from '../types';
|
||||
|
||||
/**
|
||||
* «بازگشت» to the previous step, keeping `?redirect=` from the address bar, so a page and its
|
||||
* loading frame lead to the same place and the person still returns to the page that asked for
|
||||
* login.
|
||||
*/
|
||||
export function StepBack({ step }: StepBackProps) {
|
||||
const redirect = useSearchParams().get('redirect');
|
||||
return <DeskBack href={withReturnPath(step, redirect)} />;
|
||||
}
|
||||
|
|
@ -1,7 +1,10 @@
|
|||
import type { ReactNode } from 'react';
|
||||
|
||||
export type AuthTemplateProps = {
|
||||
/** narrow (480): the number and the code. wide (560): the account type and step 4. */
|
||||
/**
|
||||
* The card's column. Both are the design's 560 form column now (J01, J02), so pages may drop it;
|
||||
* kept so they don't have to change at once.
|
||||
*/
|
||||
width?: 'narrow' | 'wide';
|
||||
/**
|
||||
* false: no card; the step draws its own, such as registration step 5's form card beside its
|
||||
|
|
@ -10,5 +13,12 @@ export type AuthTemplateProps = {
|
|||
framed?: boolean;
|
||||
/** Where the brand goes: the landing for login and registration, خانه on onboarding pages. */
|
||||
brandHref?: string;
|
||||
/**
|
||||
* The previous step's path, behind «بازگشت» above the card; `?redirect=` is kept from the
|
||||
* address. First steps, step 4 and 5 and the suspended page have none, as on mobile.
|
||||
*/
|
||||
back?: string;
|
||||
children: ReactNode;
|
||||
};
|
||||
|
||||
export type StepBackProps = { step: string };
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
import { configureErrorHandler } from '@lumina/libs/error-handler';
|
||||
import { eventEmitter } from '@lumina/libs/event-emitter';
|
||||
import { http } from '@lumina/libs/http';
|
||||
import { captureInstallPrompt, configureServiceWorker } from '@lumina/libs/pwa';
|
||||
import { mapApiErrorBody } from '@lumina/market/app/http';
|
||||
import { setEnv as setMarketEnv } from '@lumina/market/env';
|
||||
import { AUTH_ENDPOINTS, AUTH_EVENTS } from '@lumina/market/features/auth';
|
||||
|
|
@ -30,3 +31,11 @@ http.configure({
|
|||
mapErrorBody: mapApiErrorBody,
|
||||
});
|
||||
configureErrorHandler(ERROR_HANDLER_CONFIG);
|
||||
// The service worker stores only JS, CSS, fonts and the icon sprite (pwa lib); the AppShell
|
||||
// registers it when this flag is on, and turning the flag off unregisters it for every visitor.
|
||||
configureServiceWorker({
|
||||
enabled: clientEnv.NEXT_PUBLIC_SERVICE_WORKER_ENABLED,
|
||||
});
|
||||
// The browser's install offer can arrive before React hydrates; keep it for the install page.
|
||||
// Does nothing on the server.
|
||||
captureInstallPrompt();
|
||||
|
|
|
|||
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue