Compare commits

..

No commits in common. "495f800f1f3e7e4dcfca0bbf1580bace8d16d1da" and "9877d7bf148a691be4572b3acb98e184cd8e9af3" have entirely different histories.

165 changed files with 69 additions and 3844 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 113 KiB

View File

@ -1,10 +0,0 @@
import type { ReactNode } from 'react';
// Every request renders fresh: nothing in this group is prerendered or cached on the server.
// Only the landing is (0026), so this lives in each route group's layout, not the root's.
export const dynamic = 'force-dynamic';
/** Adds nothing to the page; it holds the group's rendering mode. */
export default function AuthLayout({ children }: { children: ReactNode }) {
return children;
}

View File

@ -1,10 +0,0 @@
import type { ReactNode } from 'react';
// Every request renders fresh: nothing in this group is prerendered or cached on the server.
// Only the landing is (0026), so this lives in each route group's layout, not the root's.
export const dynamic = 'force-dynamic';
/** Adds nothing to the page; it holds the group's rendering mode. */
export default function FlowLayout({ children }: { children: ReactNode }) {
return children;
}

View File

@ -1,3 +0,0 @@
'use client';
export { PageError as default } from '@lumina/market/app/screens/organisms/page-error';

View File

@ -1,36 +0,0 @@
import { FlexBox } from '@lumina/island/atoms/flex-box';
import { GridBox } from '@lumina/island/atoms/grid-box';
import { Skeleton, SkeletonRegion } from '@lumina/island/atoms/skeleton';
import { i18n } from '../../i18n';
/** The landing before it arrives: the header's height, then the hero's copy beside its picture. */
export default function Loading() {
return (
<SkeletonRegion
label={i18n.t('landing:loading')}
delayed
className="min-h-dvh bg-surface"
>
<FlexBox
alignItems="items-center"
className="h-16 border-b border-border-subtle px-8"
>
<Skeleton width="5rem" height="1.25rem" />
</FlexBox>
<GridBox
cols="grid-cols-2"
gap="gap-16"
alignItems="items-center"
className="mx-auto max-w-page px-8 py-14"
>
<FlexBox direction="flex-col" gap="gap-4">
<Skeleton height="3rem" width="90%" />
<Skeleton lines={3} height="1rem" />
<Skeleton shape="pill" width="12rem" height="3.25rem" />
</FlexBox>
<Skeleton shape="rect" width="100%" height="36rem" />
</GridBox>
</SkeletonRegion>
);
}

View File

@ -1,65 +0,0 @@
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';
import {
landingLabels,
LandingTemplate,
} from '@lumina/market/app/screens/(landing)/templates/landing-template';
import {
faqJsonLd,
landingMetadata,
loadLandingPage,
} from '@lumina/market/server';
import type { Metadata } from 'next';
import { PHASE_PRODUCTION_BUILD } from 'next/constants';
import { displayUrl } from '../../configs';
import { serverEnv } from '../../env/server';
import { i18n } from '../../i18n';
// The landing is the same for every visitor and reads no session, so it is prerendered and its
// featured analysts are read again every 10 minutes (0026). Every other route renders fresh.
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'),
});
}
/**
* The landing, `/`: what Lumina is, for a signed-out visitor, and the way to registration. A
* signed-in person is sent on to their home once the browser knows them (0027).
*/
export default async function LandingPage() {
// A failed read hides the analysts at build time; at a revalidation it keeps the last good page.
const { featured } = await loadLandingPage({
hideOnError: serverEnv.NEXT_PHASE === PHASE_PRODUCTION_BUILD,
});
const labels = landingLabels(
i18n.getFixedT(null, 'landing'),
i18n.getFixedT(null, 'common'),
i18n.getFixedT(null, 'content'),
);
return (
<>
<LandingTemplate
layout="desktop"
featured={featured}
siteHost={displayUrl('')}
labels={labels}
/>
<Element
tag="script"
type="application/ld+json"
dangerouslySetInnerHTML={{
__html: faqJsonLd(faqEntries(labels.faq)),
}}
/>
<LandingRedirect />
</>
);
}

View File

@ -18,7 +18,7 @@ export function generateMetadata(): Metadata {
}
/**
* خانه, `/feed`: the investor's feed of the creators they follow. The server sends only the frame and
* خانه, `/`: 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).

View File

@ -2,10 +2,6 @@ import { FlexBox } from '@lumina/island/atoms/flex-box';
import { DesktopHeader } from '@lumina/market/app/navigation';
import type { ReactNode } from 'react';
// Every request renders fresh: nothing in this group is prerendered or cached on the server.
// Only the landing is (0026), so this lives in each route group's layout, not the root's.
export const dynamic = 'force-dynamic';
type MainLayoutProps = {
children: ReactNode;
/** The `@modal` slot: «پست جدید» over the page (C4 ۷.۳), or nothing. */

View File

@ -1,14 +0,0 @@
import type { ReactNode } from 'react';
// Every request renders fresh: nothing in this group is prerendered or cached on the server.
// Only the landing is (0026), so this lives in each route group's layout, not the root's.
export const dynamic = 'force-dynamic';
/** Adds nothing to the page; it holds the group's rendering mode. */
export default function OnboardingLayout({
children,
}: {
children: ReactNode;
}) {
return children;
}

View File

@ -1,5 +1,4 @@
import { CreatorProfileStepSkeleton } from '@lumina/market/app/screens/(onboarding)/onboarding/creator-profile/organisms/creator-profile-step';
import { ROUTES } from '@lumina/market/app/navigation';
import { i18n } from '../../../../../i18n';
import { AuthTemplate } from '../../../../templates/auth-template';
@ -7,7 +6,7 @@ import { AuthTemplate } from '../../../../templates/auth-template';
/** Registration step 5 for a creator, before its frame arrives. The same frame and skeleton as the page, so nothing moves when it arrives. */
export default function Loading() {
return (
<AuthTemplate brandHref={ROUTES.home} framed={false}>
<AuthTemplate framed={false}>
<CreatorProfileStepSkeleton
layout="desktop"
label={i18n.t('auth:loading')}

View File

@ -1,5 +1,4 @@
import { AuthGuard } from '@lumina/market/app/guards/auth-guard';
import { ROUTES } from '@lumina/market/app/navigation';
import {
CreatorProfileStep,
CreatorProfileStepSkeleton,
@ -29,7 +28,7 @@ export default function CreatorProfilePage() {
/>
);
return (
<AuthTemplate brandHref={ROUTES.home} framed={false}>
<AuthTemplate framed={false}>
<AuthGuard role="creator" fallback={skeleton}>
<Suspense fallback={skeleton}>
<CreatorProfileStep

View File

@ -1,5 +1,4 @@
import { CreatorProfileDoneStepSkeleton } from '@lumina/market/app/screens/(onboarding)/onboarding/creator-profile/done/organisms/creator-profile-done-step';
import { ROUTES } from '@lumina/market/app/navigation';
import { i18n } from '../../../../../i18n';
import { AuthTemplate } from '../../../../templates/auth-template';
@ -7,7 +6,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 width="wide">
<CreatorProfileDoneStepSkeleton label={i18n.t('auth:loading')} />
</AuthTemplate>
);

View File

@ -1,5 +1,4 @@
import { AuthGuard } from '@lumina/market/app/guards/auth-guard';
import { ROUTES } from '@lumina/market/app/navigation';
import {
CreatorProfileDoneStep,
CreatorProfileDoneStepSkeleton,
@ -26,7 +25,7 @@ export default function CreatorProfileDonePage() {
<CreatorProfileDoneStepSkeleton label={i18n.t('auth:loading')} />
);
return (
<AuthTemplate brandHref={ROUTES.home} width="wide">
<AuthTemplate width="wide">
<AuthGuard role="creator" fallback={skeleton}>
<Suspense fallback={skeleton}>
<CreatorProfileDoneStep size="md" supportPlacement="popover" />

View File

@ -1,5 +1,4 @@
import { InvestorProfileStepSkeleton } from '@lumina/market/app/screens/(onboarding)/onboarding/investor-profile/organisms/investor-profile-step';
import { ROUTES } from '@lumina/market/app/navigation';
import { i18n } from '../../../../i18n';
import { AuthTemplate } from '../../../templates/auth-template';
@ -7,7 +6,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 width="wide">
<InvestorProfileStepSkeleton label={i18n.t('auth:loading')} />
</AuthTemplate>
);

View File

@ -1,5 +1,4 @@
import { AuthGuard } from '@lumina/market/app/guards/auth-guard';
import { ROUTES } from '@lumina/market/app/navigation';
import {
InvestorProfileStep,
InvestorProfileStepSkeleton,
@ -22,7 +21,7 @@ export function generateMetadata(): Metadata {
*/
export default function InvestorProfilePage() {
return (
<AuthTemplate brandHref={ROUTES.home} width="wide">
<AuthTemplate width="wide">
<AuthGuard
role="investor"
fallback={

View File

@ -12,6 +12,9 @@ import { rootMetadata } from '../configs';
import { i18n } from '../i18n';
import { AppProviders } from './organisms/app-providers';
// Every request renders fresh: nothing is prerendered or cached on the server.
export const dynamic = 'force-dynamic';
export function generateMetadata(): Metadata {
return rootMetadata();
}

View File

@ -18,7 +18,6 @@ import type { AuthTemplateProps } from './types';
export function AuthTemplate({
width = 'narrow',
framed = true,
brandHref = ROUTES.landing,
children,
}: AuthTemplateProps) {
return (
@ -31,7 +30,7 @@ export function AuthTemplate({
>
<Typography
tag={NextLink}
href={brandHref}
href={ROUTES.home}
aria-label={i18n.t('auth:header.home')}
variant="heading-sm"
color="brand"

View File

@ -8,7 +8,5 @@ export type AuthTemplateProps = {
* live preview.
*/
framed?: boolean;
/** Where the brand goes: the landing for login and registration, خانه on onboarding pages. */
brandHref?: string;
children: ReactNode;
};

View File

@ -5,7 +5,6 @@ import { http } from '@lumina/libs/http';
import { configureServerHttp } from '@lumina/libs/server';
import { mapApiErrorBody } from '@lumina/market/app/http';
import { setEnv as setMarketEnv } from '@lumina/market/env';
import { SERVER_RESOURCES } from '@lumina/market/server';
import { cookies } from 'next/headers';
import {
@ -15,7 +14,6 @@ import {
} from '../constants';
import { clientEnv } from '../env';
import { serverEnv } from '../env/server';
import { i18n } from '../i18n';
import { ERROR_HANDLER_CONFIG } from './error-reporting';
// Fills the server module graph once, before rendering. Idempotent: safe to run again.
@ -39,10 +37,3 @@ configureServerHttp({
});
http.configure({ mapErrorBody: mapApiErrorBody });
configureErrorHandler(ERROR_HANDLER_CONFIG);
// Namespaces only server components read (the landing) join the server's i18n instance here, so
// no client bundle carries them. Existing keys are kept, so running this again changes nothing.
for (const [language, bundles] of Object.entries(SERVER_RESOURCES)) {
for (const [namespace, bundle] of Object.entries(bundles)) {
i18n.addResourceBundle(language, namespace, bundle);
}
}

View File

@ -2,18 +2,12 @@ import 'server-only';
import { origin } from '@lumina/libs/env';
import { createServerEnv } from '@lumina/libs/env/server';
import * as v from 'valibot';
/** Server variables; only server code imports them, through `env/server`. */
export const serverEnv = createServerEnv({
schema: {
/** The gateway from inside the deployment network: server requests and the `/api` proxy. */
API_INTERNAL_ORIGIN: origin,
/**
* Set by Next.js itself, never in `.env`: `phase-production-build` while `next build`
* prerenders pages (the landing, 0026).
*/
NEXT_PHASE: v.optional(v.string()),
},
runtimeEnv: process.env,
skipValidation: process.env.SKIP_ENV_VALIDATION === 'true',

Binary file not shown.

Before

Width:  |  Height:  |  Size: 113 KiB

View File

@ -1,10 +0,0 @@
import type { ReactNode } from 'react';
// Every request renders fresh: nothing in this group is prerendered or cached on the server.
// Only the landing is (0026), so this lives in each route group's layout, not the root's.
export const dynamic = 'force-dynamic';
/** Adds nothing to the page; it holds the group's rendering mode. */
export default function AuthLayout({ children }: { children: ReactNode }) {
return children;
}

View File

@ -1,10 +0,0 @@
import type { ReactNode } from 'react';
// Every request renders fresh: nothing in this group is prerendered or cached on the server.
// Only the landing is (0026), so this lives in each route group's layout, not the root's.
export const dynamic = 'force-dynamic';
/** Adds nothing to the page; it holds the group's rendering mode. */
export default function FlowLayout({ children }: { children: ReactNode }) {
return children;
}

View File

@ -1,3 +0,0 @@
'use client';
export { PageError as default } from '@lumina/market/app/screens/organisms/page-error';

View File

@ -1,31 +0,0 @@
import { FlexBox } from '@lumina/island/atoms/flex-box';
import { Skeleton, SkeletonRegion } from '@lumina/island/atoms/skeleton';
import { i18n } from '../../i18n';
/** The landing before it arrives: the header's height, then the hero's picture and copy. */
export default function Loading() {
return (
<SkeletonRegion
label={i18n.t('landing:loading')}
delayed
className="min-h-dvh bg-surface"
>
<FlexBox
alignItems="items-center"
className="h-14 border-b border-border-subtle px-4 tablet:h-16 tablet:px-8"
>
<Skeleton width="5rem" height="1.25rem" />
</FlexBox>
<FlexBox
direction="flex-col"
gap="gap-4"
className="px-4 pt-7 tablet:px-8"
>
<Skeleton shape="rect" width="100%" height="24rem" />
<Skeleton lines={3} height="1rem" />
<Skeleton shape="pill" width="100%" height="3.25rem" />
</FlexBox>
</SkeletonRegion>
);
}

View File

@ -1,65 +0,0 @@
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';
import {
landingLabels,
LandingTemplate,
} from '@lumina/market/app/screens/(landing)/templates/landing-template';
import {
faqJsonLd,
landingMetadata,
loadLandingPage,
} from '@lumina/market/server';
import type { Metadata } from 'next';
import { PHASE_PRODUCTION_BUILD } from 'next/constants';
import { displayUrl } from '../../configs';
import { serverEnv } from '../../env/server';
import { i18n } from '../../i18n';
// The landing is the same for every visitor and reads no session, so it is prerendered and its
// featured analysts are read again every 10 minutes (0026). Every other route renders fresh.
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'),
});
}
/**
* The landing, `/`: what Lumina is, for a signed-out visitor, and the way to registration. A
* signed-in person is sent on to their home once the browser knows them (0027).
*/
export default async function LandingPage() {
// A failed read hides the analysts at build time; at a revalidation it keeps the last good page.
const { featured } = await loadLandingPage({
hideOnError: serverEnv.NEXT_PHASE === PHASE_PRODUCTION_BUILD,
});
const labels = landingLabels(
i18n.getFixedT(null, 'landing'),
i18n.getFixedT(null, 'common'),
i18n.getFixedT(null, 'content'),
);
return (
<>
<LandingTemplate
layout="mobile"
featured={featured}
siteHost={displayUrl('')}
labels={labels}
/>
<Element
tag="script"
type="application/ld+json"
dangerouslySetInnerHTML={{
__html: faqJsonLd(faqEntries(labels.faq)),
}}
/>
<LandingRedirect />
</>
);
}

View File

@ -18,7 +18,7 @@ export function generateMetadata(): Metadata {
}
/**
* خانه, `/feed`: the investor's feed of the creators they follow. The server sends only the frame and
* خانه, `/`: 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.
*/

View File

@ -2,10 +2,6 @@ import { FlexBox } from '@lumina/island/atoms/flex-box';
import { BottomNav } from '@lumina/market/app/navigation';
import type { ReactNode } from 'react';
// Every request renders fresh: nothing in this group is prerendered or cached on the server.
// Only the landing is (0026), so this lives in each route group's layout, not the root's.
export const dynamic = 'force-dynamic';
/** The main pages on mobile: each page brings its top bar; the bottom nav is shared. */
export default function MainLayout({ children }: { children: ReactNode }) {
return (

View File

@ -1,14 +0,0 @@
import type { ReactNode } from 'react';
// Every request renders fresh: nothing in this group is prerendered or cached on the server.
// Only the landing is (0026), so this lives in each route group's layout, not the root's.
export const dynamic = 'force-dynamic';
/** Adds nothing to the page; it holds the group's rendering mode. */
export default function OnboardingLayout({
children,
}: {
children: ReactNode;
}) {
return children;
}

View File

@ -1,5 +1,4 @@
import { CreatorProfileDoneStepSkeleton } from '@lumina/market/app/screens/(onboarding)/onboarding/creator-profile/done/organisms/creator-profile-done-step';
import { ROUTES } from '@lumina/market/app/navigation';
import { i18n } from '../../../../../i18n';
import { AuthTopBar } from '../../../../organisms/auth-top-bar';
@ -8,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 header={<AuthTopBar brandHref={ROUTES.home} />}>
<AuthTemplate header={<AuthTopBar />}>
<CreatorProfileDoneStepSkeleton label={i18n.t('auth:loading')} />
</AuthTemplate>
);

View File

@ -1,5 +1,4 @@
import { AuthGuard } from '@lumina/market/app/guards/auth-guard';
import { ROUTES } from '@lumina/market/app/navigation';
import {
CreatorProfileDoneStep,
CreatorProfileDoneStepSkeleton,
@ -28,7 +27,7 @@ export default function CreatorProfileDonePage() {
<CreatorProfileDoneStepSkeleton label={i18n.t('auth:loading')} />
);
return (
<AuthTemplate header={<AuthTopBar brandHref={ROUTES.home} />}>
<AuthTemplate header={<AuthTopBar />}>
<AuthGuard role="creator" fallback={skeleton}>
<Suspense fallback={skeleton}>
<CreatorProfileDoneStep size="lg" supportPlacement="bottom" />

View File

@ -12,6 +12,9 @@ import { rootMetadata } from '../configs';
import { i18n } from '../i18n';
import { AppProviders } from './organisms/app-providers';
// Every request renders fresh: nothing is prerendered or cached on the server.
export const dynamic = 'force-dynamic';
export function generateMetadata(): Metadata {
return rootMetadata();
}

View File

@ -13,11 +13,7 @@ import type { AuthTopBarProps } from './types';
* support on a pushed step; only the name on a step with no way back (registration step 4).
* Back keeps what was typed: the number lives in the flow store.
*/
export function AuthTopBar({
title,
back,
brandHref = ROUTES.landing,
}: AuthTopBarProps) {
export function AuthTopBar({ title, back }: AuthTopBarProps) {
return (
<FlexBox
tag="header"
@ -38,7 +34,7 @@ export function AuthTopBar({
<FlexBox className="flex-1 px-2">
<Typography
tag={NextLink}
href={brandHref}
href={ROUTES.home}
aria-label={i18n.t('auth:header.home')}
variant="heading-sm"
color="brand"

View File

@ -3,8 +3,6 @@ export type AuthTopBarProps = {
title?: string;
/** The previous step's path, behind the back button; `?redirect=` is kept from the address. */
back?: string;
/** Where the brand goes: the landing for login and registration, خانه on onboarding pages. */
brandHref?: string;
};
export type BackButtonProps = {

View File

@ -5,7 +5,6 @@ import { http } from '@lumina/libs/http';
import { configureServerHttp } from '@lumina/libs/server';
import { mapApiErrorBody } from '@lumina/market/app/http';
import { setEnv as setMarketEnv } from '@lumina/market/env';
import { SERVER_RESOURCES } from '@lumina/market/server';
import { cookies } from 'next/headers';
import {
@ -15,7 +14,6 @@ import {
} from '../constants';
import { clientEnv } from '../env';
import { serverEnv } from '../env/server';
import { i18n } from '../i18n';
import { ERROR_HANDLER_CONFIG } from './error-reporting';
// Fills the server module graph once, before rendering. Idempotent: safe to run again.
@ -39,10 +37,3 @@ configureServerHttp({
});
http.configure({ mapErrorBody: mapApiErrorBody });
configureErrorHandler(ERROR_HANDLER_CONFIG);
// Namespaces only server components read (the landing) join the server's i18n instance here, so
// no client bundle carries them. Existing keys are kept, so running this again changes nothing.
for (const [language, bundles] of Object.entries(SERVER_RESOURCES)) {
for (const [namespace, bundle] of Object.entries(bundles)) {
i18n.addResourceBundle(language, namespace, bundle);
}
}

View File

@ -2,18 +2,12 @@ import 'server-only';
import { origin } from '@lumina/libs/env';
import { createServerEnv } from '@lumina/libs/env/server';
import * as v from 'valibot';
/** Server variables; only server code imports them, through `env/server`. */
export const serverEnv = createServerEnv({
schema: {
/** The gateway from inside the deployment network: server requests and the `/api` proxy. */
API_INTERNAL_ORIGIN: origin,
/**
* Set by Next.js itself, never in `.env`: `phase-production-build` while `next build`
* prerenders pages (the landing, 0026).
*/
NEXT_PHASE: v.optional(v.string()),
},
runtimeEnv: process.env,
skipValidation: process.env.SKIP_ENV_VALIDATION === 'true',

View File

@ -1,6 +1,6 @@
# 0024 خانه is the investor's feed, read in the browser
Status: Superseded by 0027 · Area: architecture · Date: 2026-10-07 · Decided by: agent
Status: Proposed · Area: architecture · Date: 2026-10-07 · Decided by: agent
## Context
`/` (خانه) is drawn for investors only: their followed creators' posts, premium ones open when subscribed. A creator's home tab is their own channel, no board draws a guest's home, and the API answers 401 to a guest and 403 to a creator. Every link home (the brand, back with no history, «بازگشت به خانه», login with no return path) lands there.

View File

@ -1,21 +0,0 @@
# 0026 The landing is prerendered and revalidated
Status: Accepted · Area: architecture · Date: 2026-10-07 · Decided by: user
## Context
`/` became the guest landing (design, Oct 2026). It changes rarely, reads no session, and its only live data is the featured analysts. The skill renders every page fresh per request with no server cache, and both root layouts declared `dynamic = 'force-dynamic'`, which made any static page impossible.
## Decision
- `(landing)/page.tsx` in bull and bear declares `dynamic = 'force-static'` and `revalidate = 600`: the page is prerendered and its featured analysts are read again every 10 minutes.
- `force-dynamic` moves from the root layouts to each route group's layout (`(main)`, `(auth)`, `(flow)`, `(onboarding)`), so every other route still renders fresh per request.
- A failed read of the featured analysts (`loadLandingPage`) hides their section during `next build` (the app passes `NEXT_PHASE` from its server env), so the build never depends on the API; at a revalidation it throws, so Next keeps serving the last good page.
## Alternatives
- Render it fresh per request like every other page: rejected by the user; the page is the same for everyone and rarely changes.
- Static with no revalidation: rejected; the featured analysts are live.
## Consequences
- An exception to the skill's "no server cache" and "fresh page per request" rules, for `/` only. The response carries `s-maxage=600`, so a CDN may cache it too.
- A new route group must declare `force-dynamic` in its own layout; the root layout no longer does. The root `not-found` page is now static.
- A page built while the API was down has no analysts section until the first successful revalidation.
- The `landing` namespace is server-only (`SERVER_RESOURCES`), added to the i18n instance by each app's server bootstrap, so no client bundle carries it.

View File

@ -1,19 +0,0 @@
# 0027 خانه lives at /feed; the landing sends signed-in people on in the browser
Status: Accepted · Area: architecture · Date: 2026-10-07 · Decided by: user · Supersedes: 0024
## Context
The design moved the investor's feed from `/` to `/feed` when `/` became the guest landing, and asks for signed-in visitors to be redirected in middleware from the session cookie. The server render never depends on auth here, and the Next.js proxy was removed for that reason.
## Decision
- خانه, the investor's feed, is `/feed` (`ROUTES.home`); the landing is `/` (`ROUTES.landing`). The feed keeps 0024's rules: read only in the browser behind a same-size skeleton, `HomeGuard` sends a guest to login and a creator to their channel.
- On `/`, `LandingRedirect` waits for the browser's session and then `router.replace`s a member to `homeRoute`: step 5 while `needsProfile`, a creator's own channel, or `/feed`. Guests and expired sessions stay. No proxy, no cookie read on the server.
- A guest's brand link (top bars, desktop header, auth frames) goes to `/`.
## Alternatives
- Proxy (`proxy.ts`) redirect on the session cookie, as the design asks: rejected by the user; it brings back the proxy, can't tell a creator from an investor, and misses sessions whose 15-minute access cookie expired.
## Consequences
- A signed-in person who opens `/` sees the landing briefly before the redirect.
- «بازگشت به خانه» buttons still lead to `/feed`, so a guest there lands on login.
- After «خروج», the account page (not built yet) should send the person to `/`.

View File

@ -1,18 +0,0 @@
# 0028 Landing-only tokens in island
Status: Proposed · Area: design · Date: 2026-10-07 · Decided by: agent
## Context
The landing's spec has page-only type (h1 28/40 → 34/50 → 46/66, section titles 24/36 → 30/44), a 1184px content width, a black gradient under white text on the hero image, and a 720px step inside bull's range for its wider grids. None had a token, and raw sizes are not allowed where a token can exist.
## Decision
- island `theme.css` gains `--breakpoint-tablet: 720px`, `--text-hero`, `--text-hero-md`, `--text-hero-lg`, `--text-section`, `--text-section-lg`, `--container-page: 74rem` and `--image-shade`.
- Typography gains `hero` and `section` variants, which step up at `tablet` and `desktop`.
- `tablet:` is for the landing's grids only; navigation and app layout still switch only at `desktop` (1024px).
## Alternatives
- Arbitrary values (`min-[720px]:`, `text-[28px]`): rejected; raw sizes spread and drift.
- The design system's `display` and `heading-lg` instead: rejected; they don't match the spec's sizes.
## Consequences
Other marketing pages can reuse the tokens. Using `tablet:` outside the landing needs a new decision.

View File

@ -12,8 +12,6 @@
- 0012 Wrap each app's `next.config` in island's `withIconSprite` and `withFontCopy`; they write `symbol-defs.svg` and the fonts into `public/` unhashed, served immutable; link the sprite as `?v=<ICON_SPRITE_VERSION>`.
- 0013 Render every `(auth)` page's steps only in the browser behind `GuestGuard`: the server sends the frame, a same-size skeleton and `noindex`; flow state stays in memory, never in the URL or storage.
- 0018 Call the API from the browser only on the app's own origin under `/api`, rewritten by `next.config.ts` to `API_INTERNAL_ORIGIN`; media URLs use the same path, and the server render calls the gateway directly.
- 0026 Prerender the landing (`/`) with `force-static` and `revalidate = 600`; every other route keeps `force-dynamic` in its route group's layout, never the root's.
- 0027 Serve خانه at `/feed` and the landing at `/`; send a signed-in visitor of `/` to `homeRoute` in the browser with `LandingRedirect`, never in a proxy.
## Proposed
@ -28,5 +26,5 @@
- 0021 architecture: A channel's feed and post page start from the server's read as query `initialData`, re-read in the browser for the creator or a subscriber, and update in place after mutations.
- 0022 architecture: The API enforces post rules (2000 characters, four JPG/PNG/WebP images of 5 MB, 15-minute edit window, approved creators only); the composer mirrors them in `POST_LIMITS`.
- 0023 architecture: On desktop «پست جدید» is a dialog over the page through bear's `@modal` intercept of /compose/post; slots are emptied by explicit null pages, never a catch-all, and a hard load gets the full page.
- 0024 architecture: `/` (خانه) is the investor's feed, read only in the browser with the session behind a same-size skeleton; a guest goes to login with a return to `/`, a creator to their own channel.
- 0025 architecture: The investor's داشبورد is a tabbed section, one route per tab in `dashboard/(investor)`, whose layout holds the top bar or heading and `DashboardTabs`; each tab has its own loading.
- 0028 design: Landing-only island tokens: `tablet` (720px, the landing's grids only), `hero` and `section` type, `container-page` and `image-shade`.

View File

@ -2,10 +2,7 @@ import { cva } from 'class-variance-authority';
export const typographyVariants = cva('', {
variants: {
/**
* The design system's ten text styles; each sets size, line height and weight. `hero` and
* `section` are the landing's own display type.
*/
/** The design system's ten text styles; each sets size, line height and weight. */
variant: {
/** Takes size and weight from the parent, such as a label inside a button. */
inherit: '',
@ -19,10 +16,6 @@ export const typographyVariants = cva('', {
label: 'text-label',
caption: 'text-caption',
micro: 'text-micro',
/** The landing's h1 only: larger from the tablet and desktop widths. */
hero: 'text-hero text-balance tablet:text-hero-md desktop:text-hero-lg',
/** The landing's section titles. */
section: 'text-section text-balance tablet:text-section-lg',
},
/** Semantic text colours. Status hues use their `-text` shade, which passes 4.5:1. */
color: {

View File

@ -117,8 +117,6 @@ export { EmptyState } from './molecules/empty-state';
export type { EmptyStateProps, EmptyStateTone } from './molecules/empty-state';
export { ERROR_KIND_STYLES, ErrorState } from './molecules/error-state';
export type { ErrorKind, ErrorStateProps } from './molecules/error-state';
export { FactCard } from './molecules/fact-card';
export type { FactCardProps } from './molecules/fact-card';
export { FormSection } from './molecules/form-section';
export type { FormSectionProps } from './molecules/form-section';
export { LockedTeaser } from './molecules/locked-teaser';
@ -143,13 +141,6 @@ export type {
ResendCodeProps,
ResendStatus,
} from './molecules/resend-code';
export { SampleFrame, sampleTagVariants } from './molecules/sample-frame';
export type { SampleFrameProps } from './molecules/sample-frame';
export {
SectionHeading,
sectionHeadingVariants,
} from './molecules/section-heading';
export type { SectionHeadingProps } from './molecules/section-heading';
export {
SegmentedChoice,
segmentedChoiceOptionVariants,

View File

@ -1,48 +0,0 @@
import { FlexBox } from '../../atoms/flex-box';
import { GridBox } from '../../atoms/grid-box';
import { Icon } from '../../atoms/icon';
import { Typography } from '../../atoms/typography';
import { cn } from '../../tools/cn';
import type { FactCardProps } from './types';
/** One product fact on its own card, so each reads alone: an icon tile, a bold title and a line. */
export function FactCard({
icon,
title,
description,
tag = 'div',
className,
}: FactCardProps) {
return (
<FlexBox
tag={tag}
alignItems="items-start"
gap="gap-3"
className={cn(
'rounded-lg border border-border-subtle bg-surface px-4 py-3',
className,
)}
>
<GridBox
justifyItems="justify-items-center"
alignItems="items-center"
className="size-10 flex-none rounded-md bg-action-primary-subtle text-action-primary"
>
<Icon name={icon} />
</GridBox>
<FlexBox direction="flex-col" className="min-w-0">
<Typography tag="span" variant="label" className="font-bold">
{title}
</Typography>
<Typography
tag="span"
variant="body-sm"
color="secondary"
className="text-pretty"
>
{description}
</Typography>
</FlexBox>
</FlexBox>
);
}

View File

@ -1,2 +0,0 @@
export { FactCard } from './FactCard';
export type { FactCardProps } from './types';

View File

@ -1,12 +0,0 @@
import type { ReactNode } from 'react';
import type { IconName } from '../../atoms/icon';
export type FactCardProps = {
icon: IconName;
title: ReactNode;
description: ReactNode;
/** `li` inside a list of facts. */
tag?: 'div' | 'li';
className?: string;
};

View File

@ -1,54 +0,0 @@
import { FlexBox } from '../../atoms/flex-box';
import { Icon } from '../../atoms/icon';
import { Typography } from '../../atoms/typography';
import type { SampleFrameProps } from './types';
import { sampleTagVariants } from './variants';
/**
* A picture of the product made of its real components with made-up data: labelled «نمونه», never
* focusable or clickable, and hidden from screen readers, which read the caption instead.
*/
export function SampleFrame({
tag,
caption,
tone,
children,
className,
}: SampleFrameProps) {
return (
<FlexBox
tag="figure"
direction="flex-col"
gap="gap-2"
className={className}
>
<FlexBox
alignItems="items-center"
gap="gap-1"
className={sampleTagVariants({ tone })}
>
<Icon name="eye" size={16} />
<Typography
tag="span"
variant="caption"
color="inherit"
className="font-semibold"
>
{tag}
</Typography>
</FlexBox>
<FlexBox
direction="flex-col"
gap="gap-3"
inert
aria-hidden
className="pointer-events-none select-none"
>
{children}
</FlexBox>
<Typography tag="figcaption" variant="caption" color="secondary">
{caption}
</Typography>
</FlexBox>
);
}

View File

@ -1,3 +0,0 @@
export { SampleFrame } from './SampleFrame';
export type { SampleFrameProps } from './types';
export { sampleTagVariants } from './variants';

View File

@ -1,14 +0,0 @@
import type { ReactNode } from 'react';
import type { sampleTagVariants } from './variants';
import type { VariantProps } from 'class-variance-authority';
export type SampleFrameProps = VariantProps<typeof sampleTagVariants> & {
/** The label over the sample: «نمونه». */
tag: ReactNode;
/** Says the data is made up; screen readers read it in place of the sample. */
caption: ReactNode;
/** Real components fed with fixed sample data. */
children: ReactNode;
className?: string;
};

View File

@ -1,15 +0,0 @@
import { cva } from 'class-variance-authority';
/** The «نمونه» label: sunken on a page ground, white on a tinted panel. */
export const sampleTagVariants = cva(
'self-start rounded-sm px-2 text-text-secondary',
{
variants: {
tone: {
sunken: 'bg-surface-sunken',
surface: 'bg-surface',
},
},
defaultVariants: { tone: 'sunken' },
},
);

View File

@ -1,57 +0,0 @@
import { FlexBox } from '../../atoms/flex-box';
import { Icon } from '../../atoms/icon';
import { Typography } from '../../atoms/typography';
import { cn } from '../../tools/cn';
import type { SectionHeadingProps } from './types';
import { sectionHeadingVariants } from './variants';
/**
* A marketing section's heading: an optional kicker in the brand colour, the `h2` and a lead. The
* section labels itself with the title through `titleId`.
*/
export function SectionHeading({
titleId,
kicker,
kickerIcon,
title,
lead,
align,
className,
}: SectionHeadingProps) {
return (
<FlexBox
direction="flex-col"
gap="gap-2"
className={cn(sectionHeadingVariants({ align }), className)}
>
{kicker && (
<FlexBox
alignItems="items-center"
gap="gap-1"
className="text-action-primary-text"
>
{kickerIcon && <Icon name={kickerIcon} size={16} />}
<Typography
tag="span"
variant="caption"
color="brand"
className="font-bold"
>
{kicker}
</Typography>
</FlexBox>
)}
<Typography tag="h2" id={titleId} variant="section">
{title}
</Typography>
{lead && (
<Typography
color="secondary"
className="text-pretty tablet:text-body-lg"
>
{lead}
</Typography>
)}
</FlexBox>
);
}

View File

@ -1,3 +0,0 @@
export { SectionHeading } from './SectionHeading';
export type { SectionHeadingProps } from './types';
export { sectionHeadingVariants } from './variants';

View File

@ -1,18 +0,0 @@
import type { ReactNode } from 'react';
import type { IconName } from '../../atoms/icon';
export type SectionHeadingProps = {
/** The `h2`'s id, for its section's `aria-labelledby`. */
titleId: string;
/** A short line over the title in the brand colour, such as «بازارها». */
kicker?: ReactNode;
/** An icon before the kicker. */
kickerIcon?: IconName;
title: ReactNode;
/** One or two sentences under the title. */
lead?: ReactNode;
/** `center` for a section that is centred as a whole (the markets, the FAQ). */
align?: 'start' | 'center';
className?: string;
};

View File

@ -1,11 +0,0 @@
import { cva } from 'class-variance-authority';
export const sectionHeadingVariants = cva('max-w-170', {
variants: {
align: {
start: '',
center: 'mx-auto items-center text-center',
},
},
defaultVariants: { align: 'start' },
});

View File

@ -50,23 +50,6 @@
--text-micro: 0.6875rem;
--text-micro--line-height: 1.125rem;
--text-micro--font-weight: 500;
/* The landing's own display type (/), a step above `display`: its h1 and its section titles.
Typography's `hero` and `section` variants step them up at the tablet and desktop widths. */
--text-hero: 1.75rem;
--text-hero--line-height: 2.5rem;
--text-hero--font-weight: 800;
--text-hero-md: 2.125rem;
--text-hero-md--line-height: 3.125rem;
--text-hero-md--font-weight: 800;
--text-hero-lg: 2.875rem;
--text-hero-lg--line-height: 4.125rem;
--text-hero-lg--font-weight: 800;
--text-section: 1.5rem;
--text-section--line-height: 2.25rem;
--text-section--font-weight: 700;
--text-section-lg: 1.875rem;
--text-section-lg--line-height: 2.75rem;
--text-section-lg--font-weight: 700;
/* 4px grid: space-1 … space-16 map to Tailwind's numeric spacing (p-4 = 1rem = 16px). */
--spacing: 0.25rem;
@ -79,8 +62,6 @@
--container-checkout: 30rem;
--container-form: 35rem;
--container-content: 40rem;
/* The landing's sections: wide content with its own gutters. */
--container-page: 74rem;
--radius-xs: 4px;
--radius-sm: 6px;
--radius-md: 8px;
@ -95,10 +76,8 @@
--shadow-3:
0 24px 48px -12px rgba(12, 16, 24, 0.28),
0 8px 16px -8px rgba(12, 16, 24, 0.16);
/* Not the design system's 768px tablet switch: bull keeps the bottom navigation up to 1024px,
and bear starts at 1024px, so app layout never switches below that. Only the landing (/)
uses `tablet`, for its wider grids in bull from 720px; never navigation. */
--breakpoint-tablet: 720px;
/* No `tablet` (768px) breakpoint: bull keeps the bottom navigation up to 1024px,
and bear starts at 1024px, so layout never switches below that. */
--breakpoint-desktop: 1024px;
--breakpoint-wide: 1280px;
--ease-standard: cubic-bezier(0.2, 0, 0, 1);
@ -235,8 +214,6 @@
--surface-inverse: var(--slate-900);
--scrim: rgba(12, 16, 24, 0.48);
--lightbox: #000000;
/* The gradient that keeps white text readable on an image (the landing hero on mobile). */
--image-shade: #000000;
--text-primary: var(--slate-900);
--text-secondary: var(--slate-600);
--text-tertiary: var(--slate-500);
@ -308,7 +285,6 @@
--color-surface-inverse: var(--surface-inverse);
--color-scrim: var(--scrim);
--color-lightbox: var(--lightbox);
--color-image-shade: var(--image-shade);
--color-text-primary: var(--text-primary);
--color-text-secondary: var(--text-secondary);
--color-text-tertiary: var(--text-tertiary);

View File

@ -10,11 +10,6 @@ export const TEXT_SIZES = [
'label',
'caption',
'micro',
'hero',
'hero-md',
'hero-lg',
'section',
'section-lg',
] as const;
export const SHADOWS = [
@ -37,13 +32,7 @@ export const NAMED_SPACING = [
] as const;
/** Container widths from theme.css, used as `w-*` and `max-w-*`. */
export const CONTAINERS = [
'mobile',
'checkout',
'form',
'content',
'page',
] as const;
export const CONTAINERS = ['mobile', 'checkout', 'form', 'content'] as const;
/** z-index layers from utilities.css, so `z-overlay` replaces `z-sticky`. */
export const Z_LAYERS = [

View File

@ -1,26 +0,0 @@
'use client';
import { useRouter } from 'next/navigation';
import { useEffect } from 'react';
import { useViewerStatus } from '../../../stores/auth';
import { useHomeHref } from '../../navigation/hooks/use-home-href';
/**
* The landing is for guests and is prerendered the same for everyone (0026), so the server can't
* send a signed-in person on. Once the browser knows them, they go to their home in place: خانه, a
* creator's own channel, or registration step 5 (0027). A guest, or an expired session, stays.
* Renders nothing; the landing shows meanwhile, because hiding it would cost every guest its
* first paint.
*/
export function LandingRedirect() {
const status = useViewerStatus();
const homeHref = useHomeHref();
const router = useRouter();
useEffect(() => {
if (status === 'member') router.replace(homeHref);
}, [status, homeHref, router]);
return null;
}

View File

@ -1 +0,0 @@
export { LandingRedirect } from './LandingRedirect';

View File

@ -13,7 +13,6 @@ import { useTranslation } from 'react-i18next';
import { useCurrentAccount, useViewerStatus } from '../../../../stores/auth';
import { SupportEntry } from '../../../screens/organisms/support-entry';
import { activeTab } from '../../active-tab';
import { useHomeHref } from '../../hooks/use-home-href';
import { loginRoute, ROUTES } from '../../navigation';
import { PublishMenu } from '../publish-menu';
import { HeaderNavLink } from './components/HeaderNavLink';
@ -32,7 +31,6 @@ export function DesktopHeader() {
const pathname = usePathname();
const isCreator = account?.role === 'creator';
const active = activeTab(pathname, isCreator ? account.username : null);
const homeHref = useHomeHref();
return (
<FlexBox
@ -43,9 +41,8 @@ export function DesktopHeader() {
>
<Typography
tag={NextLink}
// Straight to the viewer's home (a creator's is their channel, a guest's the landing), so
// there is no خانه to bounce off.
href={homeHref}
// A creator's home tab is their channel; going there directly leaves no `/` to bounce off.
href={isCreator ? ROUTES.channel(account.username) : ROUTES.home}
aria-label={t('nav.brand-home')}
variant="heading-sm"
color="brand"

View File

@ -12,7 +12,6 @@ import { useTranslation } from 'react-i18next';
import { useCurrentAccount, useViewerStatus } from '../../../../stores/auth';
import { SupportEntry } from '../../../screens/organisms/support-entry';
import { useHomeHref } from '../../hooks/use-home-href';
import { useIsOwnPreview } from '../../hooks/use-is-own-preview';
import { loginRoute, ROUTES } from '../../navigation';
import { BackButton } from './components/BackButton';
@ -26,8 +25,7 @@ import type { MobileTopBarProps } from './types';
* when it has one («داشبورد»; خانه has none), support and the member's account (Main A, U8 ۴.۱).
* Who is looking is known only in the browser, so the server and the first browser render show a
* tab's bar with its brand and name and a placeholder where the account goes, and a pushed page's
* bar without its start. A creator's brand goes to their own channel, their home tab, and a
* guest's to the landing.
* bar without its start. A creator's brand goes to their own channel, their home tab.
*/
export function MobileTopBar({
title,
@ -41,7 +39,6 @@ export function MobileTopBar({
const account = useCurrentAccount();
const pathname = usePathname();
const isPreview = useIsOwnPreview();
const homeHref = useHomeHref();
// While the viewer is unknown, account is null, so only a tab's main screen gets the tab bar.
const isTabBar = isTab || (account != null && account.id === tabOwnerId);
@ -61,7 +58,11 @@ export function MobileTopBar({
<Brand
label={t('nav.brand')}
homeLabel={t('nav.brand-home')}
href={homeHref}
href={
account?.role === 'creator'
? ROUTES.channel(account.username)
: ROUTES.home
}
/>
)}
{status !== 'guest' && isTab && title && (

View File

@ -3,7 +3,7 @@
import { Button } from '@lumina/island/atoms/button';
import { useRouter } from 'next/navigation';
import { useHomeHref } from '../../../hooks/use-home-href';
import { ROUTES } from '../../../navigation';
import type { BackButtonProps } from '../types';
/**
@ -12,7 +12,6 @@ import type { BackButtonProps } from '../types';
*/
export function BackButton({ label, onBack }: BackButtonProps) {
const router = useRouter();
const homeHref = useHomeHref();
return (
<Button
variant="ghost"
@ -21,7 +20,7 @@ export function BackButton({ label, onBack }: BackButtonProps) {
onClick={() => {
if (onBack) onBack();
else if (window.history.length > 1) router.back();
else router.push(homeHref);
else router.push(ROUTES.home);
}}
/>
);

View File

@ -7,9 +7,6 @@ export const CHANNEL_ROUTE_PREFIX = '/channels/';
/** `?preview=visitor|subscriber`: the creator's preview of their own post as others see it (C5 §6). */
export const PREVIEW_PARAM = 'preview';
/** Registration's query parameter that pre-selects the account type: `investor` or `creator`. */
export const ROLE_PARAM = 'role';
/** Login's query parameter naming the channel a guest wants to subscribe to. */
export const SUBSCRIBE_PARAM = 'subscribe';

View File

@ -2,10 +2,10 @@ import { useSearchParams } from 'next/navigation';
import { useMemo } from 'react';
import * as v from 'valibot';
import type { SignedInViewer, UserRole } from '../../../features/auth';
import { ACCOUNT_TYPES, usernameSchema } from '../../../shared/validations';
import { ROLE_PARAM, SUBSCRIBE_PARAM } from '../constants';
import { homeRoute, ROUTES, withReturnPath } from '../navigation';
import type { SignedInViewer } from '../../../features/auth';
import { usernameSchema } from '../../../shared/validations';
import { SUBSCRIBE_PARAM } from '../constants';
import { ROUTES, withReturnPath } from '../navigation';
import { safeReturnPath } from '../return-path';
import type { AuthRoutes } from '../types';
@ -24,12 +24,6 @@ function toSubscribeUsername(
: null;
}
/** `?role=` when it names an account type (the landing's «ثبت‌نام» links), else `null`. */
function toChosenRole(role: string | null): UserRole | null {
const parsed = v.safeParse(v.picklist(ACCOUNT_TYPES), role);
return parsed.success ? parsed.output : null;
}
/**
* Every login and registration step's path, each keeping `?redirect=`, and where a person lands
* once signed in. Browser only: the auth pages render their steps in the browser.
@ -38,7 +32,6 @@ export function useAuthRoutes(): AuthRoutes {
const params = useSearchParams();
const redirect = params.get('redirect');
const subscribe = params.get(SUBSCRIBE_PARAM);
const role = params.get(ROLE_PARAM);
return useMemo(() => {
const step = (path: string) => withReturnPath(path, redirect);
@ -57,13 +50,12 @@ export function useAuthRoutes(): AuthRoutes {
creator: step(ROUTES.onboarding.creatorProfile),
creatorDone: step(ROUTES.onboarding.creatorProfileDone),
},
landing: (viewer: SignedInViewer) => {
if (viewer.needsProfile) return step(ROUTES.onboarding.creatorProfile);
landing: ({ role, username, needsProfile }: SignedInViewer) => {
if (needsProfile) return step(ROUTES.onboarding.creatorProfile);
if (redirect) return safeReturnPath(redirect);
return homeRoute(viewer);
return role === 'creator' ? ROUTES.channel(username) : ROUTES.home;
},
subscribeTo: toSubscribeUsername(subscribe, redirect),
chosenRole: toChosenRole(role),
};
}, [redirect, subscribe, role]);
}, [redirect, subscribe]);
}

View File

@ -1,24 +0,0 @@
import {
useCurrentAccount,
useNeedsProfile,
useViewerStatus,
} from '../../../stores/auth';
import { homeRoute, ROUTES } from '../navigation';
/**
* Where «home» is for the viewer: the landing for a guest, and `homeRoute` for a member (step 5,
* a creator's own channel, or خانه). While the viewer is still unknown, خانه, which sends each one
* on. The brand links and back with no history share it.
*/
export function useHomeHref(): string {
const status = useViewerStatus();
const account = useCurrentAccount();
const needsProfile = useNeedsProfile();
if (status === 'guest') return ROUTES.landing;
if (!account) return ROUTES.home;
return homeRoute({
role: account.role,
username: account.username,
needsProfile,
});
}

View File

@ -2,13 +2,10 @@ export { BottomNav } from './components/bottom-nav';
export { DesktopHeader } from './components/desktop-header';
export { MobileTopBar } from './components/mobile-top-bar';
export type { MobileTopBarProps } from './components/mobile-top-bar';
export { CHANNEL_PREFIX, PREVIEW_PARAM, ROLE_PARAM } from './constants';
export { CHANNEL_PREFIX, PREVIEW_PARAM } from './constants';
export { useAuthRoutes } from './hooks/use-auth-routes';
export { useHomeHref } from './hooks/use-home-href';
export {
homeRoute,
loginRoute,
registerRoute,
ROUTES,
subscribeLoginRoute,
withReturnPath,

View File

@ -1,15 +1,11 @@
import type { SignedInViewer, UserRole } from '../../features/auth';
import { CHANNEL_PREFIX, ROLE_PARAM, SUBSCRIBE_PARAM } from './constants';
import { CHANNEL_PREFIX, SUBSCRIBE_PARAM } from './constants';
const channel = (username: string) =>
`${CHANNEL_PREFIX}${encodeURIComponent(username)}`;
/** Every route path in bull and bear, which share one URL tree. Build links only from here. */
export const ROUTES = {
/** The guest landing; a signed-in person is sent on to their home in the browser. */
landing: '/',
/** خانه, the investor's feed of the creators they follow. */
home: '/feed',
home: '/',
login: '/auth/login',
loginVerify: '/auth/login/verify',
/** After a valid code for a suspended account: no session, only support. */
@ -62,26 +58,6 @@ export function subscribeLoginRoute(username: string): string {
return `${loginRoute(channel(username))}&${SUBSCRIBE_PARAM}=${encodeURIComponent(username)}`;
}
/** Registration step 1, with the account type already chosen when `role` is given (the landing). */
export function registerRoute(role?: UserRole): string {
return role
? `${ROUTES.register.type}?${ROLE_PARAM}=${role}`
: ROUTES.register.type;
}
/**
* Where a signed-in person belongs: registration step 5 for a creator who left it, a creator's own
* channel (their home tab), and خانه for an investor.
*/
export function homeRoute({
role,
username,
needsProfile,
}: SignedInViewer): string {
if (needsProfile) return ROUTES.onboarding.creatorProfile;
return role === 'creator' ? channel(username) : ROUTES.home;
}
/**
* An auth step's path that keeps `?redirect=`, so every step of login and registration returns
* to the page that asked for it.

View File

@ -1,4 +1,4 @@
import type { SignedInViewer, UserRole } from '../../features/auth';
import type { SignedInViewer } from '../../features/auth';
/** The auth steps' paths with `?redirect=` kept, and where a signed-in person lands. */
export type AuthRoutes = {
@ -16,8 +16,6 @@ export type AuthRoutes = {
landing: (viewer: SignedInViewer) => string;
/** The channel's username when a guest came to log in from «اشتراک», else `null`. */
subscribeTo: string | null;
/** The account type `?role=` pre-selects on registration step 1, else `null`. */
chosenRole: UserRole | null;
};
/** The bottom nav's and the desktop header's tabs; a page belongs to the one it was pushed from. */

View File

@ -24,9 +24,8 @@ const ACCOUNT_TYPES = [
] as const satisfies readonly { value: UserRole; icon: string }[];
/**
* Registration step 1: two cards, one line each on what the account is for, nothing pre-selected
* unless the link chose a type (`?role=`). The account type can't change later, so the note says
* so before the choice.
* Registration step 1: two cards, one line each on what the account is for, nothing
* pre-selected. The account type can't change later, so the note says so before the choice.
*/
export function RegisterTypeStep({
size,
@ -35,9 +34,7 @@ export function RegisterTypeStep({
const { t } = useTranslation('auth');
const routes = useAuthRoutes();
const { form, submit } = useRegisterTypePage({
typeHref: routes.register.type,
phoneHref: routes.register.phone,
initialRole: routes.chosenRole,
});
const role = useWatch({ control: form.control, name: 'role' });

View File

@ -1,57 +0,0 @@
import { FlexBox } from '@lumina/island/atoms/flex-box';
import { Typography } from '@lumina/island/atoms/typography';
import { SectionHeading } from '@lumina/island/molecules/section-heading';
import { Element } from '@lumina/island/primitives/element';
import { AnalystCard } from './components/AnalystCard';
import { AnalystCarousel } from './components/AnalystCarousel';
import type { FeaturedAnalystsProps } from './types';
/**
* تحلیلگران: the analysts Lumina features, live, in the admin's order: no ranking and no «برترین».
* A swipe row on the phone, two then three cards with arrows from 720px, and a note under it on
* who chooses them and that past results promise nothing.
*/
export function FeaturedAnalysts({
titleId,
creators,
labels,
}: FeaturedAnalystsProps) {
return (
<FlexBox direction="flex-col" gap="gap-4">
<AnalystCarousel
heading={
<SectionHeading
titleId={titleId}
kicker={labels.kicker}
title={labels.title}
lead={labels.lead}
/>
}
listLabel={labels.list}
previousLabel={labels.previous}
nextLabel={labels.next}
>
{creators.map((creator) => (
<FlexBox
key={creator.username}
tag="li"
className="w-4/5 max-w-80 flex-none snap-start tablet:w-[calc((100%-1rem)/2)] tablet:max-w-none desktop:w-[calc((100%-2rem)/3)]"
>
<AnalystCard creator={creator} labels={labels.card} />
</FlexBox>
))}
</AnalystCarousel>
<FlexBox alignItems="items-start" gap="gap-2">
<Element
tag="span"
aria-hidden
className="mt-2 size-2 flex-none rounded-full bg-success"
/>
<Typography variant="caption" color="secondary">
{labels.note}
</Typography>
</FlexBox>
</FlexBox>
);
}

View File

@ -1,146 +0,0 @@
import { Avatar } from '@lumina/island/atoms/avatar';
import { FlexBox } from '@lumina/island/atoms/flex-box';
import { GridBox } from '@lumina/island/atoms/grid-box';
import { Icon } from '@lumina/island/atoms/icon';
import { Tag } from '@lumina/island/atoms/tag';
import { Typography } from '@lumina/island/atoms/typography';
import { Card } from '@lumina/island/molecules/card';
import { Element } from '@lumina/island/primitives/element';
import { number, percent, signedPercent } from '@lumina/tools/format';
import NextLink from 'next/link';
import { ROUTES } from '../../../../../navigation/navigation';
import type { AnalystCardProps } from '../types';
/**
* One featured analyst, linking to their public channel: avatar, name with the verified mark,
* @username, market tags, a two-line bio and three outcome tiles. Never follower or subscriber
* counts, or prices. Page-only: a second screen that needs it moves it into island first.
*/
export function AnalystCard({ creator, labels }: AnalystCardProps) {
const name = creator.displayName ?? `@${creator.username}`;
const roi = creator.stats.avgRoiPercent;
const stats = [
{
key: 'win-rate',
label: labels.winRate,
value: percent(creator.stats.winRate),
},
{
key: 'predictions',
label: labels.predictions,
value: number(creator.stats.totalPredictions),
},
{
key: 'avg-roi',
label: labels.avgRoi,
value: signedPercent(roi),
color: roi > 0 ? 'success' : roi < 0 ? 'danger' : 'primary',
},
] as const;
return (
<Card
tag={NextLink}
href={ROUTES.channel(creator.username)}
aria-label={labels.open(name)}
interactive
padding="none"
className="flex-1 no-underline"
>
<FlexBox direction="flex-col" gap="gap-3" className="h-full p-5">
<FlexBox alignItems="items-center" gap="gap-3">
<Avatar name={creator.username} src={creator.avatarUrl} size="lg" />
<FlexBox direction="flex-col" className="min-w-0">
<FlexBox alignItems="items-center" gap="gap-1">
<Typography
tag="span"
variant="heading-sm"
className="truncate font-bold"
>
{name}
</Typography>
{creator.verified && (
<Icon
name="check-circle"
size={16}
label={labels.verified}
className="flex-none text-action-primary"
/>
)}
</FlexBox>
{creator.displayName && (
<Typography
tag="span"
variant="caption"
color="secondary"
className="self-start"
>
<Element tag="bdi" dir="ltr">
@{creator.username}
</Element>
</Typography>
)}
</FlexBox>
</FlexBox>
{creator.markets.length > 0 && (
<FlexBox
tag="ul"
aria-label={labels.markets}
wrap="flex-wrap"
className="gap-1.5"
>
{creator.markets.map((market) => (
<Element tag="li" key={market}>
<Tag>{labels.marketNames[market]}</Tag>
</Element>
))}
</FlexBox>
)}
<Typography
variant="body-sm"
color="secondary"
className="line-clamp-2 min-h-12"
>
{creator.bio}
</Typography>
<GridBox tag="dl" cols="grid-cols-3" gap="gap-2">
{stats.map((stat) => (
<FlexBox
key={stat.key}
direction="flex-col-reverse"
className="gap-0.5 rounded-md bg-surface-sunken p-2.5"
>
<Typography tag="dt" variant="micro" color="secondary">
{stat.label}
</Typography>
<Typography
tag="dd"
variant="heading-sm"
color={'color' in stat ? stat.color : 'primary'}
className="m-0 font-bold"
>
{stat.value}
</Typography>
</FlexBox>
))}
</GridBox>
<FlexBox
alignItems="items-center"
gap="gap-1"
className="mt-auto text-action-primary"
>
<Typography
tag="span"
variant="label"
color="inherit"
className="font-bold"
>
{labels.view}
</Typography>
<Icon name="chevron-left" size={16} />
</FlexBox>
</FlexBox>
</Card>
);
}

View File

@ -1,73 +0,0 @@
'use client';
import { Button } from '@lumina/island/atoms/button';
import { FlexBox } from '@lumina/island/atoms/flex-box';
import { useRef } from 'react';
import type { AnalystCarouselProps } from '../types';
/**
* A scroll-snap row of cards that swipes on the phone, where the next card peeks. From 720px two
* arrows beside the heading move it by about a screen; «بعدی» goes the way the page reads.
*/
export function AnalystCarousel({
heading,
listLabel,
previousLabel,
nextLabel,
children,
}: AnalystCarouselProps) {
const trackRef = useRef<HTMLUListElement>(null);
const slide = (direction: 1 | -1) => {
const track = trackRef.current;
if (!track) return;
const rtl = getComputedStyle(track).direction === 'rtl';
const reduce = window.matchMedia(
'(prefers-reduced-motion: reduce)',
).matches;
track.scrollBy({
left: direction * (rtl ? -1 : 1) * track.clientWidth * 0.9,
behavior: reduce ? 'auto' : 'smooth',
});
};
return (
<FlexBox direction="flex-col" gap="gap-6">
<FlexBox
alignItems="items-end"
justifyContent="justify-between"
gap="gap-4"
>
{heading}
<FlexBox
alignItems="items-center"
gap="gap-2"
className="hidden flex-none tablet:flex"
>
<Button
variant="secondary"
icon="chevron-right"
label={previousLabel}
onClick={() => slide(-1)}
/>
<Button
variant="secondary"
icon="chevron-left"
label={nextLabel}
onClick={() => slide(1)}
/>
</FlexBox>
</FlexBox>
<FlexBox
ref={trackRef}
tag="ul"
aria-label={listLabel}
gap="gap-3"
className="-mx-4 snap-x snap-mandatory scroll-px-4 overflow-x-auto px-4 pt-1 pb-2 [scrollbar-width:none] tablet:-mx-8 tablet:scroll-px-8 tablet:gap-4 tablet:px-8 desktop:mx-0 desktop:scroll-px-0 desktop:px-0"
>
{children}
</FlexBox>
</FlexBox>
);
}

View File

@ -1,2 +0,0 @@
export { FeaturedAnalysts } from './FeaturedAnalysts';
export type { FeaturedAnalystsLabels, FeaturedAnalystsProps } from './types';

View File

@ -1,53 +0,0 @@
import type { ReactNode } from 'react';
import type { FeaturedCreatorPayload } from '../../../../../features/channel';
import type { Market } from '../../../../../shared/constants';
export type FeaturedAnalystsLabels = {
kicker: string;
title: string;
lead: string;
/** The card list's accessible name: «تحلیلگران». */
list: string;
/** The arrows' accessible names: «تحلیلگران قبلی», «تحلیلگران بعدی». */
previous: string;
next: string;
/** Who chooses them, and that past results promise nothing. */
note: string;
card: {
/** The card link's accessible name: `(name) => «کانال سارا مرادی»`. */
open: (name: string) => string;
/** The verified mark's accessible name: «تأییدشده». */
verified: string;
/** The market list's accessible name: «بازارهای تخصصی». */
markets: string;
marketNames: Record<Market, string>;
winRate: string;
predictions: string;
avgRoi: string;
/** «مشاهده کانال». */
view: string;
};
};
export type FeaturedAnalystsProps = {
titleId: string;
/** Three or more, in the admin's order; the template hides the section otherwise. */
creators: FeaturedCreatorPayload[];
labels: FeaturedAnalystsLabels;
};
export type AnalystCardProps = {
creator: FeaturedCreatorPayload;
labels: FeaturedAnalystsLabels['card'];
};
export type AnalystCarouselProps = {
/** The section heading, beside the arrows. */
heading: ReactNode;
listLabel: string;
previousLabel: string;
nextLabel: string;
/** The cards, each in its `li`. */
children: ReactNode;
};

View File

@ -1,50 +0,0 @@
import { Button } from '@lumina/island/atoms/button';
import { FlexBox } from '@lumina/island/atoms/flex-box';
import { Typography } from '@lumina/island/atoms/typography';
import NextLink from 'next/link';
import type { LandingClosingProps } from './types';
/** The closing call to action on a dark band: the title, one line, registration again and login. */
export function LandingClosing({
titleId,
registerHref,
loginHref,
labels,
}: LandingClosingProps) {
return (
<FlexBox
direction="flex-col"
alignItems="items-center"
gap="gap-3"
className="rounded-xl bg-surface-inverse px-5 py-9 text-center tablet:px-10 tablet:py-14"
>
<Typography tag="h2" id={titleId} variant="section" color="inverse">
{labels.title}
</Typography>
<Typography color="inverse" className="max-w-130 opacity-80">
{labels.lead}
</Typography>
<FlexBox
direction="flex-col"
className="mt-2 w-full max-w-90 tablet:w-auto tablet:max-w-none tablet:flex-row"
>
<Button variant="primary" size="lg" href={registerHref}>
{labels.register}
</Button>
</FlexBox>
<Typography color="inverse">
{labels.hasAccount}{' '}
<Typography
tag={NextLink}
href={loginHref}
variant="inherit"
color="inverse"
className="rounded-xs font-bold underline underline-offset-4 focus-visible:focus-ring-inverse"
>
{labels.login}
</Typography>
</Typography>
</FlexBox>
);
}

View File

@ -1,2 +0,0 @@
export { LandingClosing } from './LandingClosing';
export type { LandingClosingLabels, LandingClosingProps } from './types';

View File

@ -1,16 +0,0 @@
export type LandingClosingLabels = {
title: string;
lead: string;
/** «ثبت‌نام رایگان», the hero's action again. */
register: string;
/** «حساب کاربری دارید؟» before «ورود». */
hasAccount: string;
login: string;
};
export type LandingClosingProps = {
titleId: string;
registerHref: string;
loginHref: string;
labels: LandingClosingLabels;
};

View File

@ -1,68 +0,0 @@
import { FlexBox } from '@lumina/island/atoms/flex-box';
import { Icon } from '@lumina/island/atoms/icon';
import { Typography } from '@lumina/island/atoms/typography';
import { SectionHeading } from '@lumina/island/molecules/section-heading';
import { Element } from '@lumina/island/primitives/element';
import { SupportEntry } from '../../../organisms/support-entry';
import { FAQ_ITEMS } from './constants';
import type { LandingFaqProps } from './types';
/**
* سؤالات متداول: native details and summary, so every answer is in the HTML and opens with no
* JavaScript; the first is open. Support is under the list.
*/
export function LandingFaq({
titleId,
supportPlacement,
labels,
}: LandingFaqProps) {
return (
<FlexBox direction="flex-col" className="gap-7 desktop:gap-10">
<SectionHeading titleId={titleId} align="center" title={labels.title} />
<FlexBox
direction="flex-col"
gap="gap-2"
className="mx-auto w-full max-w-190"
>
{FAQ_ITEMS.map((key, index) => (
<Element
key={key}
tag="details"
open={index === 0}
className="group rounded-lg border border-border-subtle bg-surface"
>
<FlexBox
tag="summary"
alignItems="items-center"
gap="gap-3"
className="min-h-14 cursor-pointer list-none rounded-lg px-4 py-3.5 focus-visible:focus-ring [&::-webkit-details-marker]:hidden"
>
<Typography tag="span" variant="body-md" className="font-bold">
{labels.items[key].question}
</Typography>
<Icon
name="chevron-down"
className="ms-auto flex-none text-text-secondary transition-transform duration-200 ease-standard group-open:rotate-180"
/>
</FlexBox>
<Typography color="secondary" className="px-4 pb-4 text-pretty">
{labels.items[key].answer}
</Typography>
</Element>
))}
</FlexBox>
<FlexBox
alignItems="items-center"
justifyContent="justify-center"
wrap="flex-wrap"
gap="gap-1"
>
<Typography tag="span" color="secondary">
{labels.more}
</Typography>
<SupportEntry trigger="link" placement={supportPlacement} />
</FlexBox>
</FlexBox>
);
}

View File

@ -1,14 +0,0 @@
/** The FAQ's questions in order; the first is open. The FAQPage JSON-LD uses the same list. */
export const FAQ_ITEMS = [
'follow-cost',
'outcome',
'delete-loss',
'hidden-record',
'payment',
'expiry',
'suspension',
'advice',
'become-analyst',
] as const;
export type FaqItemKey = (typeof FAQ_ITEMS)[number];

View File

@ -1,9 +0,0 @@
import { FAQ_ITEMS } from './constants';
import type { LandingFaqLabels } from './types';
/** The questions in the page's order, for the FAQPage structured data: the same list it shows. */
export function faqEntries(
labels: LandingFaqLabels,
): { question: string; answer: string }[] {
return FAQ_ITEMS.map((key) => labels.items[key]);
}

View File

@ -1,3 +0,0 @@
export { faqEntries } from './faq-entries';
export { LandingFaq } from './LandingFaq';
export type { LandingFaqLabels, LandingFaqProps } from './types';

View File

@ -1,15 +0,0 @@
import type { FaqItemKey } from './constants';
export type LandingFaqLabels = {
title: string;
items: Record<FaqItemKey, { question: string; answer: string }>;
/** Before the support link: «پاسخ سؤالتان را پیدا نکردید؟». */
more: string;
};
export type LandingFaqProps = {
titleId: string;
/** How support opens: a bottom sheet on mobile, a popover on desktop. */
supportPlacement: 'bottom' | 'popover';
labels: LandingFaqLabels;
};

View File

@ -1,125 +0,0 @@
import { FlexBox } from '@lumina/island/atoms/flex-box';
import { GridBox } from '@lumina/island/atoms/grid-box';
import { Typography } from '@lumina/island/atoms/typography';
import { Element } from '@lumina/island/primitives/element';
import { supportChatUrls } from '../../../organisms/support-entry';
import { FooterLink } from './components/FooterLink';
import type { LandingFooterProps } from './types';
/**
* The footer: the brand line, the section links, terms and the support chats (the support sheet's
* handles), the disclaimer and the copyright. The e-Namad seal joins the columns once it exists;
* until then nothing stands in for it.
*/
export function LandingFooter({
topId,
sections,
termsHref,
siteHost,
labels,
}: LandingFooterProps) {
const chats = supportChatUrls();
return (
<Element
tag="footer"
className="border-t border-border-subtle bg-bg-page py-8"
>
<FlexBox
direction="flex-col"
gap="gap-6"
className="mx-auto max-w-page px-4 tablet:px-8"
>
<GridBox
cols="grid-cols-2"
xGap="gap-x-4"
yGap="gap-y-6"
className="tablet:grid-cols-[2fr_1fr_1fr]"
>
<FlexBox
direction="flex-col"
className="col-span-2 gap-1.5 tablet:col-span-1"
>
<Typography
tag="a"
href={`#${topId}`}
aria-label={labels.brandHome}
variant="heading-md"
color="brand"
className="self-start rounded-xs no-underline focus-visible:focus-ring"
>
{labels.brand}
</Typography>
<Typography variant="body-sm" color="secondary">
{labels.tagline}
</Typography>
</FlexBox>
<FlexBox
tag="nav"
aria-label={labels.product}
direction="flex-col"
className="gap-0.5"
>
<Typography
variant="caption"
color="secondary"
className="mb-1 font-bold"
>
{labels.product}
</Typography>
{sections.map((section) => (
<FooterLink key={section.id} href={`#${section.id}`}>
{section.label}
</FooterLink>
))}
</FlexBox>
<FlexBox
tag="nav"
aria-label={labels.support}
direction="flex-col"
className="gap-0.5"
>
<Typography
variant="caption"
color="secondary"
className="mb-1 font-bold"
>
{labels.support}
</Typography>
<FooterLink href={termsHref}>{labels.terms}</FooterLink>
<FooterLink
href={chats.bale}
icon="bale"
opensNewTab={labels.opensNewTab}
>
{labels.bale}
</FooterLink>
<FooterLink
href={chats.telegram}
icon="telegram"
opensNewTab={labels.opensNewTab}
>
{labels.telegram}
</FooterLink>
</FlexBox>
</GridBox>
<FlexBox
direction="flex-col"
className="gap-1.5 border-t border-border-subtle pt-5"
>
<Typography variant="caption" color="secondary">
{labels.disclaimer}
</Typography>
<Typography variant="caption" color="secondary">
{labels.copyright}
{' · '}
<Element tag="bdi" dir="ltr">
{siteHost}
</Element>
</Typography>
</FlexBox>
</FlexBox>
</Element>
);
}

View File

@ -1,61 +0,0 @@
import { FlexBox } from '@lumina/island/atoms/flex-box';
import { Icon } from '@lumina/island/atoms/icon';
import { Typography } from '@lumina/island/atoms/typography';
import NextLink from 'next/link';
import type { FooterLinkProps } from '../types';
const LINK_CLASSES =
'min-h-touch-target self-start rounded-xs text-text-primary no-underline transition-colors duration-120 ease-standard hover:text-action-primary focus-visible:focus-ring';
/**
* A footer link with a 44px hit area: a route through NextLink, a section anchor or an outside
* chat, which opens in a new tab and says so to screen readers.
*/
export function FooterLink({
href,
icon,
opensNewTab,
children,
}: FooterLinkProps) {
const content = (
<>
{icon && <Icon name={icon} />}
<Typography tag="span" variant="body-md" color="inherit">
{children}
</Typography>
{opensNewTab && (
<Typography tag="span" className="sr-only">
{opensNewTab}
</Typography>
)}
</>
);
if (href.startsWith('/')) {
return (
<FlexBox
tag={NextLink}
href={href}
alignItems="items-center"
gap="gap-2"
className={LINK_CLASSES}
>
{content}
</FlexBox>
);
}
return (
<FlexBox
tag="a"
href={href}
target={opensNewTab ? '_blank' : undefined}
rel={opensNewTab ? 'noopener noreferrer' : undefined}
alignItems="items-center"
gap="gap-2"
className={LINK_CLASSES}
>
{content}
</FlexBox>
);
}

View File

@ -1,2 +0,0 @@
export { LandingFooter } from './LandingFooter';
export type { LandingFooterLabels, LandingFooterProps } from './types';

View File

@ -1,39 +0,0 @@
import type { IconName } from '@lumina/island/atoms/icon';
import type { ReactNode } from 'react';
import type { LandingSectionLink } from '../landing-header';
export type LandingFooterLabels = {
brand: string;
brandHome: string;
tagline: string;
/** The columns' headings and accessible names: «لومینا», «پشتیبانی». */
product: string;
support: string;
terms: string;
bale: string;
telegram: string;
/** After each external link, for screen readers. */
opensNewTab: string;
disclaimer: string;
copyright: string;
};
export type LandingFooterProps = {
topId: string;
/** The product column's section links. */
sections: LandingSectionLink[];
termsHref: string;
/** The site's address without the scheme: «lumina.ir». */
siteHost: string;
labels: LandingFooterLabels;
};
export type FooterLinkProps = {
/** A route (`/terms/…`), a section anchor (`#faq`) or an outside address. */
href: string;
icon?: IconName;
/** An outside link: it opens in a new tab, and this is read after its name. */
opensNewTab?: string;
children: ReactNode;
};

View File

@ -1,90 +0,0 @@
import { Button } from '@lumina/island/atoms/button';
import { FlexBox } from '@lumina/island/atoms/flex-box';
import { GridBox } from '@lumina/island/atoms/grid-box';
import { Icon } from '@lumina/island/atoms/icon';
import { Typography } from '@lumina/island/atoms/typography';
import { SampleFrame } from '@lumina/island/molecules/sample-frame';
import { SectionHeading } from '@lumina/island/molecules/section-heading';
import { ChannelSample } from './components/ChannelSample';
import { ANALYST_FEATURES } from './constants';
import type { LandingForAnalystsProps } from './types';
/**
* برای تحلیلگران, on a tinted panel: four things a creator gets, the apply action and its approval
* note, and from 720px a sample channel with the prices its analyst set.
*/
export function LandingForAnalysts({
titleId,
applyHref,
labels,
}: LandingForAnalystsProps) {
return (
<GridBox
cols="grid-cols-1"
alignItems="items-start"
className="gap-7 rounded-xl border border-action-primary-muted bg-action-primary-subtle px-5 py-7 tablet:p-10 desktop:grid-cols-2 desktop:items-center desktop:gap-14 desktop:p-14"
>
<FlexBox direction="flex-col" gap="gap-5">
<SectionHeading
titleId={titleId}
kicker={labels.kicker}
kickerIcon="analyst"
title={labels.title}
lead={labels.lead}
/>
<GridBox
tag="ul"
cols="grid-cols-1"
gap="gap-4"
className="mt-1 mb-1 tablet:grid-cols-2 tablet:gap-x-6 tablet:gap-y-5 desktop:grid-cols-1 desktop:gap-4"
>
{ANALYST_FEATURES.map(({ key, icon }) => (
<FlexBox key={key} tag="li" alignItems="items-start" gap="gap-3">
<GridBox
justifyItems="justify-items-center"
alignItems="items-center"
className="size-touch-target flex-none rounded-md bg-surface text-action-primary"
>
<Icon name={icon} size={24} />
</GridBox>
<FlexBox direction="flex-col" className="gap-0.5">
<Typography tag="h3" variant="body-md" className="font-bold">
{labels.features[key].title}
</Typography>
<Typography variant="body-sm" color="secondary">
{labels.features[key].description}
</Typography>
</FlexBox>
</FlexBox>
))}
</GridBox>
<FlexBox
direction="flex-col"
gap="gap-2"
className="tablet:flex-row tablet:items-center tablet:gap-4"
>
<Button
variant="primary"
size="lg"
href={applyHref}
className="flex-none"
>
{labels.apply}
</Button>
<Typography variant="caption" color="secondary">
{labels.applyNote}
</Typography>
</FlexBox>
</FlexBox>
<SampleFrame
tag={labels.sample}
caption={labels.caption}
tone="surface"
className="hidden tablet:flex"
>
<ChannelSample labels={labels.channel} />
</SampleFrame>
</GridBox>
);
}

View File

@ -1,75 +0,0 @@
import { Amount } from '@lumina/island/atoms/amount';
import { Avatar } from '@lumina/island/atoms/avatar';
import { FlexBox } from '@lumina/island/atoms/flex-box';
import { Icon } from '@lumina/island/atoms/icon';
import { Tag } from '@lumina/island/atoms/tag';
import { Typography } from '@lumina/island/atoms/typography';
import { Card } from '@lumina/island/molecules/card';
import { Element } from '@lumina/island/primitives/element';
import { SAMPLE_CHANNEL } from '../constants';
import type { ChannelSampleProps } from '../types';
/** A made-up channel card with the prices its analyst set, for the «نمونه» frame. */
export function ChannelSample({ labels }: ChannelSampleProps) {
return (
<Card padding="lg">
<FlexBox direction="flex-col" className="gap-3.5">
<FlexBox alignItems="items-center" gap="gap-3">
<Avatar name={SAMPLE_CHANNEL.username} size="lg" />
<FlexBox direction="flex-col" className="min-w-0">
<FlexBox alignItems="items-center" gap="gap-1">
<Typography tag="span" variant="heading-sm" className="font-bold">
{labels.name}
</Typography>
<Icon
name="check-circle"
size={16}
label={labels.verified}
className="text-action-primary"
/>
</FlexBox>
<Typography
tag="span"
variant="caption"
color="secondary"
className="self-start"
>
<Element tag="bdi" dir="ltr">
@{SAMPLE_CHANNEL.username}
</Element>
</Typography>
</FlexBox>
</FlexBox>
<Typography color="secondary">{labels.bio}</Typography>
<FlexBox wrap="flex-wrap" className="gap-1.5">
{SAMPLE_CHANNEL.markets.map((market) => (
<Tag key={market}>{labels.marketNames[market]}</Tag>
))}
</FlexBox>
<FlexBox
direction="flex-col"
className="border-t border-border-subtle pt-1"
>
<Typography variant="heading-sm" className="pt-2 pb-0.5">
{labels.prices}
</Typography>
{SAMPLE_CHANNEL.prices.map(({ period, toman }) => (
<FlexBox
key={period}
alignItems="items-baseline"
justifyContent="justify-between"
gap="gap-3"
className="border-b border-border-subtle py-2 last:border-b-0"
>
<Typography tag="span" color="secondary">
{labels.periods[period]}
</Typography>
<Amount value={toman} currency={labels.currency} />
</FlexBox>
))}
</FlexBox>
</FlexBox>
</Card>
);
}

View File

@ -1,29 +0,0 @@
import type { IconName } from '@lumina/island/atoms/icon';
import type { BillingPeriod, Market } from '../../../../../shared/constants';
/** What a creator gets from Lumina. */
export const ANALYST_FEATURES = [
{ key: 'profile', icon: 'user' },
{ key: 'income', icon: 'wallet' },
{ key: 'record', icon: 'trend-up' },
{ key: 'dashboard', icon: 'dashboard' },
] as const satisfies readonly { key: string; icon: IconName }[];
export type AnalystFeatureKey = (typeof ANALYST_FEATURES)[number]['key'];
/** A made-up channel with the prices its analyst set, in Toman; the name and bio are in the labels. */
export const SAMPLE_CHANNEL = {
username: 'sara_gold',
markets: ['gold', 'forex'],
prices: [
{ period: 'monthly', toman: 400000 },
{ period: 'quarterly', toman: 1080000 },
{ period: 'semi_annual', toman: 1920000 },
{ period: 'yearly', toman: 3360000 },
],
} as const satisfies {
username: string;
markets: readonly Market[];
prices: readonly { period: BillingPeriod; toman: number }[];
};

View File

@ -1,5 +0,0 @@
export { LandingForAnalysts } from './LandingForAnalysts';
export type {
LandingForAnalystsLabels,
LandingForAnalystsProps,
} from './types';

View File

@ -1,39 +0,0 @@
import type { BillingPeriod, Market } from '../../../../../shared/constants';
import type { AnalystFeatureKey } from './constants';
export type LandingForAnalystsLabels = {
kicker: string;
title: string;
lead: string;
features: Record<AnalystFeatureKey, { title: string; description: string }>;
/** «درخواست عضویت تحلیلگر». */
apply: string;
/** Approval comes after identity checks. */
applyNote: string;
/** «نمونه». */
sample: string;
caption: string;
channel: {
name: string;
bio: string;
/** «قیمت طرح‌ها». */
prices: string;
/** «تومان». */
currency: string;
/** The verified mark's accessible name. */
verified: string;
marketNames: Record<Market, string>;
periods: Record<BillingPeriod, string>;
};
};
export type LandingForAnalystsProps = {
titleId: string;
/** Registration with the creator account type chosen. */
applyHref: string;
labels: LandingForAnalystsLabels;
};
export type ChannelSampleProps = {
labels: LandingForAnalystsLabels['channel'];
};

View File

@ -1,96 +0,0 @@
import { Button } from '@lumina/island/atoms/button';
import { FlexBox } from '@lumina/island/atoms/flex-box';
import { Typography } from '@lumina/island/atoms/typography';
import { Element } from '@lumina/island/primitives/element';
import { SupportEntry } from '../../../organisms/support-entry';
import type { LandingHeaderProps } from './types';
/**
* The landing's logged-out bar, sticky: the brand, support and «ورود/ثبت‌نام» (the top-bar rule).
* Login is a text button on the phone and a secondary Button from 720px, because the hero holds
* the page's one primary. On desktop the section links follow the brand.
*/
export function LandingHeader({
layout,
topId,
sections,
loginHref,
labels,
}: LandingHeaderProps) {
const isDesktop = layout === 'desktop';
return (
<Element
tag="header"
className="sticky top-0 z-sticky border-b border-border-subtle bg-surface"
>
<FlexBox
alignItems="items-center"
gap="gap-1"
className="mx-auto h-14 max-w-page ps-4 pe-2 tablet:h-16 tablet:ps-8 tablet:pe-6"
>
<Typography
tag="a"
href={`#${topId}`}
aria-label={labels.brandHome}
variant="heading-md"
color="brand"
className="rounded-xs no-underline focus-visible:focus-ring"
>
{labels.brand}
</Typography>
{isDesktop && (
<FlexBox
tag="nav"
aria-label={labels.sections}
alignItems="items-center"
className="ms-8 gap-0.5"
>
{sections.map((section) => (
<FlexBox
key={section.id}
tag="a"
href={`#${section.id}`}
alignItems="items-center"
className="h-10 rounded-full px-3.5 text-text-secondary no-underline transition-colors duration-120 ease-standard hover:bg-surface-hover hover:text-text-primary focus-visible:focus-ring"
>
<Typography
tag="span"
variant="body-md"
color="inherit"
className="font-semibold"
>
{section.label}
</Typography>
</FlexBox>
))}
</FlexBox>
)}
<FlexBox alignItems="items-center" gap="gap-1" className="ms-auto">
<SupportEntry
trigger="icon"
placement={isDesktop ? 'popover' : 'bottom'}
/>
{!isDesktop && (
<Button
variant="ghost"
size="sm"
href={loginHref}
className="tablet:hidden"
>
{labels.login}
</Button>
)}
<Button
variant="secondary"
href={loginHref}
className={isDesktop ? undefined : 'hidden tablet:inline-flex'}
>
{labels.login}
</Button>
</FlexBox>
</FlexBox>
</Element>
);
}

Some files were not shown because too many files have changed in this diff Show More