-
Notifications
You must be signed in to change notification settings - Fork 70
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
137 additions
and
101 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
53 changes: 23 additions & 30 deletions
53
packages/ui/src/common/components/Mention/Mention.stories.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,59 +1,52 @@ | ||
import { Meta, Story } from '@storybook/react' | ||
import { Meta } from '@storybook/react' | ||
import React from 'react' | ||
|
||
import { MentionType } from '@/common/hooks/useMentions' | ||
import { MockApolloProvider } from '@/mocks/components/storybook/MockApolloProvider' | ||
|
||
import { Mention, MentionProps } from './Mention' | ||
|
||
export default { | ||
title: 'Common/Mention', | ||
component: Mention, | ||
} as Meta | ||
|
||
const Template: Story<MentionProps> = (args) => ( | ||
<MockApolloProvider members proposals workers workingGroups forum> | ||
<Mention {...args}>Mention</Mention> | ||
</MockApolloProvider> | ||
) | ||
|
||
export const Proposal = Template.bind({}) | ||
Proposal.args = { | ||
type: 'proposal', | ||
render: (args) => ( | ||
<MockApolloProvider members proposals workers workingGroups forum> | ||
<Mention {...args}>Mention</Mention> | ||
</MockApolloProvider> | ||
), | ||
} as Meta<MentionProps> | ||
|
||
export const Proposal = { | ||
type: MentionType.Proposal, | ||
itemId: '1', | ||
} | ||
|
||
export const ProposalDiscussionEntry = Template.bind({}) | ||
ProposalDiscussionEntry.args = { | ||
type: 'proposalDiscussionEntry', | ||
export const ProposalPost = { | ||
type: MentionType.ProposalPost, | ||
itemId: '1', | ||
} | ||
|
||
export const ForumThread = Template.bind({}) | ||
ForumThread.args = { | ||
type: 'forumThread', | ||
export const ForumThread = { | ||
type: MentionType.ForumThread, | ||
itemId: '1', | ||
} | ||
|
||
export const ForumPost = Template.bind({}) | ||
ForumPost.args = { | ||
type: 'forumPost', | ||
export const ForumPost = { | ||
type: MentionType.ForumPost, | ||
itemId: '1', | ||
} | ||
|
||
export const Member = Template.bind({}) | ||
Member.args = { | ||
type: 'member', | ||
export const Member = { | ||
type: MentionType.Member, | ||
itemId: '1', | ||
} | ||
|
||
export const Opening = Template.bind({}) | ||
Opening.args = { | ||
type: 'opening', | ||
export const Opening = { | ||
type: MentionType.Opening, | ||
itemId: 'forumWorkingGroup-0', | ||
} | ||
|
||
export const Application = Template.bind({}) | ||
Application.args = { | ||
type: 'application', | ||
export const Application = { | ||
type: MentionType.Application, | ||
itemId: 'forumWorkingGroup-0', | ||
} |
Oops, something went wrong.