-
Notifications
You must be signed in to change notification settings - Fork 3.1k
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 #8016 from Expensify/marcaaron-optionRowStory
[No QA] Code cleanup / Add story for OptionRow
- Loading branch information
Showing
17 changed files
with
142 additions
and
82 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
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
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,15 @@ | ||
import PropTypes from 'prop-types'; | ||
|
||
export default PropTypes.shape({ | ||
// Primary login of participant | ||
login: PropTypes.string, | ||
|
||
// Display Name of participant | ||
displayName: PropTypes.string, | ||
|
||
// Avatar url of participant | ||
avatar: PropTypes.string, | ||
|
||
/** First Name of the participant */ | ||
firstName: PropTypes.string, | ||
}); |
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
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
This file was deleted.
Oops, something went wrong.
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,55 @@ | ||
import React from 'react'; | ||
import OptionRow from '../components/OptionRow'; | ||
import * as Expensicons from '../components/Icon/Expensicons'; | ||
|
||
/** | ||
* 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/OptionRow', | ||
component: OptionRow, | ||
argTypes: { | ||
mode: { | ||
options: ['default', 'compact'], | ||
control: {type: 'radio'}, | ||
}, | ||
}, | ||
args: { | ||
mode: 'default', | ||
optionIsFocused: false, | ||
showSelectedState: false, | ||
isSelected: false, | ||
hideAdditionalOptionStates: false, | ||
forceTextUnreadStyle: false, | ||
showTitleTooltip: false, | ||
isDisabled: false, | ||
backgroundColor: 'white', | ||
option: { | ||
isUnread: false, | ||
text: 'Test Option', | ||
alternateText: 'Alternate text', | ||
icons: [Expensicons.ActiveRoomAvatar], | ||
login: 'test@expensify.com', | ||
reportID: null, | ||
hasDraftComment: false, | ||
isPinned: false, | ||
isChatRoom: false, | ||
participantsList: [], | ||
descriptiveText: '', | ||
tooltipText: 'Tooltip text', | ||
}, | ||
}, | ||
}; | ||
|
||
// eslint-disable-next-line react/jsx-props-no-spreading | ||
const Template = args => <OptionRow {...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({}); | ||
|
||
export { | ||
Default, | ||
}; |