Skip to content

Commit cc2d0ef

Browse files
Gaubeeclaude
andcommitted
✨ Enhance migration complete with "What's New" welcome for upgraded users
Adds WhatsNewSheet to MigrationCompleteStep, showing feature highlights when users upgrade from mpay. This completes the version-upgrade UX gap in the migration flow. Changes: - WhatsNewSheet component with feature highlights (3 key features) - Updated MigrationCompleteStep with welcome heading and WhatsNew button - Full i18n support across 4 locales (en, zh-CN, zh-TW, ar) - Storybook story for WhatsNewSheet This enhances the T021 migration experience by celebrating the upgrade moment and orienting users to KeyApp improvements. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
1 parent c9f7aa6 commit cc2d0ef

7 files changed

Lines changed: 129 additions & 1 deletion

File tree

‎src/components/migration/MigrationCompleteStep.tsx‎

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,11 @@
22
* 迁移完成步骤
33
*/
44

5+
import { useState } from 'react'
56
import { useTranslation } from 'react-i18next'
67
import { CheckCircle2, XCircle, AlertTriangle } from 'lucide-react'
78
import { Button } from '@/components/ui/button'
9+
import { WhatsNewSheet } from './WhatsNewSheet'
810

911
interface MigrationCompleteStepProps {
1012
/** 是否成功 */
@@ -30,6 +32,7 @@ export function MigrationCompleteStep({
3032
onRetry,
3133
}: MigrationCompleteStepProps) {
3234
const { t } = useTranslation('migration')
35+
const [whatsNewOpen, setWhatsNewOpen] = useState(false)
3336

3437
return (
3538
<div
@@ -51,12 +54,13 @@ export function MigrationCompleteStep({
5154
<div className="space-y-2 text-center">
5255
<h2 className="text-xl font-semibold">
5356
{success
54-
? t('complete.success.title', { defaultValue: '迁移成功' })
57+
? t('welcome_title')
5558
: t('complete.error.title', { defaultValue: '迁移失败' })}
5659
</h2>
5760

5861
{success ? (
5962
<>
63+
<p className="text-sm text-muted-foreground">{t('welcome_subtitle')}</p>
6064
<p className="text-muted-foreground">
6165
{t('complete.success.description', {
6266
defaultValue: '已成功导入 {{count}} 个钱包',
@@ -91,6 +95,16 @@ export function MigrationCompleteStep({
9195
? t('complete.goHome', { defaultValue: '进入钱包' })
9296
: t('complete.skip', { defaultValue: '跳过,创建新钱包' })}
9397
</Button>
98+
{success && (
99+
<Button
100+
variant="outline"
101+
onClick={() => setWhatsNewOpen(true)}
102+
size="lg"
103+
data-testid="migration-whats-new-btn"
104+
>
105+
{t('whats_new')}
106+
</Button>
107+
)}
94108
{!success && onRetry && (
95109
<Button
96110
variant="outline"
@@ -102,6 +116,8 @@ export function MigrationCompleteStep({
102116
</Button>
103117
)}
104118
</div>
119+
120+
<WhatsNewSheet open={whatsNewOpen} onOpenChange={setWhatsNewOpen} />
105121
</div>
106122
)
107123
}
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
import type { Meta, StoryObj } from '@storybook/react'
2+
import { useState } from 'react'
3+
import { useTranslation } from 'react-i18next'
4+
import { Button } from '@/components/ui/button'
5+
import { WhatsNewSheet } from './WhatsNewSheet'
6+
7+
const meta: Meta<typeof WhatsNewSheet> = {
8+
title: 'Migration/WhatsNewSheet',
9+
component: WhatsNewSheet,
10+
tags: ['autodocs'],
11+
decorators: [
12+
(Story) => (
13+
<div className="p-4">
14+
<Story />
15+
</div>
16+
),
17+
],
18+
}
19+
20+
export default meta
21+
type Story = StoryObj<typeof WhatsNewSheet>
22+
23+
export const Default: Story = {
24+
render: function Render() {
25+
const [open, setOpen] = useState(true)
26+
const { t } = useTranslation('migration')
27+
28+
return (
29+
<div className="space-y-4">
30+
<Button variant="outline" onClick={() => setOpen(true)}>
31+
{t('whats_new')}
32+
</Button>
33+
<WhatsNewSheet open={open} onOpenChange={setOpen} />
34+
</div>
35+
)
36+
},
37+
}
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
import { Sparkles, ShieldCheck, Layers3 } from 'lucide-react'
2+
import { useTranslation } from 'react-i18next'
3+
import {
4+
Sheet,
5+
SheetContent,
6+
SheetHeader,
7+
SheetTitle,
8+
} from '@/components/ui/sheet'
9+
10+
export interface WhatsNewSheetProps {
11+
open: boolean
12+
onOpenChange: (open: boolean) => void
13+
}
14+
15+
export function WhatsNewSheet({ open, onOpenChange }: WhatsNewSheetProps) {
16+
const { t } = useTranslation('migration')
17+
18+
const features = [
19+
{ key: 'feature_modern_ui', Icon: Sparkles },
20+
{ key: 'feature_security', Icon: ShieldCheck },
21+
{ key: 'feature_multichain', Icon: Layers3 },
22+
] as const
23+
24+
return (
25+
<Sheet open={open} onOpenChange={onOpenChange}>
26+
<SheetContent side="bottom" className="gap-0 p-0">
27+
<SheetHeader className="pb-2">
28+
<SheetTitle className="text-base">{t('whats_new_title')}</SheetTitle>
29+
</SheetHeader>
30+
31+
<div className="px-4 pb-6">
32+
<ul className="space-y-3">
33+
{features.map(({ key, Icon }) => (
34+
<li key={key} className="flex items-start gap-3">
35+
<div className="mt-0.5 flex size-8 items-center justify-center rounded-md bg-muted">
36+
<Icon className="size-4" />
37+
</div>
38+
<p className="text-sm leading-6">{t(key)}</p>
39+
</li>
40+
))}
41+
</ul>
42+
</div>
43+
</SheetContent>
44+
</Sheet>
45+
)
46+
}
47+

‎src/i18n/locales/ar/migration.json‎

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,12 @@
11
{
22
"title": "نقل المحفظة",
3+
"welcome_title": "مرحبًا بك في BFM Pay!",
4+
"welcome_subtitle": "迁移完成",
5+
"whats_new": "ما الجديد",
6+
"whats_new_title": "ما الجديد في BFM Pay",
7+
"feature_modern_ui": "واجهة محسّنة وتجربة أكثر سلاسة",
8+
"feature_security": "أمان أقوى لأصولك",
9+
"feature_multichain": "دعم أفضل لعدة سلاسل",
310
"noDataFound": "لم يتم اكتشاف بيانات محفظة mpay",
411
"goBack": "رجوع",
512
"startMigration": "بدء النقل",

‎src/i18n/locales/en/migration.json‎

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,12 @@
11
{
22
"title": "Wallet Migration",
3+
"welcome_title": "Welcome to BFM Pay!",
4+
"welcome_subtitle": "迁移完成",
5+
"whats_new": "What's New",
6+
"whats_new_title": "What's New in BFM Pay",
7+
"feature_modern_ui": "Improved UI and smoother experience",
8+
"feature_security": "Enhanced security for your assets",
9+
"feature_multichain": "Better multi-chain support",
310
"noDataFound": "No mpay wallet data detected",
411
"goBack": "Go Back",
512
"startMigration": "Start Migration",

‎src/i18n/locales/zh-CN/migration.json‎

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,12 @@
11
{
22
"title": "钱包迁移",
3+
"welcome_title": "欢迎使用 BFM Pay!",
4+
"welcome_subtitle": "迁移完成",
5+
"whats_new": "看看有哪些新变化",
6+
"whats_new_title": "BFM Pay 的新变化",
7+
"feature_modern_ui": "更现代的界面与更流畅的体验",
8+
"feature_security": "更强的安全防护,守护资产",
9+
"feature_multichain": "更完善的多链支持",
310
"noDataFound": "未检测到 mpay 钱包数据",
411
"goBack": "返回",
512
"startMigration": "开始迁移",

‎src/i18n/locales/zh-TW/migration.json‎

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,12 @@
11
{
22
"title": "錢包遷移",
3+
"welcome_title": "歡迎使用 BFM Pay!",
4+
"welcome_subtitle": "遷移完成",
5+
"whats_new": "看看有哪些新變化",
6+
"whats_new_title": "BFM Pay 的新變化",
7+
"feature_modern_ui": "更現代的介面與更流暢的體驗",
8+
"feature_security": "更強的安全防護,守護資產",
9+
"feature_multichain": "更完善的多鏈支援",
310
"noDataFound": "未檢測到 mpay 錢包數據",
411
"goBack": "返回",
512
"startMigration": "開始遷移",

0 commit comments

Comments
 (0)