-
Notifications
You must be signed in to change notification settings - Fork 22
/
Copy pathProposal.stories.tsx
70 lines (64 loc) · 2.27 KB
/
Proposal.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
import { ComponentMeta, ComponentStory } from '@storybook/react'
import {
ProposalVoteTally,
ProposalVoteTallyProps,
} from '@dao-dao/stateful/proposal-module-adapter/adapters/DaoProposalSingle/components/ProposalVoteTally/ProposalVoteTally'
import { Default as ProposalVoteTallyStory } from '@dao-dao/stateful/proposal-module-adapter/adapters/DaoProposalSingle/components/ProposalVoteTally/ProposalVoteTally.ProposalVoteTally.stories'
import {
DaoPageWrapperDecorator,
makeDappLayoutDecorator,
makeProposalModuleAdapterDecorator,
} from '@dao-dao/storybook/decorators'
import {
ProposalContentDisplayProps,
ProposalStatusAndInfo,
ProposalStatusAndInfoProps,
} from '../components'
import { Default as ProposalContentDisplayStory } from '../components/proposal/ProposalContentDisplay.stories'
import { Vote as ProposalStatusAndInfoVoteStory } from '../components/proposal/ProposalStatusAndInfo.stories'
import { ProposalVotes } from '../components/proposal/ProposalVotes'
import { makeProps as makeProposalVotesProps } from '../components/proposal/ProposalVotes.stories'
import { Proposal } from './Proposal'
const proposalId = 'A72'
export default {
title: 'DAO DAO / packages / stateless / pages / Proposal',
component: Proposal,
decorators: [
// Direct ancestor of rendered story.
makeProposalModuleAdapterDecorator(proposalId),
DaoPageWrapperDecorator,
makeDappLayoutDecorator(),
],
} as ComponentMeta<typeof Proposal>
const Template: ComponentStory<typeof Proposal> = (args) => (
<Proposal {...args} />
)
export const Default = Template.bind({})
Default.args = {
ProposalStatusAndInfo: (props) => (
<ProposalStatusAndInfo
{...(ProposalStatusAndInfoVoteStory.args as ProposalStatusAndInfoProps)}
{...props}
/>
),
voteTally: (
<ProposalVoteTally
{...(ProposalVoteTallyStory.args as ProposalVoteTallyProps)}
/>
),
VotesCast: () => <ProposalVotes {...makeProposalVotesProps()} />,
contentDisplay: (
<ProposalContentDisplayStory
{...(ProposalContentDisplayStory.args as ProposalContentDisplayProps)}
/>
),
}
Default.parameters = {
design: {
type: 'figma',
url: 'https://www.figma.com/file/ZnQ4SMv8UUgKDZsR5YjVGH/DAO-DAO-2.0?node-id=313%3A30661',
},
nextRouter: {
asPath: '/dao/core1',
},
}