Repository navigation
[Payment due @ikevin127] Add a sortable Rejected column to Search #104566
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
base: main
Are you sure you want to change the base?
Changes from all commits
32767f6
d620721
73c2826
6131f51
6dc80e1
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
|
Contributor
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. should we use this for other components too? We use yes/no for reimbursable, billable, etc, right?
Contributor
Author
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. It already is used. |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,27 @@ | ||
| import Text from '@components/Text'; | ||
|
|
||
| import useLocalize from '@hooks/useLocalize'; | ||
|
|
||
| import {COPYABLE_TEXT_DATA_SET} from '@libs/SelectionScraper'; | ||
|
|
||
| import React from 'react'; | ||
|
|
||
| type YesNoCellProps = { | ||
| /** Whether the cell shows Yes or No */ | ||
| value: boolean; | ||
| }; | ||
|
|
||
| function YesNoCell({value}: YesNoCellProps) { | ||
| const {translate} = useLocalize(); | ||
|
|
||
| return ( | ||
| <Text | ||
| selectable | ||
| dataSet={COPYABLE_TEXT_DATA_SET} | ||
| > | ||
| {value ? translate('common.yes') : translate('common.no')} | ||
| </Text> | ||
| ); | ||
| } | ||
|
|
||
| export default YesNoCell; |
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.
❌ CONSISTENCY-3 (docs)
This new DECLINED cell renders a Yes/No value with
<View style={[getSearchColumnStyles(column)]}><Text selectable dataSet={COPYABLE_TEXT_DATA_SET}>{value ? translate('common.yes') : translate('common.no')}</Text></View>, which is the exact structure already implemented by therenderYesNoCellhelper inTransactionItemRowWide.tsx(lines 183-195). Duplicating this across the two row components means a future change to the Yes/No cell (styling, copy, clipboard behavior) has to be made in two places and can drift.Extract the Yes/No cell into a shared component (e.g.
SearchList/ListItem/YesNoCell.tsx) and use it from both rows:and have
TransactionItemRowWide.tsx'srenderYesNoCelldelegate to the same component.Reviewed at: 73c2826 | Please rate this suggestion with 👍 or 👎 to help us improve! Reactions are used to monitor reviewer efficiency.
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.
Moved the Yes/No cell into a shared
YesNoCellcomponent that both rows use, in 6131f51.