From 935d59dab83f070ed146202c7b89571305d543ec Mon Sep 17 00:00:00 2001 From: Amiram_se Date: Thu, 5 Nov 2026 19:08:35 +0400 Subject: [PATCH] feat(dashboard): welcome a new analyst on the overview tab With no audience and no income yet, the figures stay at zero and a banner offers to share the channel, through the caption sheet the channel's own share uses. A channel that isn't public yet says why it can't be shared. Co-Authored-By: Claude Opus 5.5 --- .../organisms/channel-share/index.ts | 1 + .../dashboard-overview/DashboardOverview.tsx | 2 + .../components/WelcomeBanner.tsx | 62 +++++++++++++++++++ .../organisms/dashboard-overview/types.ts | 2 + .../src/shared/locales/fa/dashboard.json | 5 ++ 5 files changed, 72 insertions(+) create mode 100644 platforms/market/src/app/screens/(main)/dashboard/overview/organisms/dashboard-overview/components/WelcomeBanner.tsx diff --git a/platforms/market/src/app/screens/(main)/channels/[username]/organisms/channel-share/index.ts b/platforms/market/src/app/screens/(main)/channels/[username]/organisms/channel-share/index.ts index bd4a4f4..ad7ba8e 100644 --- a/platforms/market/src/app/screens/(main)/channels/[username]/organisms/channel-share/index.ts +++ b/platforms/market/src/app/screens/(main)/channels/[username]/organisms/channel-share/index.ts @@ -1,2 +1,3 @@ export { ChannelShare } from './ChannelShare'; +export { OwnerShareSheet } from './components/OwnerShareSheet'; export type { ChannelShareProps } from './types'; diff --git a/platforms/market/src/app/screens/(main)/dashboard/overview/organisms/dashboard-overview/DashboardOverview.tsx b/platforms/market/src/app/screens/(main)/dashboard/overview/organisms/dashboard-overview/DashboardOverview.tsx index d10725e..1612de7 100644 --- a/platforms/market/src/app/screens/(main)/dashboard/overview/organisms/dashboard-overview/DashboardOverview.tsx +++ b/platforms/market/src/app/screens/(main)/dashboard/overview/organisms/dashboard-overview/DashboardOverview.tsx @@ -7,6 +7,7 @@ import { AudienceSection } from './components/AudienceSection'; import { IncomeSection } from './components/IncomeSection'; import { PlanBreakdown } from './components/PlanBreakdown'; import { SignalSummary } from './components/SignalSummary'; +import { WelcomeBanner } from './components/WelcomeBanner'; import type { DashboardOverviewProps } from './types'; /** داشبورد › نمای کلی (J10-0), the creator's default tab. Loads and fails as one. */ @@ -16,6 +17,7 @@ export function DashboardOverview({ layout }: DashboardOverviewProps) { return ( + {overview.isNewcomer && } diff --git a/platforms/market/src/app/screens/(main)/dashboard/overview/organisms/dashboard-overview/components/WelcomeBanner.tsx b/platforms/market/src/app/screens/(main)/dashboard/overview/organisms/dashboard-overview/components/WelcomeBanner.tsx new file mode 100644 index 0000000..0b15111 --- /dev/null +++ b/platforms/market/src/app/screens/(main)/dashboard/overview/organisms/dashboard-overview/components/WelcomeBanner.tsx @@ -0,0 +1,62 @@ +'use client'; + +import { Button } from '@lumina/island/atoms/button'; +import { FlexBox } from '@lumina/island/atoms/flex-box'; +import { Banner } from '@lumina/island/molecules/banner'; +import { useTranslation } from 'react-i18next'; + +import { + useChannelShareSheet, + useDisplayLink, + useOwnChannel, +} from '../../../../../../../../features/channel'; +import { useCurrentAccount } from '../../../../../../../../stores/auth'; +import { ROUTES } from '../../../../../../../navigation/navigation'; +import { OwnerShareSheet } from '../../../../../channels/[username]/organisms/channel-share'; +import type { WelcomeBannerProps } from '../types'; + +/** + * A new analyst's next step (J10-0b): share the channel, with the caption sheet the channel's own + * share uses. A channel that isn't public yet has nothing to share, so the button says why. + */ +export function WelcomeBanner({ layout }: WelcomeBannerProps) { + const { t } = useTranslation(['dashboard', 'channel']); + const account = useCurrentAccount(); + const own = useOwnChannel(); + const path = ROUTES.channel(account?.username ?? ''); + const channelUrl = useDisplayLink(path) ?? path; + const sheet = useChannelShareSheet({ path, native: layout === 'mobile' }); + const isSuspended = own.status === 'ready' && own.channel.suspended; + const isVerified = own.status === 'ready' && own.standing === 'verified'; + const frozenReason = isSuspended + ? t('channel:share.owner.suspended') + : isVerified + ? undefined + : t('channel:share.owner.pending'); + + return ( + + + {t('overview.welcome.action')} + + } + > + {t('overview.welcome.text')} + + + + ); +} diff --git a/platforms/market/src/app/screens/(main)/dashboard/overview/organisms/dashboard-overview/types.ts b/platforms/market/src/app/screens/(main)/dashboard/overview/organisms/dashboard-overview/types.ts index 1e4e687..cda2f1c 100644 --- a/platforms/market/src/app/screens/(main)/dashboard/overview/organisms/dashboard-overview/types.ts +++ b/platforms/market/src/app/screens/(main)/dashboard/overview/organisms/dashboard-overview/types.ts @@ -23,3 +23,5 @@ export type PlanBreakdownProps = { }; export type SignalSummaryProps = DashboardOverviewProps; + +export type WelcomeBannerProps = DashboardOverviewProps; diff --git a/platforms/market/src/shared/locales/fa/dashboard.json b/platforms/market/src/shared/locales/fa/dashboard.json index 373a168..ff83022 100644 --- a/platforms/market/src/shared/locales/fa/dashboard.json +++ b/platforms/market/src/shared/locales/fa/dashboard.json @@ -263,6 +263,11 @@ "details": "جزئیات در تب سیگنال‌ها", "error": "عملکرد سیگنال‌ها بارگذاری نشد.", "loading": "در حال بارگذاری عملکرد سیگنال‌ها…" + }, + "welcome": { + "title": "کانال خود را معرفی کنید", + "text": "لینک کانال را در تلگرام، اینستاگرام یا هر جای دیگری که مخاطب دارید بگذارید. هر دنبال‌کننده و مشترک تازه اینجا شمرده می‌شود.", + "action": "اشتراک‌گذاری لینک کانال" } } }