-
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
Limit tag list to 500 items #31447
Merged
puneetlath
merged 32 commits into
Expensify:main
from
rezkiy37:feature/31218-limit-tags
Nov 27, 2023
Merged
Limit tag list to 500 items #31447
Changes from all commits
Commits
Show all changes
32 commits
Select commit
Hold shift + click to select a range
c570773
add a limit const
rezkiy37 8e0ab70
implement a limit
rezkiy37 f12d261
Merge branch 'main' of https://github.com/rezkiy37/Expensify into fea…
rezkiy37 a5c9de5
Revert "implement a limit"
rezkiy37 5d07521
Create ShowMore component
rezkiy37 c8928e7
add strings
rezkiy37 653deac
add ability to pass footer to OptionsList
rezkiy37 b95cf0e
integrate pagination for OptionsSelector
rezkiy37 a820d4e
rename a const
rezkiy37 ffd144e
integrate inserts for TagPicker and enable pagination
rezkiy37 82c9f1c
reuse ShowMore
rezkiy37 a1a62c7
allow pass container style for ShowMore
rezkiy37 0bcc5a9
Merge branch 'main' of https://github.com/rezkiy37/Expensify into fea…
rezkiy37 09e72c7
add periods
rezkiy37 e2d780d
remove empty lines
rezkiy37 19ca4ac
calculate all visible options
rezkiy37 2cde176
Merge branch 'main' of https://github.com/rezkiy37/Expensify into fea…
rezkiy37 c29740a
Merge branch 'main' of https://github.com/rezkiy37/Expensify into fea…
rezkiy37 19ff8d8
describe prop better
rezkiy37 059a302
convert getter to methods
rezkiy37 8f952bc
increase bottom spacing
rezkiy37 1de984d
Merge branch 'main' of https://github.com/rezkiy37/Expensify into fea…
rezkiy37 0f794ec
Merge branch 'main' of https://github.com/rezkiy37/Expensify into fea…
rezkiy37 b08423a
integrate limitation generally
rezkiy37 9520db9
fix component did update
rezkiy37 3234a9b
Merge branch 'main' of https://github.com/rezkiy37/Expensify into fea…
rezkiy37 96c23a4
convert to built in feature
rezkiy37 f99086a
rename const
rezkiy37 49154ff
minor updates BaseOptionsSelector
rezkiy37 b4d1537
rename ShowMoreButton
rezkiy37 1080ca0
clarify comments
rezkiy37 c4f1f63
clarify comment
rezkiy37 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 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 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 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 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 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 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,70 @@ | ||
import PropTypes from 'prop-types'; | ||
import React from 'react'; | ||
import {Text, View} from 'react-native'; | ||
import _ from 'underscore'; | ||
import Button from '@components/Button'; | ||
import * as Expensicons from '@components/Icon/Expensicons'; | ||
import useLocalize from '@hooks/useLocalize'; | ||
import * as NumberFormatUtils from '@libs/NumberFormatUtils'; | ||
import stylePropTypes from '@styles/stylePropTypes'; | ||
import styles from '@styles/styles'; | ||
import themeColors from '@styles/themes/default'; | ||
|
||
const propTypes = { | ||
/** Additional styles for container */ | ||
containerStyle: stylePropTypes, | ||
|
||
/** The number of currently shown items */ | ||
currentCount: PropTypes.number, | ||
|
||
/** The total number of items that could be shown */ | ||
totalCount: PropTypes.number, | ||
|
||
/** A handler that fires when button has been pressed */ | ||
onPress: PropTypes.func.isRequired, | ||
}; | ||
|
||
const defaultProps = { | ||
containerStyle: {}, | ||
currentCount: undefined, | ||
totalCount: undefined, | ||
}; | ||
|
||
function ShowMoreButton({containerStyle, currentCount, totalCount, onPress}) { | ||
const {translate, preferredLocale} = useLocalize(); | ||
|
||
const shouldShowCounter = _.isNumber(currentCount) && _.isNumber(totalCount); | ||
|
||
return ( | ||
<View style={[styles.alignItemsCenter, containerStyle]}> | ||
{shouldShowCounter && ( | ||
<Text style={[styles.mb2, styles.textLabelSupporting]}> | ||
{`${translate('common.showing')} `} | ||
<Text style={styles.textStrong}>{currentCount}</Text> | ||
{` ${translate('common.of')} `} | ||
<Text style={styles.textStrong}>{NumberFormatUtils.format(preferredLocale, totalCount)}</Text> | ||
</Text> | ||
)} | ||
<View style={[styles.w100, styles.flexRow, styles.justifyContentBetween, styles.alignItemsCenter]}> | ||
<View style={[styles.shortTermsHorizontalRule, styles.flex1, styles.mr0]} /> | ||
<Button | ||
style={styles.mh0} | ||
small | ||
shouldShowRightIcon | ||
iconFill={themeColors.icon} | ||
iconRight={Expensicons.DownArrow} | ||
text={translate('common.showMore')} | ||
accessibilityLabel={translate('common.showMore')} | ||
onPress={onPress} | ||
/> | ||
<View style={[styles.shortTermsHorizontalRule, styles.flex1, styles.ml0]} /> | ||
</View> | ||
</View> | ||
); | ||
} | ||
|
||
ShowMoreButton.displayName = 'ShowMoreButton'; | ||
ShowMoreButton.propTypes = propTypes; | ||
ShowMoreButton.defaultProps = defaultProps; | ||
|
||
export default ShowMoreButton; |
This file contains 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 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.
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.
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.
Bottom margin missed here which caused #33758