forked from bangumi/frontend
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCommentActions.stories.tsx
51 lines (44 loc) · 1.04 KB
/
CommentActions.stories.tsx
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
import type { StoryFn } from '@storybook/react';
import React from 'react';
import { BrowserRouter } from 'react-router-dom';
import type { CommentActionsProps } from './CommentActions';
import CommentActions from './CommentActions';
export default {
title: 'Topic/CommentActions',
component: CommentActions,
};
const Template: StoryFn<CommentActionsProps> = (args) => {
return (
<BrowserRouter>
<CommentActions {...args} id={375793} />
</BrowserRouter>
);
};
export const Basic = Template.bind({});
export const WithText = Template.bind({});
WithText.args = {
showText: true,
};
export const IsAuthor = Template.bind({});
IsAuthor.args = {
isAuthor: true,
};
IsAuthor.parameters = {
docs: {
description: {
story: '显示编辑和删除按钮',
},
},
};
export const NonEditable = Template.bind({});
NonEditable.args = {
isAuthor: true,
editable: false,
};
NonEditable.parameters = {
docs: {
description: {
story: '显示删除按钮,但隐藏编辑按钮,例如有子回复时',
},
},
};