refactor(profile): split view/container and update nav state
Some checks failed
Client CMS Check Build (NixCN CMS) TeamCity build failed
Backend Check Build (NixCN CMS) TeamCity build finished

Signed-off-by: Noa Virellia <noa@requiem.garden>
This commit is contained in:
2026-01-31 18:30:34 +08:00
parent 635b0fbb73
commit 65d493b91b
20 changed files with 173 additions and 73 deletions

View File

@@ -0,0 +1,55 @@
import type { Meta, StoryObj } from '@storybook/react-vite';
import { QueryClient, QueryClientProvider } from '@tanstack/react-query';
import { ProfileError } from '@/components/profile/profile.error';
import { ProfileSkeleton } from '@/components/profile/profile.skeleton';
import { ProfileView } from '@/components/profile/profile.view';
const queryClient = new QueryClient();
const meta = {
title: 'Profile/View',
component: ProfileView,
decorators: [
Story => (
<QueryClientProvider client={queryClient}>
<Story />
</QueryClientProvider>
),
],
} satisfies Meta<typeof ProfileView>;
export default meta;
type Story = StoryObj<typeof meta>;
export const Primary: Story = {
args: {
user: {
username: 'nvirellia',
nickname: 'Noa Virellia',
subtitle: '天生骄傲',
email: 'noa@requiem.garden',
bio: '',
avatar: 'https://avatars.githubusercontent.com/u/54884471?v=4',
},
onSaveBio: async () => Promise.resolve(),
},
};
export const Skeleton: Story = {
render: () => <ProfileSkeleton />,
args: {
user: {},
onSaveBio: async () => Promise.resolve(),
},
};
export const Error: Story = {
render: () => <ProfileError reason="用户个人资料未公开" />,
args: {
user: {
allow_public: false,
},
onSaveBio: async () => Promise.resolve(),
},
};