From 3a72eeff7a741d9276bd636f93327fa7f0c18c84 Mon Sep 17 00:00:00 2001 From: Georgia Monahan Date: Fri, 15 Sep 2023 15:43:11 +0800 Subject: [PATCH 1/5] Remove mWeb Banner --- src/Expensify.js | 1 - src/ONYXKEYS.ts | 4 - src/components/DownloadAppModal.js | 79 ------------------- src/libs/actions/DownloadAppModal.js | 11 --- .../FloatingActionButtonAndPopover.js | 13 +-- 5 files changed, 1 insertion(+), 107 deletions(-) delete mode 100644 src/components/DownloadAppModal.js delete mode 100644 src/libs/actions/DownloadAppModal.js diff --git a/src/Expensify.js b/src/Expensify.js index 1086bd32cff9..dfb223a9e227 100644 --- a/src/Expensify.js +++ b/src/Expensify.js @@ -193,7 +193,6 @@ function Expensify(props) { {shouldInit && ( <> - diff --git a/src/ONYXKEYS.ts b/src/ONYXKEYS.ts index 2e0b75910bae..9e0a05dbf708 100755 --- a/src/ONYXKEYS.ts +++ b/src/ONYXKEYS.ts @@ -87,9 +87,6 @@ const ONYXKEYS = { SESSION: 'session', BETAS: 'betas', - /** Denotes if the Download App Banner has been dismissed */ - SHOW_DOWNLOAD_APP_BANNER: 'showDownloadAppBanner', - /** NVP keys * Contains the user's payPalMe data */ PAYPAL: 'paypal', @@ -306,7 +303,6 @@ type OnyxValues = { [ONYXKEYS.ACTIVE_CLIENTS]: string[]; [ONYXKEYS.DEVICE_ID]: string; [ONYXKEYS.IS_SIDEBAR_LOADED]: boolean; - [ONYXKEYS.SHOW_DOWNLOAD_APP_BANNER]: boolean; [ONYXKEYS.PERSISTED_REQUESTS]: OnyxTypes.Request[]; [ONYXKEYS.QUEUED_ONYX_UPDATES]: OnyxTypes.QueuedOnyxUpdates; [ONYXKEYS.CURRENT_DATE]: string; diff --git a/src/components/DownloadAppModal.js b/src/components/DownloadAppModal.js deleted file mode 100644 index c96c6b3d28c0..000000000000 --- a/src/components/DownloadAppModal.js +++ /dev/null @@ -1,79 +0,0 @@ -import React, {useState} from 'react'; -import PropTypes from 'prop-types'; -import {withOnyx} from 'react-native-onyx'; -import ONYXKEYS from '../ONYXKEYS'; -import styles from '../styles/styles'; -import CONST from '../CONST'; -import AppIcon from '../../assets/images/expensify-app-icon.svg'; -import useLocalize from '../hooks/useLocalize'; -import * as Link from '../libs/actions/Link'; -import * as Browser from '../libs/Browser'; -import getOperatingSystem from '../libs/getOperatingSystem'; -import setShowDownloadAppModal from '../libs/actions/DownloadAppModal'; -import ConfirmModal from './ConfirmModal'; - -const propTypes = { - /** ONYX PROP to hide banner for a user that has dismissed it */ - // eslint-disable-next-line react/forbid-prop-types - showDownloadAppBanner: PropTypes.bool, - - /** Whether the user is logged in */ - isAuthenticated: PropTypes.bool.isRequired, -}; - -const defaultProps = { - showDownloadAppBanner: true, -}; - -function DownloadAppModal({isAuthenticated, showDownloadAppBanner}) { - const [shouldShowBanner, setShouldShowBanner] = useState(Browser.isMobile() && isAuthenticated && showDownloadAppBanner); - - const {translate} = useLocalize(); - - const handleCloseBanner = () => { - setShowDownloadAppModal(false); - setShouldShowBanner(false); - }; - - let link = ''; - - if (getOperatingSystem() === CONST.OS.IOS) { - link = CONST.APP_DOWNLOAD_LINKS.IOS; - } else if (getOperatingSystem() === CONST.OS.ANDROID) { - link = CONST.APP_DOWNLOAD_LINKS.ANDROID; - } - - const handleOpenAppStore = () => { - setShowDownloadAppModal(false); - setShouldShowBanner(false); - Link.openExternalLink(link, true); - }; - - return ( - - ); -} - -DownloadAppModal.displayName = 'DownloadAppModal'; -DownloadAppModal.propTypes = propTypes; -DownloadAppModal.defaultProps = defaultProps; - -export default withOnyx({ - showDownloadAppBanner: { - key: ONYXKEYS.SHOW_DOWNLOAD_APP_BANNER, - }, -})(DownloadAppModal); diff --git a/src/libs/actions/DownloadAppModal.js b/src/libs/actions/DownloadAppModal.js deleted file mode 100644 index 5dc2d3fdca22..000000000000 --- a/src/libs/actions/DownloadAppModal.js +++ /dev/null @@ -1,11 +0,0 @@ -import Onyx from 'react-native-onyx'; -import ONYXKEYS from '../../ONYXKEYS'; - -/** - * @param {Boolean} shouldShowBanner - */ -function setShowDownloadAppModal(shouldShowBanner) { - Onyx.set(ONYXKEYS.SHOW_DOWNLOAD_APP_BANNER, shouldShowBanner); -} - -export default setShowDownloadAppModal; diff --git a/src/pages/home/sidebar/SidebarScreen/FloatingActionButtonAndPopover.js b/src/pages/home/sidebar/SidebarScreen/FloatingActionButtonAndPopover.js index cb77a832705c..e217bc8226b6 100644 --- a/src/pages/home/sidebar/SidebarScreen/FloatingActionButtonAndPopover.js +++ b/src/pages/home/sidebar/SidebarScreen/FloatingActionButtonAndPopover.js @@ -62,9 +62,6 @@ const propTypes = { /** Indicated whether the report data is loading */ isLoading: PropTypes.bool, - /** For first time users, whether the download app banner should show */ - shouldShowDownloadAppBanner: PropTypes.bool, - /** Forwarded ref to FloatingActionButtonAndPopover */ innerRef: PropTypes.oneOfType([PropTypes.func, PropTypes.object]), }; @@ -75,7 +72,6 @@ const defaultProps = { betas: [], isLoading: false, innerRef: null, - shouldShowDownloadAppBanner: true, }; /** @@ -158,12 +154,8 @@ function FloatingActionButtonAndPopover(props) { if (currentRoute && ![NAVIGATORS.CENTRAL_PANE_NAVIGATOR, SCREENS.HOME].includes(currentRoute.name)) { return; } - // Avoid rendering the create menu for first-time users until they have dismissed the download app banner (mWeb only). - if (props.shouldShowDownloadAppBanner && Browser.isMobile()) { - return; - } Welcome.show({routes, showCreateMenu}); - }, [props.shouldShowDownloadAppBanner, props.navigation, showCreateMenu, props.demoInfo]); + }, [props.navigation, showCreateMenu, props.demoInfo]); useEffect(() => { if (!didScreenBecomeInactive()) { @@ -291,9 +283,6 @@ export default compose( isLoading: { key: ONYXKEYS.IS_LOADING_REPORT_DATA, }, - shouldShowDownloadAppBanner: { - key: ONYXKEYS.SHOW_DOWNLOAD_APP_BANNER, - }, }), )( forwardRef((props, ref) => ( From 3bb9c868d6f7e80e8d3d6813968d8fc9abef64e2 Mon Sep 17 00:00:00 2001 From: Georgia Monahan Date: Fri, 15 Sep 2023 15:55:20 +0800 Subject: [PATCH 2/5] remove languages and imports --- src/Expensify.js | 1 - src/components/ConfirmContent.js | 4 ++-- src/languages/es.ts | 5 ----- src/styles/variables.ts | 2 +- 4 files changed, 3 insertions(+), 9 deletions(-) diff --git a/src/Expensify.js b/src/Expensify.js index dfb223a9e227..fba65e42c06c 100644 --- a/src/Expensify.js +++ b/src/Expensify.js @@ -30,7 +30,6 @@ import KeyboardShortcutsModal from './components/KeyboardShortcutsModal'; import AppleAuthWrapper from './components/SignInButtons/AppleAuthWrapper'; import EmojiPicker from './components/EmojiPicker/EmojiPicker'; import * as EmojiPickerAction from './libs/actions/EmojiPickerAction'; -import DownloadAppModal from './components/DownloadAppModal'; import DeeplinkWrapper from './components/DeeplinkWrapper'; // This lib needs to be imported, but it has nothing to export since all it contains is an Onyx connection diff --git a/src/components/ConfirmContent.js b/src/components/ConfirmContent.js index 9a72d4e7d584..ab3e23d6b1c1 100644 --- a/src/components/ConfirmContent.js +++ b/src/components/ConfirmContent.js @@ -100,8 +100,8 @@ function ConfirmContent(props) { diff --git a/src/languages/es.ts b/src/languages/es.ts index 7315c42cebab..25897e071881 100644 --- a/src/languages/es.ts +++ b/src/languages/es.ts @@ -335,11 +335,6 @@ export default { `¡Siempre es genial ver una cara nueva por aquí! Por favor ingresa el código mágico enviado a ${login}. Debería llegar en un par de minutos.`, welcomeEnterMagicCode: ({login}: WelcomeEnterMagicCodeParams) => `Por favor, introduce el código mágico enviado a ${login}. Debería llegar en un par de minutos.`, }, - DownloadAppModal: { - downloadTheApp: 'Descarga la aplicación', - keepTheConversationGoing: 'Mantén la conversación en New Expensify, descarga la aplicación para una experiencia mejorada.', - noThanks: 'No, gracias', - }, login: { hero: { header: 'Divida las facturas, solicite pagos y chatee con sus amigos.', diff --git a/src/styles/variables.ts b/src/styles/variables.ts index eb182ab1eca0..731f3349444c 100644 --- a/src/styles/variables.ts +++ b/src/styles/variables.ts @@ -25,7 +25,7 @@ export default { componentBorderRadiusLarge: 16, componentBorderRadiusCard: 12, componentBorderRadiusRounded: 24, - downloadAppModalAppIconSize: 48, + appModalAppIconSize: 48, buttonBorderRadius: 100, avatarSizeLargeBordered: 88, avatarSizeLarge: 80, From 26d93bb2e3a211b7758291b5ca6943750f087492 Mon Sep 17 00:00:00 2001 From: Georgia Monahan Date: Fri, 15 Sep 2023 16:02:52 +0800 Subject: [PATCH 3/5] remove from es too --- src/languages/en.ts | 5 ----- 1 file changed, 5 deletions(-) diff --git a/src/languages/en.ts b/src/languages/en.ts index 03adaa1e66b1..77851a8a1a38 100755 --- a/src/languages/en.ts +++ b/src/languages/en.ts @@ -344,11 +344,6 @@ export default { `It's always great to see a new face around here! Please enter the magic code sent to ${login}. It should arrive within a minute or two.`, welcomeEnterMagicCode: ({login}: WelcomeEnterMagicCodeParams) => `Please enter the magic code sent to ${login}. It should arrive within a minute or two.`, }, - DownloadAppModal: { - downloadTheApp: 'Download the app', - keepTheConversationGoing: 'Keep the conversation going in New Expensify, download the app for an enhanced experience.', - noThanks: 'No thanks', - }, login: { hero: { header: 'Split bills, request payments, and chat with friends.', From a0f63bd530b64cb0bda61d219ea9b9cf7eafd5d2 Mon Sep 17 00:00:00 2001 From: Georgia Monahan Date: Fri, 15 Sep 2023 16:08:19 +0800 Subject: [PATCH 4/5] Revert to old pattern for running logic on first render --- .../sidebar/SidebarScreen/FloatingActionButtonAndPopover.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/pages/home/sidebar/SidebarScreen/FloatingActionButtonAndPopover.js b/src/pages/home/sidebar/SidebarScreen/FloatingActionButtonAndPopover.js index e217bc8226b6..657af3bd07b3 100644 --- a/src/pages/home/sidebar/SidebarScreen/FloatingActionButtonAndPopover.js +++ b/src/pages/home/sidebar/SidebarScreen/FloatingActionButtonAndPopover.js @@ -155,7 +155,8 @@ function FloatingActionButtonAndPopover(props) { return; } Welcome.show({routes, showCreateMenu}); - }, [props.navigation, showCreateMenu, props.demoInfo]); + // eslint-disable-next-line react-hooks/exhaustive-deps + }, []); useEffect(() => { if (!didScreenBecomeInactive()) { From 0ede2e62e3af24a872f45757486b7a926e49d0ba Mon Sep 17 00:00:00 2001 From: Georgia Monahan Date: Fri, 15 Sep 2023 16:13:48 +0800 Subject: [PATCH 5/5] lint, unused import --- .../home/sidebar/SidebarScreen/FloatingActionButtonAndPopover.js | 1 - 1 file changed, 1 deletion(-) diff --git a/src/pages/home/sidebar/SidebarScreen/FloatingActionButtonAndPopover.js b/src/pages/home/sidebar/SidebarScreen/FloatingActionButtonAndPopover.js index 657af3bd07b3..6acee38beaea 100644 --- a/src/pages/home/sidebar/SidebarScreen/FloatingActionButtonAndPopover.js +++ b/src/pages/home/sidebar/SidebarScreen/FloatingActionButtonAndPopover.js @@ -5,7 +5,6 @@ import lodashGet from 'lodash/get'; import {View} from 'react-native'; import styles from '../../../../styles/styles'; import * as Expensicons from '../../../../components/Icon/Expensicons'; -import * as Browser from '../../../../libs/Browser'; import Navigation from '../../../../libs/Navigation/Navigation'; import ROUTES from '../../../../ROUTES'; import NAVIGATORS from '../../../../NAVIGATORS';