Skip to content

Commit

Permalink
Added GraphParticipant stories.
Browse files Browse the repository at this point in the history
  • Loading branch information
patcon committed Sep 23, 2024
1 parent a9c03a5 commit 80ff5ec
Show file tree
Hide file tree
Showing 3 changed files with 51 additions and 0 deletions.
Binary file added .storybook/assets/avatar-default.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added .storybook/assets/avatar-sample.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
51 changes: 51 additions & 0 deletions stories/client-participation/GraphParticipant.stories.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
import React from 'react'
import { Participant as GraphParticipant } from '../../polis/client-participation/vis2/components/graphParticipants'
import socialAvatar from '../../.storybook/assets/avatar-sample.jpg'
import defaultAvatar from '../../.storybook/assets/avatar-default.png'

export default {
title: 'Client-Participation/GraphParticipant',
component: GraphParticipant,
decorators: [
// Adds desaturation filter that exists in parent Graph SVG component.
(Story) => (
<svg xmlns="http://www.w3.org/2000/svg" version="1.1" width="100" height="100">
<filter id="grayscale">
<feColorMatrix type="saturate" values="0"/>
</filter>
<Story />
</svg>
)
]
}

const Template = (args) => <GraphParticipant {...args} />

export const Default = Template.bind({})
Default.args = {
ptpt: {
picture_size: 36,
isSelf: false,
picture: defaultAvatar,
},
tweenX: 50,
tweenY: 50,
}

export const IsSelf = Template.bind({})
IsSelf.args = {
...Default.args,
ptpt: {
...Default.args.ptpt,
isSelf: true
}
}

export const HasSocialAvatar = Template.bind({})
HasSocialAvatar.args = {
...Default.args,
ptpt: {
...Default.args.ptpt,
picture: socialAvatar
}
}

0 comments on commit 80ff5ec

Please sign in to comment.