-
Notifications
You must be signed in to change notification settings - Fork 3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
change report action button bg color if there's held expenses #53117
Changes from 15 commits
c01057c
ac633d2
b8b7a82
24e43ec
508fe58
7f91683
7b3e68d
a68cd67
b534b9c
e267431
3f80dcc
ea44f63
c1a1bb9
62d7aa7
22232d3
0cc7779
0e52e7c
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -109,6 +109,13 @@ function ReportListItem<TItem extends ListItem>({ | |||||
return null; | ||||||
} | ||||||
|
||||||
const reportItemTotal = reportItem?.total ?? 0; | ||||||
const reportItemUnheldTotal = reportItem?.unheldTotal ?? 0; | ||||||
const isOnHold = reportItemTotal - reportItemUnheldTotal === 0; | ||||||
|
||||||
const isApproveAction = reportItem.action === CONST.SEARCH.ACTION_TYPES.APPROVE; | ||||||
const shouldUseSuccessStyle = isApproveAction ? !isOnHold : true; | ||||||
|
||||||
const participantFrom = reportItem.from; | ||||||
const participantTo = reportItem.to; | ||||||
|
||||||
|
@@ -202,6 +209,7 @@ function ReportListItem<TItem extends ListItem>({ | |||||
<View style={StyleUtils.getSearchTableColumnStyles(CONST.SEARCH.TABLE_COLUMNS.ACTION)}> | ||||||
<ActionCell | ||||||
action={reportItem.action} | ||||||
shouldUseSuccessStyle={shouldUseSuccessStyle} | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
goToItem={handleOnButtonPress} | ||||||
isSelected={item.isSelected} | ||||||
isLoading={reportItem.isActionLoading} | ||||||
|
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
@@ -1,5 +1,5 @@ | ||||||
import {Str} from 'expensify-common'; | ||||||
luacmartins marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||
import React from 'react'; | ||||||
import React, {useMemo} from 'react'; | ||||||
import type {StyleProp, ViewStyle} from 'react-native'; | ||||||
import {View} from 'react-native'; | ||||||
import Checkbox from '@components/Checkbox'; | ||||||
|
@@ -265,6 +265,11 @@ function TransactionListItemRow({ | |||||
const StyleUtils = useStyleUtils(); | ||||||
const theme = useTheme(); | ||||||
|
||||||
const isOnHold = useMemo(() => TransactionUtils.isOnHold(item), [item]); | ||||||
|
||||||
const isApproveAction = item.action === CONST.SEARCH.ACTION_TYPES.APPROVE; | ||||||
const shouldUseSuccessStyle = isApproveAction ? !isOnHold : true; | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Do we need to check if it's approve action? Shouldn't we always use the grey style if there's a transaction on hold?
Suggested change
|
||||||
|
||||||
if (!isLargeScreenWidth) { | ||||||
return ( | ||||||
<View style={containerStyle}> | ||||||
|
@@ -278,6 +283,7 @@ function TransactionListItemRow({ | |||||
onButtonPress={onButtonPress} | ||||||
canSelectMultiple={canSelectMultiple} | ||||||
action={item.action} | ||||||
shouldUseSuccessStyle={shouldUseSuccessStyle} | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
isSelected={item.isSelected} | ||||||
isDisabled={item.isDisabled} | ||||||
isDisabledCheckbox={item.isDisabledCheckbox} | ||||||
|
@@ -444,6 +450,7 @@ function TransactionListItemRow({ | |||||
<View style={[StyleUtils.getSearchTableColumnStyles(CONST.SEARCH.TABLE_COLUMNS.ACTION)]}> | ||||||
<ActionCell | ||||||
action={item.action} | ||||||
shouldUseSuccessStyle={shouldUseSuccessStyle} | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
isSelected={isButtonSelected} | ||||||
isChildListItem={isChildListItem} | ||||||
parentAction={parentAction} | ||||||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we use
ReportUtils.hasHeldExpenses
like so?