-
Notifications
You must be signed in to change notification settings - Fork 3.7k
Implement Search ListItems and table header #41347
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
Merged
Merged
Changes from all commits
Commits
Show all changes
55 commits
Select commit
Hold shift + click to select a range
adcd8fa
create searchtableheader
luacmartins 736f4e6
fix header style
luacmartins a54eed4
create receipt element
luacmartins f061806
update row callback
luacmartins d96a461
add button translation and styles
luacmartins 8f6fe42
use display amounts
luacmartins 6006e97
refactor tag element
luacmartins cb97bab
create getSearchTableColumnWidth
luacmartins eefa1a1
add styles framework
luacmartins 071f4ea
dry user element
luacmartins 1c5016e
style description
luacmartins e573f9b
dry code
luacmartins 372d09a
dry more code
luacmartins e14eb1d
rm unused code
luacmartins b829695
use modified values if present
luacmartins 1de539b
rm getCleanResults
luacmartins 792c3da
inject from/to into listitem
luacmartins 8ae1e53
refactor code
luacmartins 2e8245c
style narrow view
luacmartins 90fa358
style narrow view
luacmartins 2e2fa84
refactor cells
luacmartins 61acc00
fix lint
luacmartins 92caa11
fix lint, typecheck
luacmartins 7950e9d
fix typecheck
luacmartins 5b7e9a9
fix lint
luacmartins eebf75d
fix amounts, use utils methods
luacmartins fc66433
fix avatars
luacmartins 293e030
fix ts
luacmartins 042e42b
do not show default merchant
luacmartins db0c3d6
update logic to show merchant or description
luacmartins 21dfe1b
rm debug log
luacmartins d3aa67d
fix lint
luacmartins 008cd10
add keyForList
luacmartins 63ad92e
fix ts
luacmartins 2bbf7eb
fix lint
luacmartins 05fc405
fix styles on native
luacmartins dd3b869
fix lint
luacmartins de81594
fix merchant logic
luacmartins 07bb641
fix display name overflow
luacmartins 1014394
fix button padding
luacmartins 16b8c55
fix lint
luacmartins 22ea64c
use variables
luacmartins 3847571
update row vertical padding
luacmartins cfd5990
rm button padding
luacmartins b475b28
use isLargeScreenWidth
luacmartins acf290f
fix avatar colors
luacmartins b527a9f
use style utils
luacmartins 9944b24
rm receipt styles
luacmartins 4720cd2
fix left aligned items
luacmartins 4151bce
rename to expenses
luacmartins dc4be99
use mw50
luacmartins cab3d02
fix crash
luacmartins 9263ffd
rm button on mobile
luacmartins 10af037
fix lint
luacmartins 7599c58
increase gap
luacmartins File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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 hidden or 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,57 @@ | ||
| import React from 'react'; | ||
| import {View} from 'react-native'; | ||
| import Text from '@components/Text'; | ||
| import useLocalize from '@hooks/useLocalize'; | ||
| import useStyleUtils from '@hooks/useStyleUtils'; | ||
| import useThemeStyles from '@hooks/useThemeStyles'; | ||
| import useWindowDimensions from '@hooks/useWindowDimensions'; | ||
| import CONST from '@src/CONST'; | ||
|
|
||
| type SearchTableHeaderProps = { | ||
| /** Whether we should show the merchant or description column */ | ||
| shouldShowMerchant: boolean; | ||
luacmartins marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| }; | ||
|
|
||
| function SearchTableHeader({shouldShowMerchant}: SearchTableHeaderProps) { | ||
| const styles = useThemeStyles(); | ||
| const StyleUtils = useStyleUtils(); | ||
| const {isSmallScreenWidth, isMediumScreenWidth} = useWindowDimensions(); | ||
| const {translate} = useLocalize(); | ||
| const displayNarrowVersion = isMediumScreenWidth || isSmallScreenWidth; | ||
|
|
||
| if (displayNarrowVersion) { | ||
| return; | ||
| } | ||
luacmartins marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
|
||
| return ( | ||
| <View style={[styles.ph5, styles.pb3]}> | ||
| <View style={[styles.flex1, styles.flexRow, styles.gap3, styles.ph4]}> | ||
| <View style={[StyleUtils.getSearchTableColumnStyles(CONST.SEARCH_TABLE_COLUMNS.DATE)]}> | ||
| <Text style={[styles.mutedNormalTextLabel]}>{translate('common.date')}</Text> | ||
| </View> | ||
| <View style={[StyleUtils.getSearchTableColumnStyles(CONST.SEARCH_TABLE_COLUMNS.MERCHANT)]}> | ||
| <Text style={[styles.mutedNormalTextLabel]}>{translate(shouldShowMerchant ? 'common.merchant' : 'common.description')}</Text> | ||
| </View> | ||
luacmartins marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| <View style={[StyleUtils.getSearchTableColumnStyles(CONST.SEARCH_TABLE_COLUMNS.FROM)]}> | ||
| <Text style={[styles.mutedNormalTextLabel]}>{translate('common.from')}</Text> | ||
| </View> | ||
| <View style={[StyleUtils.getSearchTableColumnStyles(CONST.SEARCH_TABLE_COLUMNS.TO)]}> | ||
| <Text style={[styles.mutedNormalTextLabel]}>{translate('common.to')}</Text> | ||
| </View> | ||
| <View style={[StyleUtils.getSearchTableColumnStyles(CONST.SEARCH_TABLE_COLUMNS.TOTAL)]}> | ||
| <Text style={[styles.mutedNormalTextLabel]}>{translate('common.total')}</Text> | ||
| </View> | ||
| <View style={[StyleUtils.getSearchTableColumnStyles(CONST.SEARCH_TABLE_COLUMNS.TYPE)]}> | ||
| <Text style={[styles.mutedNormalTextLabel]}>{translate('common.type')}</Text> | ||
| </View> | ||
| <View style={[StyleUtils.getSearchTableColumnStyles(CONST.SEARCH_TABLE_COLUMNS.ACTION)]}> | ||
| <Text style={[styles.mutedNormalTextLabel, styles.textAlignCenter]}>{translate('common.action')}</Text> | ||
| </View> | ||
| </View> | ||
| </View> | ||
| ); | ||
| } | ||
|
|
||
| SearchTableHeader.displayName = 'SearchTableHeader'; | ||
|
|
||
| export default SearchTableHeader; | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.