From 51cd249f1b528ea754705ba0594012da6d72d1d6 Mon Sep 17 00:00:00 2001 From: Christoph Pader Date: Tue, 27 Jun 2023 13:27:01 +0200 Subject: [PATCH 001/102] add preferences entry for color theme page --- src/pages/settings/Preferences/PreferencesPage.js | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/src/pages/settings/Preferences/PreferencesPage.js b/src/pages/settings/Preferences/PreferencesPage.js index 81b129439e96..44baf2be54c4 100755 --- a/src/pages/settings/Preferences/PreferencesPage.js +++ b/src/pages/settings/Preferences/PreferencesPage.js @@ -24,6 +24,9 @@ const propTypes = { /** The chat priority mode */ priorityMode: PropTypes.string, + /** The app's color theme */ + colorTheme: PropTypes.string, + /** The details about the user that is signed in */ user: PropTypes.shape({ /** Whether or not the user is subscribed to news updates */ @@ -39,12 +42,14 @@ const propTypes = { const defaultProps = { priorityMode: CONST.PRIORITY_MODE.DEFAULT, + colorTheme: CONST.COLOR_THEME.DARK, user: {}, }; function PreferencesPage(props) { const priorityModes = props.translate('priorityModePage.priorityModes'); const languages = props.translate('languagePage.languages'); + const colorThemes = props.translate('colorThemePage.colorThemes'); // Enable additional test features in the staging or dev environments const shouldShowTestToolMenu = _.contains([CONST.ENVIRONMENT.STAGING, CONST.ENVIRONMENT.ADHOC, CONST.ENVIRONMENT.DEV], props.environment); @@ -87,6 +92,13 @@ function PreferencesPage(props) { description={props.translate('languagePage.language')} onPress={() => Navigation.navigate(ROUTES.SETTINGS_LANGUAGE)} /> + Navigation.navigate(ROUTES.SETTINGS_COLOR_THEME)} + /> + {shouldShowTestToolMenu && ( @@ -109,6 +121,9 @@ export default compose( priorityMode: { key: ONYXKEYS.NVP_PRIORITY_MODE, }, + colorTheme: { + key: ONYXKEYS.COLOR_THEME, + }, user: { key: ONYXKEYS.USER, }, From bb6dae1a3a3db7238aff632474c84221cfdd2d56 Mon Sep 17 00:00:00 2001 From: Christoph Pader Date: Wed, 5 Jul 2023 12:43:29 +0200 Subject: [PATCH 002/102] update theme naming --- .../settings/Preferences/PreferencesPage.js | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/src/pages/settings/Preferences/PreferencesPage.js b/src/pages/settings/Preferences/PreferencesPage.js index 44baf2be54c4..2e133e7c7802 100755 --- a/src/pages/settings/Preferences/PreferencesPage.js +++ b/src/pages/settings/Preferences/PreferencesPage.js @@ -25,7 +25,7 @@ const propTypes = { priorityMode: PropTypes.string, /** The app's color theme */ - colorTheme: PropTypes.string, + preferredTheme: PropTypes.string, /** The details about the user that is signed in */ user: PropTypes.shape({ @@ -42,14 +42,14 @@ const propTypes = { const defaultProps = { priorityMode: CONST.PRIORITY_MODE.DEFAULT, - colorTheme: CONST.COLOR_THEME.DARK, + preferredTheme: CONST.DEFAULT_THEME, user: {}, }; function PreferencesPage(props) { const priorityModes = props.translate('priorityModePage.priorityModes'); const languages = props.translate('languagePage.languages'); - const colorThemes = props.translate('colorThemePage.colorThemes'); + const themes = props.translate('themePage.themes'); // Enable additional test features in the staging or dev environments const shouldShowTestToolMenu = _.contains([CONST.ENVIRONMENT.STAGING, CONST.ENVIRONMENT.ADHOC, CONST.ENVIRONMENT.DEV], props.environment); @@ -94,11 +94,10 @@ function PreferencesPage(props) { /> Navigation.navigate(ROUTES.SETTINGS_COLOR_THEME)} + title={themes[props.preferredTheme].label} + description={props.translate('themePage.theme')} + onPress={() => Navigation.navigate(ROUTES.SETTINGS_THEME)} /> - {shouldShowTestToolMenu && ( @@ -121,8 +120,8 @@ export default compose( priorityMode: { key: ONYXKEYS.NVP_PRIORITY_MODE, }, - colorTheme: { - key: ONYXKEYS.COLOR_THEME, + preferredTheme: { + key: ONYXKEYS.PREFERRED_THEME, }, user: { key: ONYXKEYS.USER, From 0f6a0d99a4a2eaec8ce7fa2771b5f6d3b0b8ae43 Mon Sep 17 00:00:00 2001 From: Christoph Pader Date: Tue, 11 Jul 2023 11:34:49 +0200 Subject: [PATCH 003/102] default to DEFAULT_THEME if onyx key is not set --- src/pages/settings/Preferences/PreferencesPage.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pages/settings/Preferences/PreferencesPage.js b/src/pages/settings/Preferences/PreferencesPage.js index 2e133e7c7802..5ec13453d05d 100755 --- a/src/pages/settings/Preferences/PreferencesPage.js +++ b/src/pages/settings/Preferences/PreferencesPage.js @@ -94,7 +94,7 @@ function PreferencesPage(props) { /> Navigation.navigate(ROUTES.SETTINGS_THEME)} /> From cfc058f5f0818cbab00973d4761386284459db46 Mon Sep 17 00:00:00 2001 From: Someshwar Tripathi Date: Sat, 4 Nov 2023 11:35:21 +0530 Subject: [PATCH 004/102] Add popover with overlay to confirm Bank Account deletion --- src/pages/settings/Wallet/WalletPage/WalletPage.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/pages/settings/Wallet/WalletPage/WalletPage.js b/src/pages/settings/Wallet/WalletPage/WalletPage.js index 2387f5f23e6c..5d89f8a6943c 100644 --- a/src/pages/settings/Wallet/WalletPage/WalletPage.js +++ b/src/pages/settings/Wallet/WalletPage/WalletPage.js @@ -5,7 +5,6 @@ import {withOnyx} from 'react-native-onyx'; import _ from 'underscore'; import AddPaymentMethodMenu from '@components/AddPaymentMethodMenu'; import Button from '@components/Button'; -import ConfirmContent from '@components/ConfirmContent'; import CurrentWalletBalance from '@components/CurrentWalletBalance'; import HeaderWithBackButton from '@components/HeaderWithBackButton'; import Icon from '@components/Icon'; @@ -37,6 +36,7 @@ import CONST from '@src/CONST'; import ONYXKEYS from '@src/ONYXKEYS'; import ROUTES from '@src/ROUTES'; import {defaultProps, propTypes} from './walletPagePropTypes'; +import ConfirmModal from '@components/ConfirmModal'; function WalletPage({bankAccountList, betas, cardList, fundList, isLoadingPaymentMethods, network, shouldListenForResize, userWallet, walletTerms}) { const {translate} = useLocalize(); @@ -513,7 +513,8 @@ function WalletPage({bankAccountList, betas, cardList, fundList, isLoadingPaymen /> ) : ( - { deletePaymentMethod(); hideDefaultDeleteMenu(); From c098335efbcd8855489501cad4cea03e5e36993e Mon Sep 17 00:00:00 2001 From: Someshwar Tripathi Date: Mon, 6 Nov 2023 23:17:49 +0530 Subject: [PATCH 005/102] lint fix --- src/pages/settings/Wallet/WalletPage/WalletPage.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pages/settings/Wallet/WalletPage/WalletPage.js b/src/pages/settings/Wallet/WalletPage/WalletPage.js index 5d89f8a6943c..1b6e70b5e807 100644 --- a/src/pages/settings/Wallet/WalletPage/WalletPage.js +++ b/src/pages/settings/Wallet/WalletPage/WalletPage.js @@ -5,6 +5,7 @@ import {withOnyx} from 'react-native-onyx'; import _ from 'underscore'; import AddPaymentMethodMenu from '@components/AddPaymentMethodMenu'; import Button from '@components/Button'; +import ConfirmModal from '@components/ConfirmModal'; import CurrentWalletBalance from '@components/CurrentWalletBalance'; import HeaderWithBackButton from '@components/HeaderWithBackButton'; import Icon from '@components/Icon'; @@ -36,7 +37,6 @@ import CONST from '@src/CONST'; import ONYXKEYS from '@src/ONYXKEYS'; import ROUTES from '@src/ROUTES'; import {defaultProps, propTypes} from './walletPagePropTypes'; -import ConfirmModal from '@components/ConfirmModal'; function WalletPage({bankAccountList, betas, cardList, fundList, isLoadingPaymentMethods, network, shouldListenForResize, userWallet, walletTerms}) { const {translate} = useLocalize(); From 9f464234cb9ef4a702311b214e7d248b726457da Mon Sep 17 00:00:00 2001 From: Someshwar Tripathi Date: Thu, 16 Nov 2023 17:24:05 +0530 Subject: [PATCH 006/102] Move onModalHide to ConfirmModal prop --- src/pages/settings/Wallet/WalletPage/WalletPage.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pages/settings/Wallet/WalletPage/WalletPage.js b/src/pages/settings/Wallet/WalletPage/WalletPage.js index 1b6e70b5e807..35ce5dd5158e 100644 --- a/src/pages/settings/Wallet/WalletPage/WalletPage.js +++ b/src/pages/settings/Wallet/WalletPage/WalletPage.js @@ -481,7 +481,6 @@ function WalletPage({bankAccountList, betas, cardList, fundList, isLoadingPaymen }} withoutOverlay anchorRef={paymentMethodButtonRef} - onModalHide={resetSelectedPaymentMethodData} > {!showConfirmDeleteContent ? ( @@ -531,6 +530,7 @@ function WalletPage({bankAccountList, betas, cardList, fundList, isLoadingPaymen }} shouldShowCancelButton danger + onModalHide={resetSelectedPaymentMethodData} /> )} From 146570deef4aa0db98d4fe45990cdfcad01e9642 Mon Sep 17 00:00:00 2001 From: Someshwar Tripathi Date: Thu, 16 Nov 2023 17:35:05 +0530 Subject: [PATCH 007/102] Improve Confirm Modal Visibility logic --- .../settings/Wallet/WalletPage/WalletPage.js | 80 +++++++++---------- 1 file changed, 36 insertions(+), 44 deletions(-) diff --git a/src/pages/settings/Wallet/WalletPage/WalletPage.js b/src/pages/settings/Wallet/WalletPage/WalletPage.js index 35ce5dd5158e..780c6d767c12 100644 --- a/src/pages/settings/Wallet/WalletPage/WalletPage.js +++ b/src/pages/settings/Wallet/WalletPage/WalletPage.js @@ -482,60 +482,52 @@ function WalletPage({bankAccountList, betas, cardList, fundList, isLoadingPaymen withoutOverlay anchorRef={paymentMethodButtonRef} > - {!showConfirmDeleteContent ? ( - - {isPopoverBottomMount && ( - - )} - {shouldShowMakeDefaultButton && ( -