Skip to content

Commit

Permalink
Make split bill not pressable
Browse files Browse the repository at this point in the history
  • Loading branch information
grgia committed Nov 22, 2022
1 parent 75e7117 commit ffe2996
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 15 deletions.
2 changes: 1 addition & 1 deletion src/components/Checkbox.js
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ class Checkbox extends React.Component {
this.state.isFocused && styles.borderColorFocus,
]}
>
<Icon src={Expensicons.Checkmark} fill="white" height={14} width={14} />
<Icon src={Expensicons.Checkmark} fill={this.props.isChecked ? 'white' : 'transparent'} height={14} width={14} />
</View>
)}
</Pressable>
Expand Down
1 change: 1 addition & 0 deletions src/components/ReportActionItem/IOUAction.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ const IOUAction = (props) => {
<>
<IOUQuote
action={props.action}
shouldAllowViewDetails={Boolean(props.action.originalMessage.IOUReportID)}
onViewDetailsPressed={launchDetailsModal}
/>
{((props.isMostRecentIOUReportAction && Boolean(props.action.originalMessage.IOUReportID))
Expand Down
34 changes: 20 additions & 14 deletions src/components/ReportActionItem/IOUQuote.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,36 +15,42 @@ const propTypes = {
/** All the data of the action */
action: PropTypes.shape(reportActionPropTypes).isRequired,

/** Should the View Details link be displayed? */
shouldAllowViewDetails: PropTypes.bool,

/** Callback invoked when View Details is pressed */
onViewDetailsPressed: PropTypes.func,

...withLocalizePropTypes,
};

const defaultProps = {
shouldAllowViewDetails: false,
onViewDetailsPressed: () => {},
};

const IOUQuote = props => (
<View style={[styles.chatItemMessage]}>
{_.map(props.action.message, (fragment, index) => (
<View
<Pressable
key={`iouQuote-${props.action.reportActionID}-${index}`}
onPress={props.shouldAllowViewDetails
? props.onViewDetailsPressed
: () => {}}
style={[styles.flexRow, styles.justifyContentBetween]}
>
<Pressable onPress={props.onViewDetailsPressed} style={[styles.flexRow, styles.justifyContentBetween]}>
<Text>
<Text style={[styles.chatItemMessageLink]}>
{/* Get first word of IOU message */}
{Str.htmlDecode(fragment.text.split(' ')[0])}
</Text>
<Text style={[styles.chatItemMessage]}>
{/* Get remainder of IOU message */}
{Str.htmlDecode(fragment.text.substring(fragment.text.indexOf(' ')))}
</Text>
<Text>
<Text style={[styles.chatItemMessageLink]}>
{/* Get first word of IOU message */}
{Str.htmlDecode(fragment.text.split(' ')[0])}
</Text>
<Text style={[styles.chatItemMessage]}>
{/* Get remainder of IOU message */}
{Str.htmlDecode(fragment.text.substring(fragment.text.indexOf(' ')))}
</Text>
<Icon src={Expensicons.ArrowRight} fill={themeColors.gray3} />
</Pressable>
</View>
</Text>
<Icon src={Expensicons.ArrowRight} fill={props.shouldAllowViewDetails ? themeColors.icon : themeColors.transparent} />
</Pressable>
))}
</View>
);
Expand Down

0 comments on commit ffe2996

Please sign in to comment.