From 5da5f3d5cc0cb381c312052bc5c4687c4c11d50f Mon Sep 17 00:00:00 2001 From: Oliver Wilks Date: Wed, 7 Jun 2023 09:22:03 +0100 Subject: [PATCH 01/13] Added contentContainerStyles prop --- src/components/OptionsSelector/BaseOptionsSelector.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/components/OptionsSelector/BaseOptionsSelector.js b/src/components/OptionsSelector/BaseOptionsSelector.js index df15ad71febc..5609c91aa320 100755 --- a/src/components/OptionsSelector/BaseOptionsSelector.js +++ b/src/components/OptionsSelector/BaseOptionsSelector.js @@ -24,6 +24,9 @@ const propTypes = { /** padding bottom style of safe area */ safeAreaPaddingBottomStyle: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.object), PropTypes.object]), + /** Content container styles for OptionsList */ + contentContainerStyles: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.object), PropTypes.object]), + ...optionsSelectorPropTypes, ...withLocalizePropTypes, ...withNavigationFocusPropTypes, @@ -32,6 +35,7 @@ const propTypes = { const defaultProps = { shouldDelayFocus: false, safeAreaPaddingBottomStyle: {}, + contentContainerStyles: [], ...optionsSelectorDefaultProps, }; @@ -325,7 +329,7 @@ class BaseOptionsSelector extends Component { this.props.onLayout(); } }} - contentContainerStyles={shouldShowFooter ? undefined : [this.props.safeAreaPaddingBottomStyle]} + contentContainerStyles={[!shouldShowFooter && this.props.safeAreaPaddingBottomStyle, ...this.props.contentContainerStyles]} isLoading={!this.props.shouldShowOptions} /> ); From 6dca051004615efcd46047385d4ca55d70a03aa8 Mon Sep 17 00:00:00 2001 From: Oliver Wilks Date: Wed, 7 Jun 2023 09:23:10 +0100 Subject: [PATCH 02/13] Changed styles and passed contentContainerStyles --- src/pages/workspace/WorkspaceInvitePage.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/pages/workspace/WorkspaceInvitePage.js b/src/pages/workspace/WorkspaceInvitePage.js index 60eb0a4c4dcc..681c81b23828 100644 --- a/src/pages/workspace/WorkspaceInvitePage.js +++ b/src/pages/workspace/WorkspaceInvitePage.js @@ -272,8 +272,9 @@ class WorkspaceInvitePage extends React.Component { Navigation.goBack(ROUTES.getWorkspaceMembersRoute(this.props.route.params.policyID)); }} /> - + Date: Wed, 7 Jun 2023 09:23:29 +0100 Subject: [PATCH 03/13] Added flexBasis0 style --- src/styles/utilities/flex.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/styles/utilities/flex.js b/src/styles/utilities/flex.js index a8455a265d51..6cdd0a5b1d6a 100644 --- a/src/styles/utilities/flex.js +++ b/src/styles/utilities/flex.js @@ -126,4 +126,8 @@ export default { flexBasisAuto: { flexBasis: 'auto', }, + + flexBasis0: { + flexBasis: 0, + }, }; From 91ffd6d0292630ed187f28a62a141cfa42434349 Mon Sep 17 00:00:00 2001 From: Oliver Wilks Date: Wed, 7 Jun 2023 12:10:19 +0100 Subject: [PATCH 04/13] Use ternary for safeAreaPaddingBottom --- src/components/OptionsSelector/BaseOptionsSelector.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/components/OptionsSelector/BaseOptionsSelector.js b/src/components/OptionsSelector/BaseOptionsSelector.js index 5609c91aa320..f30830d66747 100755 --- a/src/components/OptionsSelector/BaseOptionsSelector.js +++ b/src/components/OptionsSelector/BaseOptionsSelector.js @@ -286,6 +286,7 @@ class BaseOptionsSelector extends Component { !this.props.isReadOnly && (this.props.shouldShowConfirmButton || this.props.footerContent) && !(this.props.canSelectMultipleOptions && _.isEmpty(this.props.selectedOptions)); const defaultConfirmButtonText = _.isUndefined(this.props.confirmButtonText) ? this.props.translate('common.confirm') : this.props.confirmButtonText; const shouldShowDefaultConfirmButton = !this.props.footerContent && defaultConfirmButtonText; + const safeAreaPaddingBottom = shouldShowFooter ? undefined : this.props.safeAreaPaddingBottomStyle; const textInput = ( (this.textInput = el)} @@ -329,7 +330,7 @@ class BaseOptionsSelector extends Component { this.props.onLayout(); } }} - contentContainerStyles={[!shouldShowFooter && this.props.safeAreaPaddingBottomStyle, ...this.props.contentContainerStyles]} + contentContainerStyles={[safeAreaPaddingBottom, ...this.props.contentContainerStyles]} isLoading={!this.props.shouldShowOptions} /> ); From 6d5430af3ff66abc5e559c6b6cf14c44eb1374e4 Mon Sep 17 00:00:00 2001 From: Oliver Wilks Date: Fri, 9 Jun 2023 09:34:50 +0100 Subject: [PATCH 05/13] Change flex styles for parent view --- src/components/OptionsSelector/BaseOptionsSelector.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/OptionsSelector/BaseOptionsSelector.js b/src/components/OptionsSelector/BaseOptionsSelector.js index f30830d66747..547574b6034e 100755 --- a/src/components/OptionsSelector/BaseOptionsSelector.js +++ b/src/components/OptionsSelector/BaseOptionsSelector.js @@ -341,7 +341,7 @@ class BaseOptionsSelector extends Component { maxIndex={this.state.allOptions.length - 1} onFocusedIndexChanged={this.props.disableArrowKeysActions ? () => {} : this.updateFocusedIndex} > - + {this.props.shouldTextInputAppearBelowOptions ? ( <> {optionsList} From 842ee17d4a9c1f8ff2d90745120c5ea805a899ab Mon Sep 17 00:00:00 2001 From: Oliver Wilks Date: Fri, 9 Jun 2023 12:38:30 +0100 Subject: [PATCH 06/13] Pass listContainerStyles prop to OptionsList --- src/components/OptionsSelector/BaseOptionsSelector.js | 1 + 1 file changed, 1 insertion(+) diff --git a/src/components/OptionsSelector/BaseOptionsSelector.js b/src/components/OptionsSelector/BaseOptionsSelector.js index 547574b6034e..b549b0e67a41 100755 --- a/src/components/OptionsSelector/BaseOptionsSelector.js +++ b/src/components/OptionsSelector/BaseOptionsSelector.js @@ -331,6 +331,7 @@ class BaseOptionsSelector extends Component { } }} contentContainerStyles={[safeAreaPaddingBottom, ...this.props.contentContainerStyles]} + listContainerStyles={this.props.listContainerStyles} isLoading={!this.props.shouldShowOptions} /> ); From 4f2d56bc9a1c8ec21e37d5af01c9afcfda330062 Mon Sep 17 00:00:00 2001 From: Oliver Wilks Date: Fri, 9 Jun 2023 12:39:10 +0100 Subject: [PATCH 07/13] Add listContainerStyles to OptionsSelector --- src/pages/workspace/WorkspaceInvitePage.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pages/workspace/WorkspaceInvitePage.js b/src/pages/workspace/WorkspaceInvitePage.js index 681c81b23828..fec14fcb2860 100644 --- a/src/pages/workspace/WorkspaceInvitePage.js +++ b/src/pages/workspace/WorkspaceInvitePage.js @@ -274,7 +274,7 @@ class WorkspaceInvitePage extends React.Component { /> Date: Fri, 9 Jun 2023 12:39:28 +0100 Subject: [PATCH 08/13] Change contentContainerStyles --- src/pages/workspace/WorkspaceInvitePage.js | 1 + 1 file changed, 1 insertion(+) diff --git a/src/pages/workspace/WorkspaceInvitePage.js b/src/pages/workspace/WorkspaceInvitePage.js index fec14fcb2860..c7ff53903855 100644 --- a/src/pages/workspace/WorkspaceInvitePage.js +++ b/src/pages/workspace/WorkspaceInvitePage.js @@ -274,6 +274,7 @@ class WorkspaceInvitePage extends React.Component { /> Date: Fri, 9 Jun 2023 18:40:38 +0100 Subject: [PATCH 09/13] Rename safeAreaPaddingBottom to safeAreaPaddingBottomStyle Co-authored-by: Luthfi --- src/components/OptionsSelector/BaseOptionsSelector.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/OptionsSelector/BaseOptionsSelector.js b/src/components/OptionsSelector/BaseOptionsSelector.js index b549b0e67a41..7205f4c31b57 100755 --- a/src/components/OptionsSelector/BaseOptionsSelector.js +++ b/src/components/OptionsSelector/BaseOptionsSelector.js @@ -286,7 +286,7 @@ class BaseOptionsSelector extends Component { !this.props.isReadOnly && (this.props.shouldShowConfirmButton || this.props.footerContent) && !(this.props.canSelectMultipleOptions && _.isEmpty(this.props.selectedOptions)); const defaultConfirmButtonText = _.isUndefined(this.props.confirmButtonText) ? this.props.translate('common.confirm') : this.props.confirmButtonText; const shouldShowDefaultConfirmButton = !this.props.footerContent && defaultConfirmButtonText; - const safeAreaPaddingBottom = shouldShowFooter ? undefined : this.props.safeAreaPaddingBottomStyle; + const safeAreaPaddingBottomStyle = shouldShowFooter ? undefined : this.props.safeAreaPaddingBottomStyle; const textInput = ( (this.textInput = el)} From b4158964813e368f02888a18a3f80623d58ee4bf Mon Sep 17 00:00:00 2001 From: Oliver Wilks Date: Fri, 9 Jun 2023 18:51:51 +0100 Subject: [PATCH 10/13] Rename safeAreaPaddingBottomStyle usage --- src/components/OptionsSelector/BaseOptionsSelector.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/OptionsSelector/BaseOptionsSelector.js b/src/components/OptionsSelector/BaseOptionsSelector.js index 7205f4c31b57..0de681f2524e 100755 --- a/src/components/OptionsSelector/BaseOptionsSelector.js +++ b/src/components/OptionsSelector/BaseOptionsSelector.js @@ -330,7 +330,7 @@ class BaseOptionsSelector extends Component { this.props.onLayout(); } }} - contentContainerStyles={[safeAreaPaddingBottom, ...this.props.contentContainerStyles]} + contentContainerStyles={[safeAreaPaddingBottomStyle, ...this.props.contentContainerStyles]} listContainerStyles={this.props.listContainerStyles} isLoading={!this.props.shouldShowOptions} /> From 5ae1cf27f406c5f3c5922904498ba896a334efa6 Mon Sep 17 00:00:00 2001 From: Oliver Wilks Date: Fri, 9 Jun 2023 18:54:10 +0100 Subject: [PATCH 11/13] Add listContainerStyles propTypes and defaultProps --- src/components/OptionsSelector/BaseOptionsSelector.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/components/OptionsSelector/BaseOptionsSelector.js b/src/components/OptionsSelector/BaseOptionsSelector.js index 0de681f2524e..7bcc55cf6e58 100755 --- a/src/components/OptionsSelector/BaseOptionsSelector.js +++ b/src/components/OptionsSelector/BaseOptionsSelector.js @@ -27,6 +27,9 @@ const propTypes = { /** Content container styles for OptionsList */ contentContainerStyles: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.object), PropTypes.object]), + /** List container styles for OptionsList */ + listContainerStyles: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.object), PropTypes.object]), + ...optionsSelectorPropTypes, ...withLocalizePropTypes, ...withNavigationFocusPropTypes, @@ -36,6 +39,7 @@ const defaultProps = { shouldDelayFocus: false, safeAreaPaddingBottomStyle: {}, contentContainerStyles: [], + listContainerStyles: [], ...optionsSelectorDefaultProps, }; @@ -307,7 +311,7 @@ class BaseOptionsSelector extends Component { /> ); const optionsList = ( - (this.list = el)} optionHoveredStyle={this.props.optionHoveredStyle} onSelectRow={this.selectRow} From 7975a86fef1c78893921ab7af6e6fee14bbbee94 Mon Sep 17 00:00:00 2001 From: Oliver Wilks Date: Fri, 9 Jun 2023 19:03:54 +0100 Subject: [PATCH 12/13] Fix error --- src/components/OptionsSelector/BaseOptionsSelector.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/OptionsSelector/BaseOptionsSelector.js b/src/components/OptionsSelector/BaseOptionsSelector.js index 7bcc55cf6e58..54b6b2271a98 100755 --- a/src/components/OptionsSelector/BaseOptionsSelector.js +++ b/src/components/OptionsSelector/BaseOptionsSelector.js @@ -311,7 +311,7 @@ class BaseOptionsSelector extends Component { /> ); const optionsList = ( - (this.list = el)} optionHoveredStyle={this.props.optionHoveredStyle} onSelectRow={this.selectRow} From 7cc5d93c554bc8e798467c6d68aabf7015c7529d Mon Sep 17 00:00:00 2001 From: Oliver Wilks Date: Sat, 10 Jun 2023 13:26:11 +0100 Subject: [PATCH 13/13] Add flex1 to listContentContainer defaultProps --- src/components/OptionsSelector/BaseOptionsSelector.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/OptionsSelector/BaseOptionsSelector.js b/src/components/OptionsSelector/BaseOptionsSelector.js index 54b6b2271a98..71b2d112cb90 100755 --- a/src/components/OptionsSelector/BaseOptionsSelector.js +++ b/src/components/OptionsSelector/BaseOptionsSelector.js @@ -39,7 +39,7 @@ const defaultProps = { shouldDelayFocus: false, safeAreaPaddingBottomStyle: {}, contentContainerStyles: [], - listContainerStyles: [], + listContainerStyles: [styles.flex1], ...optionsSelectorDefaultProps, };