-
Notifications
You must be signed in to change notification settings - Fork 22
/
Copy pathDaoDappTabbedHome.stories.tsx
121 lines (115 loc) · 3.12 KB
/
DaoDappTabbedHome.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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
import {
AccountBalanceRounded,
EscalatorWarningRounded,
GavelRounded,
PeopleAltRounded,
} from '@mui/icons-material'
import { ComponentMeta, ComponentStory } from '@storybook/react'
import { useState } from 'react'
import { SuspenseLoader } from '@dao-dao/stateful'
import {
DaoPageWrapperDecorator,
makeDappLayoutDecorator,
} from '@dao-dao/storybook/decorators'
import { DaoTabId, TokenCardProps } from '@dao-dao/types'
import {
ButtonLink,
LinkWrapper,
MembersTabProps,
NftCardProps,
ProposalsTabProps,
SubDaosTabProps,
TreasuryTabProps,
} from '../components'
import { Default as MembersTabStory } from '../components/dao/tabs/MembersTab.stories'
import { Default as ProposalsTabStory } from '../components/dao/tabs/ProposalsTab.stories'
import { Default as SubDaosTabStory } from '../components/dao/tabs/SubDaosTab.stories'
import { Default as TreasuryTabStory } from '../components/dao/tabs/TreasuryTab.stories'
import { DaoDappTabbedHome } from './DaoDappTabbedHome'
export default {
title: 'DAO DAO / packages / stateless / pages / DaoDappTabbedHome',
component: DaoDappTabbedHome,
decorators: [
// Direct ancestor of rendered story.
DaoPageWrapperDecorator,
makeDappLayoutDecorator(),
],
} as ComponentMeta<typeof DaoDappTabbedHome>
const Template: ComponentStory<typeof DaoDappTabbedHome> = (args) => {
const [following, setFollowing] = useState(false)
return (
<DaoDappTabbedHome
{...args}
follow={{
following,
onFollow: () => setFollowing((p) => !p),
updatingFollowing: false,
}}
/>
)
}
export const Default = Template.bind({})
Default.args = {
tabs: [
{
id: DaoTabId.Proposals,
label: 'Proposals',
Component: () => (
<ProposalsTabStory {...(ProposalsTabStory.args as ProposalsTabProps)} />
),
Icon: GavelRounded,
IconFilled: GavelRounded,
},
{
id: DaoTabId.Treasury,
label: 'Treasury',
Component: () => (
<TreasuryTabStory
{...(TreasuryTabStory.args as TreasuryTabProps<
TokenCardProps,
NftCardProps
>)}
/>
),
Icon: AccountBalanceRounded,
IconFilled: AccountBalanceRounded,
},
{
id: DaoTabId.SubDaos,
label: 'SubDAOs',
Component: () => (
<SubDaosTabStory {...(SubDaosTabStory.args as SubDaosTabProps)} />
),
Icon: EscalatorWarningRounded,
IconFilled: EscalatorWarningRounded,
},
{
id: DaoTabId.Members,
label: 'Members',
Component: () => (
<MembersTabStory {...(MembersTabStory.args as MembersTabProps)} />
),
Icon: PeopleAltRounded,
IconFilled: PeopleAltRounded,
},
],
selectedTabId: DaoTabId.Proposals,
onSelectTabId: (tabId) => alert(tabId),
SuspenseLoader,
ButtonLink,
LinkWrapper,
follow: {
following: false,
onFollow: () => alert('follow'),
updatingFollowing: false,
},
}
Default.parameters = {
design: {
type: 'figma',
url: 'https://www.figma.com/file/ZnQ4SMv8UUgKDZsR5YjVGH/DAO-DAO-2.0?node-id=317%3A28615',
},
nextRouter: {
asPath: '/dao/core1',
},
}