From fd4f9b23beb3fd8b55d4f5649d6eeadbd496a354 Mon Sep 17 00:00:00 2001 From: dhairyasenjaliya Date: Mon, 17 Jul 2023 21:14:12 +0530 Subject: [PATCH 01/12] test: --- src/components/ButtonWithDropdownMenu.js | 18 +++++++++++++----- src/styles/styles.js | 5 ++--- 2 files changed, 15 insertions(+), 8 deletions(-) diff --git a/src/components/ButtonWithDropdownMenu.js b/src/components/ButtonWithDropdownMenu.js index 1396ab601330..bdf05fbc93b3 100644 --- a/src/components/ButtonWithDropdownMenu.js +++ b/src/components/ButtonWithDropdownMenu.js @@ -10,6 +10,7 @@ import Icon from './Icon'; import * as Expensicons from './Icon/Expensicons'; import themeColors from '../styles/themes/default'; import CONST from '../CONST'; +import variables from '../styles/variables'; const propTypes = { /** Text to display for the menu header */ @@ -84,8 +85,10 @@ function ButtonWithDropdownMenu(props) { shouldRemoveRightBorderRadius style={[styles.flex1, styles.pr0]} pressOnEnter + medium + innerStyles={[{height: 40}]} /> - + ) : ( diff --git a/src/styles/styles.js b/src/styles/styles.js index 25eb0a055afc..2f95945a0d3f 100644 --- a/src/styles/styles.js +++ b/src/styles/styles.js @@ -550,9 +550,8 @@ const styles = { buttonDivider: { width: 1, - alignSelf: 'stretch', - backgroundColor: themeColors.appBG, - marginVertical: 1, + backgroundColor: themeColors.text, + height: 28, }, noBorderRadius: { From 399fa555ca46cf303048dba1fecfbba3825e579f Mon Sep 17 00:00:00 2001 From: dhairyasenjaliya Date: Tue, 1 Aug 2023 19:59:09 +0530 Subject: [PATCH 02/12] Adjust styling as per new design --- src/components/ButtonWithDropdownMenu.js | 18 +++++++++++------- src/styles/styles.js | 18 ++++++++++++++++++ 2 files changed, 29 insertions(+), 7 deletions(-) diff --git a/src/components/ButtonWithDropdownMenu.js b/src/components/ButtonWithDropdownMenu.js index bdf05fbc93b3..195941ce307d 100644 --- a/src/components/ButtonWithDropdownMenu.js +++ b/src/components/ButtonWithDropdownMenu.js @@ -86,7 +86,7 @@ function ButtonWithDropdownMenu(props) { style={[styles.flex1, styles.pr0]} pressOnEnter medium - innerStyles={[{height: 40}]} + innerStyles={[styles.dropButtonHeight]} /> @@ -117,6 +119,8 @@ function ButtonWithDropdownMenu(props) { text={selectedItem.text} onPress={(event) => props.onPress(event, props.options[0].value)} pressOnEnter + medium + innerStyles={[styles.dropButtonHeight]} /> )} {props.options.length > 1 && !_.isEmpty(popoverAnchorPosition) && ( diff --git a/src/styles/styles.js b/src/styles/styles.js index 673f73a70c5a..c6c63bb856fd 100644 --- a/src/styles/styles.js +++ b/src/styles/styles.js @@ -3554,6 +3554,24 @@ const styles = { willChangeTransform: { willChange: 'transform', }, + + dropButtonHeight: { + height: variables.componentSizeNormal, + }, + + cartIconContainer: { + height: variables.componentSizeNormal, + paddingRight: 0, + paddingLeft: 0, + }, + + cartIconView: { + borderTopRightRadius: variables.buttonBorderRadius, + borderBottomRightRadius: variables.buttonBorderRadius, + height: variables.componentSizeNormal, + ...flex.flexRow, + ...flex.alignItemsCenter, + }, }; export default styles; From cd58d75bcbfd8f2d8f60b782626d04f6c5bdcb14 Mon Sep 17 00:00:00 2001 From: dhairyasenjaliya Date: Tue, 1 Aug 2023 20:39:11 +0530 Subject: [PATCH 03/12] remove height from another button --- src/components/ButtonWithDropdownMenu.js | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/components/ButtonWithDropdownMenu.js b/src/components/ButtonWithDropdownMenu.js index 195941ce307d..ee8b7812cebf 100644 --- a/src/components/ButtonWithDropdownMenu.js +++ b/src/components/ButtonWithDropdownMenu.js @@ -119,8 +119,6 @@ function ButtonWithDropdownMenu(props) { text={selectedItem.text} onPress={(event) => props.onPress(event, props.options[0].value)} pressOnEnter - medium - innerStyles={[styles.dropButtonHeight]} /> )} {props.options.length > 1 && !_.isEmpty(popoverAnchorPosition) && ( From da12fd001396e6256d647e7a78cb2d99d4cce04e Mon Sep 17 00:00:00 2001 From: dhairyasenjaliya Date: Wed, 2 Aug 2023 11:22:01 +0530 Subject: [PATCH 04/12] use borderwidth instead of normal width --- src/styles/styles.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/styles/styles.js b/src/styles/styles.js index c6c63bb856fd..3a83ba253efb 100644 --- a/src/styles/styles.js +++ b/src/styles/styles.js @@ -560,9 +560,9 @@ const styles = { }, buttonDivider: { - width: 1, - backgroundColor: themeColors.text, height: 28, + borderWidth: 1, + borderColor: themeColors.text, }, noBorderRadius: { From 76ace6f7266315c714446366aaceef421ad4ecc5 Mon Sep 17 00:00:00 2001 From: dhairyasenjaliya Date: Wed, 2 Aug 2023 11:28:30 +0530 Subject: [PATCH 05/12] remove unused import --- src/components/ButtonWithDropdownMenu.js | 1 - 1 file changed, 1 deletion(-) diff --git a/src/components/ButtonWithDropdownMenu.js b/src/components/ButtonWithDropdownMenu.js index ee8b7812cebf..e591099bdc39 100644 --- a/src/components/ButtonWithDropdownMenu.js +++ b/src/components/ButtonWithDropdownMenu.js @@ -10,7 +10,6 @@ import Icon from './Icon'; import * as Expensicons from './Icon/Expensicons'; import themeColors from '../styles/themes/default'; import CONST from '../CONST'; -import variables from '../styles/variables'; const propTypes = { /** Text to display for the menu header */ From 4655faa43a27530eaa8f374fe6730d7d6e47346e Mon Sep 17 00:00:00 2001 From: dhairyasenjaliya Date: Thu, 3 Aug 2023 21:49:52 +0530 Subject: [PATCH 06/12] adjust border as per design --- src/styles/styles.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/styles/styles.js b/src/styles/styles.js index 108144e4afe6..29af3fdd7f74 100644 --- a/src/styles/styles.js +++ b/src/styles/styles.js @@ -565,7 +565,7 @@ const styles = { buttonDivider: { height: 28, - borderWidth: 1, + borderWidth: 0.7, borderColor: themeColors.text, }, From 638d0326c631c60838e75d6b8c29d67b36e22c22 Mon Sep 17 00:00:00 2001 From: dhairyasenjaliya Date: Tue, 8 Aug 2023 01:29:35 +0530 Subject: [PATCH 07/12] Added both size for dropDown option --- src/components/ButtonWithDropdownMenu.js | 25 +++++++++++++------ .../MoneyRequestConfirmationList.js | 2 ++ src/components/SettlementButton.js | 5 ++++ src/styles/StyleUtils.js | 17 +++++++++++++ src/styles/styles.js | 8 +----- 5 files changed, 43 insertions(+), 14 deletions(-) diff --git a/src/components/ButtonWithDropdownMenu.js b/src/components/ButtonWithDropdownMenu.js index e591099bdc39..4fd8c47f690e 100644 --- a/src/components/ButtonWithDropdownMenu.js +++ b/src/components/ButtonWithDropdownMenu.js @@ -10,6 +10,7 @@ import Icon from './Icon'; import * as Expensicons from './Icon/Expensicons'; import themeColors from '../styles/themes/default'; import CONST from '../CONST'; +import * as StyleUtils from '../styles/StyleUtils'; const propTypes = { /** Text to display for the menu header */ @@ -21,6 +22,9 @@ const propTypes = { /** Whether we should show a loading state for the main button */ isLoading: PropTypes.bool, + /** Whether the button size should be large */ + buttonsizelarge: PropTypes.bool, + /** Should the confirmation button be disabled? */ isDisabled: PropTypes.bool, @@ -46,6 +50,7 @@ const defaultProps = { isDisabled: false, menuHeaderText: '', style: [], + buttonsizelarge: false, }; function ButtonWithDropdownMenu(props) { @@ -55,6 +60,7 @@ function ButtonWithDropdownMenu(props) { const {windowWidth, windowHeight} = useWindowDimensions(); const caretButton = useRef(null); const selectedItem = props.options[selectedItemIndex]; + const innerStyleDropButton = StyleUtils.getButtonHeight(props.buttonsizelarge); useEffect(() => { if (!caretButton.current) { @@ -84,8 +90,9 @@ function ButtonWithDropdownMenu(props) { shouldRemoveRightBorderRadius style={[styles.flex1, styles.pr0]} pressOnEnter - medium - innerStyles={[styles.dropButtonHeight]} + large={props.buttonsizelarge} + medium={!props.buttonsizelarge} + innerStyles={[innerStyleDropButton]} />