diff --git a/src/components/OptionRow.js b/src/components/OptionRow.js index 9610d5a9200b..535209aec91b 100644 --- a/src/components/OptionRow.js +++ b/src/components/OptionRow.js @@ -169,7 +169,7 @@ const OptionRow = (props) => { secondaryAvatar={props.option.icons[1]} mainTooltip={props.option.ownerEmail} secondaryTooltip={props.option.subtitle} - mode={props.mode} + size={props.mode === CONST.OPTION_MODE.COMPACT ? CONST.AVATAR_SIZE.SMALL : CONST.AVATAR_SIZE.DEFAULT} /> ) : ( ( - + diff --git a/src/stories/SubscriptAvatar.stories.js b/src/stories/SubscriptAvatar.stories.js new file mode 100644 index 000000000000..0a6e67a2fdef --- /dev/null +++ b/src/stories/SubscriptAvatar.stories.js @@ -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 => ; + +// 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, +};