diff --git a/packages/storybook/stories/features/snapshot/surfaces/StatusMoments.stories.tsx b/packages/storybook/stories/features/snapshot/surfaces/StatusMoments.stories.tsx index 36d6f2bb65..ebc63ccd5a 100644 --- a/packages/storybook/stories/features/snapshot/surfaces/StatusMoments.stories.tsx +++ b/packages/storybook/stories/features/snapshot/surfaces/StatusMoments.stories.tsx @@ -1,14 +1,18 @@ import React from 'react'; import type { Meta, StoryObj } from '@storybook/react-vite'; +import { QueryClient, QueryClientProvider } from '@tanstack/react-query'; import { Button, ButtonSize, ButtonVariant, } from '@dailydotdev/shared/src/components/buttons/Button'; +import CloseButton from '@dailydotdev/shared/src/components/CloseButton'; +import { DownloadIcon } from '@dailydotdev/shared/src/components/icons/Download'; import { - DownloadIcon, - MiniCloseIcon, -} from '@dailydotdev/shared/src/components/icons'; + ProfileImageSize, + ProfilePicture, +} from '@dailydotdev/shared/src/components/ProfilePicture'; +import { TopRankBadge } from '@dailydotdev/shared/src/components/cards/Leaderboard/TopRankBadge'; import { ART, AVATAR, @@ -18,68 +22,84 @@ import { SurfacePage, Variant, } from '../surfaceChrome'; +import type { StreakMilestone } from '../../../milestone-rewards/data'; +import { StreakTier, streakLadder } from '../../../milestone-rewards/data'; +import { + DayStrip, + EmberPanel, + FlameBadge, + FlameSize, + NoThanks, + TierName, +} from '../../../milestone-rewards/moment'; + +/* --------------------------------------------------- streak celebration */ + +const INFERNO = streakLadder.find( + ({ tier }) => tier === StreakTier.Inferno, +) as StreakMilestone; /** - * NewStreakModal: a reminder switch and close at the top, the fire art with - * the count overlaid in typo-tera, a title, one line of copy, the freeze - * upsell, and an opt-out checkbox. No share control, and no primary button. + * The celebration half of the milestone-rewards popup: tier art over the + * ember wash, the tier name, the count. No embers or staged entrance, since + * this page compares control placement. */ -const StreakScreen = () => ( - -
-
- - - Remind me - -
- - - 🔥 - 100 +const Celebration = () => ( + + + +
+ + + {INFERNO.day} + + day streak +

{INFERNO.headline}

+
+ +
+); - - 100 days streak - -

- New milestone reached! You are unstoppable. -

- - - Protect your streak with streak freezes - +/* -------------------------------------------------------------- surfaces */ - ( + +
+ - - - Never show this again - + + +
+ + + +
); -/** - * AchievementCard: a 48px thumbnail, name and description, then the snapshot - * button and the points. The snapshot is `opacity-0 group-hover:opacity-100`, - * so it is invisible until hover — and permanently invisible on touch. - */ +/** AchievementCard.tsx, the unlock card, with the real achievement. */ const AchievementScreen = () => (
-
+
( Can't spend it all - Hold more than 10,000 cores without spending any of them. + Spend 10000 Cores
@@ -100,32 +120,22 @@ const AchievementScreen = () => ( size={ButtonSize.XSmall} variant={ButtonVariant.Float} /> - - 120 - + 25
- -
- - Progress - 8/10 - - - - -
); -/** - * UserTopList rows: a w-14 tabular score, TopRankBadge, an optional level - * ring, then UserHighlight (32px avatar, caption1 name, caption2 handle). - * The snapshot is `opacity-0 group-hover:opacity-100` at XSmall Float — - * shipped, and invisible on touch. - */ +/** Fictional readers for the rank and awards screens. */ +const PEOPLE: [string, string][] = [ + ['Maya Torres', 'mayatorres'], + ['Jonah Pike', 'jonahpike'], + ['Lena Brandt', 'lenabrandt'], +]; + +/** UserTopList.tsx, the leaderboard rows. */ const RankScreen = () => (
@@ -134,28 +144,19 @@ const RankScreen = () => (
    - {[ - ['Bobby Iliev', 'bobbyiliev', 103], - ['Ante Barić', 'antebaric', 99], - ['Ido Shamun', 'idoshamun', 95], - ].map(([name, handle, score], index) => ( + {PEOPLE.map(([name, handle], index) => (
  1. - - {score} - - - {index === 0 ? '🥇' : `#${index + 1}`} - +
    -
    @@ -183,6 +184,7 @@ const RankScreen = () => ( /* -------------------------------------------------- other win moments */ +/** TopReaderBadgeModal.tsx, download only, no share route. */ const TopReaderScreen = () => (
    @@ -192,9 +194,6 @@ const TopReaderScreen = () => (

    You've earned the top reader badge!

    -

    - Top 1% of readers in #typescript this week -

    @@ -300,12 +248,12 @@ const AwardedScreen = () => ( />
    - {['Bobby Iliev', 'Ante Barić', 'Ido Shamun'].map((name) => ( -
    - ( +
    + {name} @@ -317,66 +265,20 @@ const AwardedScreen = () => ( ); -const POST_STATS: [string, string][] = [ - ['Impressions', '41.2K'], - ['Upvotes', '862'], - ['Comments', '134'], - ['Clicks', '3.8K'], - ['Followers gained', '96'], - ['Cores earned', '1,250'], -]; - -/** posts/[id]/analytics, behind canViewPostAnalytics. */ -const AnalyticsScreen = () => ( - -
    -
    -
    - - Post analytics - - - Why iconic tech brands lost their dominance - -
    - -
    - -
    - -
    - {POST_STATS.map(([label, value]) => ( -
    - - {value} - - {label} -
    - ))} -
    - - -
    - -); - const StatusMoments = () => ( @@ -390,7 +292,7 @@ const StatusMoments = () => ( > @@ -400,49 +302,43 @@ const StatusMoments = () => ( + - - - ); @@ -451,6 +347,13 @@ const meta: Meta = { title: 'Features/Snapshot/Surfaces/Status moments', component: StatusMoments, parameters: { layout: 'fullscreen' }, + decorators: [ + (Story) => ( + + + + ), + ], }; export default meta;