-
Notifications
You must be signed in to change notification settings - Fork 3.7k
[Search v1] Implement dynamic columns #41672
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
luacmartins
merged 13 commits into
Expensify:main
from
software-mansion-labs:search-v1-p2/dynamic-columns
May 14, 2024
Merged
Changes from all commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
3ffa907
Add dynamic columns
WojtekBoman 666f58e
Handle displaying Tag and Category on small screens
WojtekBoman 392bf3c
Add TextWithIconCell
WojtekBoman 22a00fa
Remove CONST.SEARCH_TABLE_OPTIONAL_COLUMNS
WojtekBoman 72e75b5
Refactor TransactionListItemType
WojtekBoman ac96c83
Add docs for SearchTransaction
WojtekBoman bbbd786
Add tax column
WojtekBoman 91aa8c7
Merge branch 'main' into search-v1-p2/dynamic-columns
WojtekBoman ee24845
Add SearchTableHeaderColumn
WojtekBoman 74d3a88
Fix displaying users in TransactionListItem
WojtekBoman ed74c1a
Fix displaying category and tag cells in TransactionListItem
WojtekBoman 2fe5f20
Add style fixes to TransactionListItem
WojtekBoman f803748
Merge branch 'main' into search-v1-p2/dynamic-columns
WojtekBoman 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
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,31 @@ | ||
| import React from 'react'; | ||
| import {View} from 'react-native'; | ||
| import type {StyleProp, TextStyle, ViewStyle} from 'react-native'; | ||
| import Text from '@components/Text'; | ||
| import useThemeStyles from '@hooks/useThemeStyles'; | ||
|
|
||
| type SearchTableHeaderColumnProps = { | ||
| shouldShow?: boolean; | ||
| containerStyle?: StyleProp<ViewStyle>; | ||
| text: string; | ||
| textStyle?: StyleProp<TextStyle>; | ||
| }; | ||
|
|
||
| export default function SearchTableHeaderColumn({containerStyle, text, textStyle, shouldShow = true}: SearchTableHeaderColumnProps) { | ||
| const styles = useThemeStyles(); | ||
|
|
||
| if (!shouldShow) { | ||
| return null; | ||
| } | ||
|
|
||
| return ( | ||
| <View style={containerStyle}> | ||
| <Text | ||
| numberOfLines={1} | ||
| style={[styles.mutedNormalTextLabel, textStyle]} | ||
| > | ||
| {text} | ||
| </Text> | ||
| </View> | ||
| ); | ||
| } |
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,45 @@ | ||
| import React from 'react'; | ||
| import {View} from 'react-native'; | ||
| import Icon from '@components/Icon'; | ||
| import Text from '@components/Text'; | ||
| import Tooltip from '@components/Tooltip'; | ||
| import useTheme from '@hooks/useTheme'; | ||
| import useThemeStyles from '@hooks/useThemeStyles'; | ||
| import type IconAsset from '@src/types/utils/IconAsset'; | ||
|
|
||
| type TextWithIconCellProps = { | ||
| icon: IconAsset; | ||
| text?: string; | ||
| showTooltip: boolean; | ||
| }; | ||
|
|
||
| export default function TextWithIconCell({icon, text, showTooltip}: TextWithIconCellProps) { | ||
| const styles = useThemeStyles(); | ||
| const theme = useTheme(); | ||
|
|
||
| if (!text) { | ||
| return null; | ||
| } | ||
|
|
||
| return ( | ||
| <Tooltip | ||
| shouldRender={showTooltip} | ||
| text={text} | ||
| > | ||
| <View style={[styles.flexRow, styles.flexShrink1, styles.gap1]}> | ||
|
Comment on lines
+25
to
+29
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. |
||
| <Icon | ||
| src={icon} | ||
| fill={theme.icon} | ||
| height={12} | ||
| width={12} | ||
| /> | ||
| <Text | ||
| numberOfLines={1} | ||
| style={[styles.optionDisplayName, styles.label, styles.pre, styles.justifyContentCenter, styles.textMicro, styles.textSupporting, styles.flexShrink1]} | ||
| > | ||
| {text} | ||
| </Text> | ||
| </View> | ||
| </Tooltip> | ||
| ); | ||
| } | ||
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
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.