From 6f95d5b246c90b27b2ad16bb7bcb2c52208e7d45 Mon Sep 17 00:00:00 2001 From: cdOut <88325488+cdOut@users.noreply.github.com> Date: Thu, 7 Dec 2023 14:39:44 +0100 Subject: [PATCH 01/11] add Educational Interstitial as popup and RHP --- .../simple-illustration__commentbubbles.svg | 22 ++++ .../simple-illustration__hourglass.svg | 56 +++++++++ .../simple-illustration__trashcan.svg | 52 +++++++++ src/ROUTES.ts | 1 + src/components/Icon/Illustrations.ts | 6 + src/components/ProcessMoneyRequestHoldMenu.js | 106 ++++++++++++++++++ src/languages/en.ts | 8 ++ .../AppNavigator/ModalStackNavigators.js | 5 + .../Navigators/RightModalNavigator.js | 4 + src/libs/Navigation/linkingConfig.js | 5 + src/pages/ProcessMoneyRequestHoldPage.js | 94 ++++++++++++++++ src/styles/styles.ts | 15 +++ src/styles/variables.ts | 1 + 13 files changed, 375 insertions(+) create mode 100644 assets/images/simple-illustrations/simple-illustration__commentbubbles.svg create mode 100644 assets/images/simple-illustrations/simple-illustration__hourglass.svg create mode 100644 assets/images/simple-illustrations/simple-illustration__trashcan.svg create mode 100644 src/components/ProcessMoneyRequestHoldMenu.js create mode 100644 src/pages/ProcessMoneyRequestHoldPage.js diff --git a/assets/images/simple-illustrations/simple-illustration__commentbubbles.svg b/assets/images/simple-illustrations/simple-illustration__commentbubbles.svg new file mode 100644 index 000000000000..829d3ee2e3fe --- /dev/null +++ b/assets/images/simple-illustrations/simple-illustration__commentbubbles.svg @@ -0,0 +1,22 @@ + + + + + + + + + + + + diff --git a/assets/images/simple-illustrations/simple-illustration__hourglass.svg b/assets/images/simple-illustrations/simple-illustration__hourglass.svg new file mode 100644 index 000000000000..539e1e45b795 --- /dev/null +++ b/assets/images/simple-illustrations/simple-illustration__hourglass.svg @@ -0,0 +1,56 @@ + + + + + + + + + + + + + + + + + + + + + + + diff --git a/assets/images/simple-illustrations/simple-illustration__trashcan.svg b/assets/images/simple-illustrations/simple-illustration__trashcan.svg new file mode 100644 index 000000000000..4e66efa0a67e --- /dev/null +++ b/assets/images/simple-illustrations/simple-illustration__trashcan.svg @@ -0,0 +1,52 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/ROUTES.ts b/src/ROUTES.ts index 26589a3db0e0..a4ce8e46df6c 100644 --- a/src/ROUTES.ts +++ b/src/ROUTES.ts @@ -379,6 +379,7 @@ export default { route: 'referral/:contentType', getRoute: (contentType: string) => `referral/${contentType}`, }, + PROCESS_MONEY_REQUEST_HOLD: 'hold-request-educational', // These are some one-off routes that will be removed once they're no longer needed (see GH issues for details) SAASTR: 'saastr', diff --git a/src/components/Icon/Illustrations.ts b/src/components/Icon/Illustrations.ts index 440350895826..6b486c7407b4 100644 --- a/src/components/Icon/Illustrations.ts +++ b/src/components/Icon/Illustrations.ts @@ -30,11 +30,13 @@ import BankArrow from '@assets/images/simple-illustrations/simple-illustration__ import PinkBill from '@assets/images/simple-illustrations/simple-illustration__bill.svg'; import ChatBubbles from '@assets/images/simple-illustrations/simple-illustration__chatbubbles.svg'; import CoffeeMug from '@assets/images/simple-illustrations/simple-illustration__coffeemug.svg'; +import CommentBubbles from '@assets/images/simple-illustrations/simple-illustration__commentbubbles.svg'; import ConciergeBubble from '@assets/images/simple-illustrations/simple-illustration__concierge-bubble.svg'; import ConciergeNew from '@assets/images/simple-illustrations/simple-illustration__concierge.svg'; import CreditCardsNew from '@assets/images/simple-illustrations/simple-illustration__credit-cards.svg'; import EmailAddress from '@assets/images/simple-illustrations/simple-illustration__email-address.svg'; import HandEarth from '@assets/images/simple-illustrations/simple-illustration__handearth.svg'; +import Hourglass from '@assets/images/simple-illustrations/simple-illustration__hourglass.svg'; import InvoiceBlue from '@assets/images/simple-illustrations/simple-illustration__invoice.svg'; import LockOpen from '@assets/images/simple-illustrations/simple-illustration__lockopen.svg'; import Luggage from '@assets/images/simple-illustrations/simple-illustration__luggage.svg'; @@ -47,6 +49,7 @@ import SanFrancisco from '@assets/images/simple-illustrations/simple-illustratio import ShieldYellow from '@assets/images/simple-illustrations/simple-illustration__shield.svg'; import ThumbsUpStars from '@assets/images/simple-illustrations/simple-illustration__thumbsupstars.svg'; import TrackShoe from '@assets/images/simple-illustrations/simple-illustration__track-shoe.svg'; +import TrashCan from '@assets/images/simple-illustrations/simple-illustration__trashcan.svg'; import TreasureChest from '@assets/images/simple-illustrations/simple-illustration__treasurechest.svg'; export { @@ -100,4 +103,7 @@ export { Hands, HandEarth, SmartScan, + Hourglass, + CommentBubbles, + TrashCan, }; diff --git a/src/components/ProcessMoneyRequestHoldMenu.js b/src/components/ProcessMoneyRequestHoldMenu.js new file mode 100644 index 000000000000..78da0a5ba834 --- /dev/null +++ b/src/components/ProcessMoneyRequestHoldMenu.js @@ -0,0 +1,106 @@ +import _ from 'lodash'; +import PropTypes from 'prop-types'; +import React, {useMemo} from 'react'; +import {View} from 'react-native'; +import useLocalize from '@hooks/useLocalize'; +import useThemeStyles from '@styles/useThemeStyles'; +import variables from '@styles/variables'; +import Button from './Button'; +import Icon from './Icon'; +import * as Illustrations from './Icon/Illustrations'; +import Popover from './Popover'; +import refPropTypes from './refPropTypes'; +import Text from './Text'; + +const propTypes = { + isVisible: PropTypes.bool.isRequired, + onClose: PropTypes.func.isRequired, + onConfirm: PropTypes.func.isRequired, + anchorPosition: PropTypes.shape({ + horizontal: PropTypes.number, + vertical: PropTypes.number, + }), + anchorRef: refPropTypes, +}; + +const defaultProps = { + anchorPosition: {}, + anchorRef: () => {}, +}; + +function ProcessMoneyRequestHoldMenu({isVisible, onClose, onConfirm, anchorPosition, anchorRef}) { + const {translate} = useLocalize(); + const styles = useThemeStyles(); + + const holdMenuSections = useMemo(() => { + const baseHoldMenuSections = [ + { + icon: Illustrations.Hourglass, + titleTranslationKey: 'iou.whatIsHoldTitle', + descriptionTranslationKey: 'iou.whatIsHoldExplain', + }, + { + icon: Illustrations.CommentBubbles, + titleTranslationKey: 'iou.holdIsTemporaryTitle', + descriptionTranslationKey: 'iou.holdIsTemporaryExplain', + }, + { + icon: Illustrations.TrashCan, + titleTranslationKey: 'iou.deleteHoldTitle', + descriptionTranslationKey: 'iou.deleteHoldExplain', + }, + ]; + + return _.map(baseHoldMenuSections, (section, index) => ( + + + + {translate(section.titleTranslationKey)} + + {translate(section.descriptionTranslationKey)} + + + + )); + }, [styles, translate]); + + return ( + + + + {translate('iou.holdEducationalTitle')} + {translate('iou.hold')} + + {holdMenuSections} +