Skip to content

Commit

Permalink
Preview multi recipients proposal in storybook
Browse files Browse the repository at this point in the history
  • Loading branch information
thesan committed Aug 18, 2023
1 parent 83b4ef3 commit 548fc6d
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,10 @@ export default {
title: PROPOSAL_DATA.title,
description: PROPOSAL_DATA.description,
status,
type: args.type,
type:
args.type === 'FundingRequestMultipleRecipientsProposalDetails'
? 'FundingRequestProposalDetails'
: args.type,
creator: args.isProposer ? alice : bob,

discussionThread: {
Expand Down Expand Up @@ -228,6 +231,9 @@ export const FillWorkingGroupLeadOpening: Story = {
export const FundingRequest: Story = {
args: { type: 'FundingRequestProposalDetails' },
}
export const FundingRequestMultipleRecipients: Story = {
args: { type: 'FundingRequestMultipleRecipientsProposalDetails' },
}
export const RuntimeUpgrade: Story = {
args: { type: 'RuntimeUpgradeProposalDetails', constitutionality: 2 },
parameters: {
Expand Down
11 changes: 11 additions & 0 deletions packages/ui/src/mocks/data/proposals.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,17 @@ const proposalDetails = {
destinations: [{ __typename: 'FundingRequestDestination', amount: joy(200), account: membership.rootAccount }],
},
},
FundingRequestMultipleRecipientsProposalDetails: {
destinationsList: {
__typename: 'FundingRequestDestinationsList',
destinations: [
{ __typename: 'FundingRequestDestination', amount: joy(200), account: membership.rootAccount },
{ __typename: 'FundingRequestDestination', amount: joy(20), account: member('alice').rootAccount },
{ __typename: 'FundingRequestDestination', amount: joy(1), account: member('bob').rootAccount },
{ __typename: 'FundingRequestDestination', amount: joy(500), account: member('charlie').rootAccount },
],
},
},
RuntimeUpgradeProposalDetails: { newRuntimeBytecode: { __typename: 'RuntimeWasmBytecode', id: '0' } },
SetCouncilBudgetIncrementProposalDetails: { newAmount: joy(200) },
SetCouncilorRewardProposalDetails: { newRewardPerBlock: joy(200) },
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
import { Api } from '@/api'
import { ProposalFieldsFragment } from '@/proposals/queries'

export type ProposalDetailsType = ProposalFieldsFragment['details']['__typename']
export type ProposalDetailsType =
| ProposalFieldsFragment['details']['__typename']
| 'FundingRequestMultipleRecipientsProposalDetails'

export const proposalDetailsToConstantKey = (details: ProposalDetailsType) =>
proposalDetailsToConstantKeyMap.get(details) as string
Expand All @@ -13,6 +15,7 @@ const proposalDetailsToConstantKeyMap = new Map<ProposalDetailsType, keyof Api['
['DecreaseWorkingGroupLeadStakeProposalDetails', 'decreaseWorkingGroupLeadStakeProposalParameters'],
['FillWorkingGroupLeadOpeningProposalDetails', 'fillWorkingGroupOpeningProposalParameters'],
['FundingRequestProposalDetails', 'fundingRequestProposalParameters'],
['FundingRequestMultipleRecipientsProposalDetails', 'fundingRequestProposalParameters'],
['RuntimeUpgradeProposalDetails', 'runtimeUpgradeProposalParameters'],
['SetCouncilBudgetIncrementProposalDetails', 'setCouncilBudgetIncrementProposalParameters'],
['SetCouncilorRewardProposalDetails', 'setCouncilorRewardProposalParameters'],
Expand Down

0 comments on commit 548fc6d

Please sign in to comment.