Skip to content

Commit

Permalink
Fix up disableRowInteractivity. Add missing propType
Browse files Browse the repository at this point in the history
  • Loading branch information
marcaaron committed Mar 8, 2022
1 parent 9b20b23 commit 495d3db
Show file tree
Hide file tree
Showing 7 changed files with 9 additions and 11 deletions.
2 changes: 1 addition & 1 deletion src/components/IOUConfirmationList.js
Original file line number Diff line number Diff line change
Expand Up @@ -364,7 +364,7 @@ class IOUConfirmationList extends Component {
canSelectMultipleOptions={this.props.hasMultipleParticipants}
selectedOptions={this.getSelectedOptions()}
onSelectRow={toggleOption}
disableRowInteractivity={!this.props.isGroupSplit}
isDisabled={!this.props.isGroupSplit}
optionHoveredStyle={hoverStyle}
/>
</ScrollView>
Expand Down
6 changes: 1 addition & 5 deletions src/components/OptionRow.js
Original file line number Diff line number Diff line change
Expand Up @@ -62,9 +62,6 @@ const propTypes = {
/** Whether this option should be disabled */
isDisabled: PropTypes.bool,

/** Whether to disable the interactivity of this row */
disableRowInteractivity: PropTypes.bool,

...withLocalizePropTypes,
};

Expand All @@ -80,7 +77,6 @@ const defaultProps = {
onSelectRow: () => {},
isDisabled: false,
optionIsFocused: false,
disableRowInteractivity: false,
};

const OptionRow = (props) => {
Expand Down Expand Up @@ -143,7 +139,7 @@ const OptionRow = (props) => {
e.preventDefault();
props.onSelectRow(props.option, touchableRef);
}}
disabled={props.disableRowInteractivity}
disabled={props.isDisabled}
activeOpacity={0.8}
style={[
styles.flexRow,
Expand Down
2 changes: 1 addition & 1 deletion src/components/OptionsList/BaseOptionsList.js
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ class BaseOptionsList extends Component {
showSelectedState={this.props.canSelectMultipleOptions}
hideAdditionalOptionStates={this.props.hideAdditionalOptionStates}
forceTextUnreadStyle={this.props.forceTextUnreadStyle}
disableRowInteractivity={this.props.disableRowInteractivity}
isDisabled={this.props.isDisabled}
/>
);
}
Expand Down
4 changes: 2 additions & 2 deletions src/components/OptionsList/optionsListPropTypes.js
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ const propTypes = {
optionMode: PropTypes.oneOf(_.values(CONST.OPTION_MODE)),

/** Whether to disable the interactivity of the list's option row(s) */
disableRowInteractivity: PropTypes.bool,
isDisabled: PropTypes.bool,

/** Callback to execute when the SectionList lays out */
onLayout: PropTypes.func,
Expand All @@ -98,7 +98,7 @@ const defaultProps = {
innerRef: null,
showTitleTooltip: false,
optionMode: undefined,
disableRowInteractivity: false,
isDisabled: false,
onLayout: undefined,
};

Expand Down
3 changes: 3 additions & 0 deletions src/components/optionPropTypes.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,9 @@ export default PropTypes.shape({
// Whether the report corresponds to a chat room
isChatRoom: PropTypes.bool,

// Whether the option has an outstanding IOU
hasOutstandingIOU: PropTypes.bool,

// List of participants of the report
participantsList: PropTypes.arrayOf(participantPropTypes),

Expand Down
2 changes: 1 addition & 1 deletion src/pages/workspace/WorkspaceMembersPage.js
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,7 @@ class WorkspaceMembersPage extends React.Component {
<View style={styles.flex1}>
<OptionRow
forceTextUnreadStyle
disableRowInteractivity
isDisabled
option={{
text: Str.removeSMSDomain(item.displayName),
alternateText: Str.removeSMSDomain(item.login),
Expand Down
1 change: 0 additions & 1 deletion src/stories/OptionRow.stories.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ export default {
forceTextUnreadStyle: false,
showTitleTooltip: false,
isDisabled: false,
disableRowInteractivity: false,
backgroundColor: 'white',
option: {
isUnread: false,
Expand Down

0 comments on commit 495d3db

Please sign in to comment.