-
Notifications
You must be signed in to change notification settings - Fork 3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #8144 from Expensify/marco-subscriptAvatarSize
change SubscriptAvatar mode prop to size
- Loading branch information
Showing
3 changed files
with
49 additions
and
7 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
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
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 |
---|---|---|
@@ -0,0 +1,42 @@ | ||
import React from 'react'; | ||
import SubscriptAvatar from '../components/SubscriptAvatar'; | ||
import * as Expensicons from '../components/Icon/Expensicons'; | ||
import CONST from '../CONST'; | ||
|
||
/** | ||
* We use the Component Story Format for writing stories. Follow the docs here: | ||
* | ||
* https://storybook.js.org/docs/react/writing-stories/introduction#component-story-format | ||
*/ | ||
export default { | ||
title: 'Components/SubscriptAvatar', | ||
component: SubscriptAvatar, | ||
args: { | ||
mainAvatar: Expensicons.Profile, | ||
secondaryAvatar: Expensicons.Workspace, | ||
size: CONST.AVATAR_SIZE.DEFAULT, | ||
}, | ||
argTypes: { | ||
size: { | ||
options: [CONST.AVATAR_SIZE.SMALL, CONST.AVATAR_SIZE.DEFAULT], // SubscriptAvatar only supports these two sizes | ||
}, | ||
}, | ||
}; | ||
|
||
// eslint-disable-next-line react/jsx-props-no-spreading | ||
const Template = args => <SubscriptAvatar {...args} />; | ||
|
||
// Arguments can be passed to the component by binding | ||
// See: https://storybook.js.org/docs/react/writing-stories/introduction#using-args | ||
const Default = Template.bind({}); | ||
|
||
const AvatarURLStory = Template.bind({}); | ||
AvatarURLStory.args = { | ||
mainAvatar: `${CONST.CLOUDFRONT_URL}/images/avatars/avatar_1.png`, | ||
secondaryAvatar: `${CONST.CLOUDFRONT_URL}/images/avatars/avatar_3.png`, | ||
}; | ||
|
||
export { | ||
Default, | ||
AvatarURLStory, | ||
}; |