diff --git a/assets/images/google-meet.svg b/assets/images/google-meet.svg deleted file mode 100644 index 8def88aa6edc..000000000000 --- a/assets/images/google-meet.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/assets/images/zoom-icon.svg b/assets/images/zoom-icon.svg deleted file mode 100644 index 81f025aedf79..000000000000 --- a/assets/images/zoom-icon.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/src/CONST.ts b/src/CONST.ts index b27923465a1f..c0828b392a53 100755 --- a/src/CONST.ts +++ b/src/CONST.ts @@ -456,8 +456,6 @@ const CONST = { EMPTY_ARRAY, EMPTY_OBJECT, USE_EXPENSIFY_URL, - NEW_ZOOM_MEETING_URL: 'https://zoom.us/start/videomeeting', - NEW_GOOGLE_MEET_MEETING_URL: 'https://meet.google.com/new', GOOGLE_MEET_URL_ANDROID: 'https://meet.google.com', GOOGLE_DOC_IMAGE_LINK_MATCH: 'googleusercontent.com', IMAGE_BASE64_MATCH: 'base64', diff --git a/src/components/MoneyReportHeader.tsx b/src/components/MoneyReportHeader.tsx index 5209ab894828..c9b35b08f85e 100644 --- a/src/components/MoneyReportHeader.tsx +++ b/src/components/MoneyReportHeader.tsx @@ -2,8 +2,6 @@ import React, {useMemo} from 'react'; import {View} from 'react-native'; import type {OnyxEntry} from 'react-native-onyx'; import {withOnyx} from 'react-native-onyx'; -import GoogleMeetIcon from '@assets/images/google-meet.svg'; -import ZoomIcon from '@assets/images/zoom-icon.svg'; import useLocalize from '@hooks/useLocalize'; import useThemeStyles from '@hooks/useThemeStyles'; import useWindowDimensions from '@hooks/useWindowDimensions'; @@ -12,8 +10,6 @@ import * as HeaderUtils from '@libs/HeaderUtils'; import Navigation from '@libs/Navigation/Navigation'; import * as ReportUtils from '@libs/ReportUtils'; import * as IOU from '@userActions/IOU'; -import * as Link from '@userActions/Link'; -import * as Session from '@userActions/Session'; import CONST from '@src/CONST'; import ONYXKEYS from '@src/ONYXKEYS'; import ROUTES from '@src/ROUTES'; @@ -90,22 +86,6 @@ function MoneyReportHeader({session, policy, chatReport, nextStep, report: money ); const threeDotsMenuItems = [HeaderUtils.getPinMenuItem(moneyRequestReport)]; - if (!ReportUtils.isArchivedRoom(chatReport)) { - threeDotsMenuItems.push({ - icon: ZoomIcon, - text: translate('videoChatButtonAndMenu.zoom'), - onSelected: Session.checkIfActionIsAllowed(() => { - Link.openExternalLink(CONST.NEW_ZOOM_MEETING_URL); - }), - }); - threeDotsMenuItems.push({ - icon: GoogleMeetIcon, - text: translate('videoChatButtonAndMenu.googleMeet'), - onSelected: Session.checkIfActionIsAllowed(() => { - Link.openExternalLink(CONST.NEW_GOOGLE_MEET_MEETING_URL); - }), - }); - } return ( diff --git a/src/components/VideoChatButtonAndMenu/BaseVideoChatButtonAndMenu.tsx b/src/components/VideoChatButtonAndMenu/BaseVideoChatButtonAndMenu.tsx deleted file mode 100755 index 9f615cef525d..000000000000 --- a/src/components/VideoChatButtonAndMenu/BaseVideoChatButtonAndMenu.tsx +++ /dev/null @@ -1,139 +0,0 @@ -import React, {useCallback, useEffect, useRef, useState} from 'react'; -import {Dimensions, View} from 'react-native'; -import GoogleMeetIcon from '@assets/images/google-meet.svg'; -import ZoomIcon from '@assets/images/zoom-icon.svg'; -import Icon from '@components/Icon'; -import * as Expensicons from '@components/Icon/Expensicons'; -import MenuItem from '@components/MenuItem'; -import Popover from '@components/Popover'; -import PressableWithoutFeedback from '@components/Pressable/PressableWithoutFeedback'; -import Tooltip from '@components/Tooltip/PopoverAnchorTooltip'; -import useLocalize from '@hooks/useLocalize'; -import useTheme from '@hooks/useTheme'; -import useThemeStyles from '@hooks/useThemeStyles'; -import useWindowDimensions from '@hooks/useWindowDimensions'; -import * as Link from '@userActions/Link'; -import * as Session from '@userActions/Session'; -import CONST from '@src/CONST'; -import type VideoChatButtonAndMenuProps from './types'; - -type BaseVideoChatButtonAndMenuProps = VideoChatButtonAndMenuProps & { - /** Link to open when user wants to create a new google meet meeting */ - googleMeetURL: string; -}; - -function BaseVideoChatButtonAndMenu({googleMeetURL, isConcierge = false, guideCalendarLink}: BaseVideoChatButtonAndMenuProps) { - const theme = useTheme(); - const styles = useThemeStyles(); - const {translate} = useLocalize(); - const {isSmallScreenWidth} = useWindowDimensions(); - const [isVideoChatMenuActive, setIsVideoChatMenuActive] = useState(false); - const [videoChatIconPosition, setVideoChatIconPosition] = useState({x: 0, y: 0}); - const videoChatIconWrapperRef = useRef(null); - const videoChatButtonRef = useRef(null); - - const menuItemData = [ - { - icon: ZoomIcon, - text: translate('videoChatButtonAndMenu.zoom'), - onPress: () => { - setIsVideoChatMenuActive(false); - Link.openExternalLink(CONST.NEW_ZOOM_MEETING_URL); - }, - }, - { - icon: GoogleMeetIcon, - text: translate('videoChatButtonAndMenu.googleMeet'), - onPress: () => { - setIsVideoChatMenuActive(false); - Link.openExternalLink(googleMeetURL); - }, - }, - ]; - - /** - * This gets called onLayout to find the coordinates of the wrapper for the video chat button. - */ - const measureVideoChatIconPosition = useCallback(() => { - if (!videoChatIconWrapperRef.current) { - return; - } - - videoChatIconWrapperRef.current.measureInWindow((x, y) => { - setVideoChatIconPosition({x, y}); - }); - }, []); - - useEffect(() => { - const dimensionsEventListener = Dimensions.addEventListener('change', measureVideoChatIconPosition); - - return () => { - if (!dimensionsEventListener) { - return; - } - - dimensionsEventListener.remove(); - }; - }, [measureVideoChatIconPosition]); - - return ( - <> - - - { - // Drop focus to avoid blue focus ring. - videoChatButtonRef.current?.blur(); - - // If this is the Concierge chat, we'll open the modal for requesting a setup call instead - if (isConcierge && guideCalendarLink) { - Link.openExternalLink(guideCalendarLink); - return; - } - setIsVideoChatMenuActive((previousVal) => !previousVal); - })} - style={styles.touchableButtonImage} - accessibilityLabel={translate('videoChatButtonAndMenu.tooltip')} - role={CONST.ROLE.BUTTON} - > - - - - - - setIsVideoChatMenuActive(false)} - isVisible={isVideoChatMenuActive} - anchorPosition={{ - left: videoChatIconPosition.x - 150, - top: videoChatIconPosition.y + 40, - }} - withoutOverlay - anchorRef={videoChatButtonRef} - > - - {menuItemData.map(({icon, text, onPress}) => ( - - ))} - - - - ); -} - -BaseVideoChatButtonAndMenu.displayName = 'BaseVideoChatButtonAndMenu'; - -export default BaseVideoChatButtonAndMenu; diff --git a/src/components/VideoChatButtonAndMenu/index.android.tsx b/src/components/VideoChatButtonAndMenu/index.android.tsx deleted file mode 100644 index 838d296074fa..000000000000 --- a/src/components/VideoChatButtonAndMenu/index.android.tsx +++ /dev/null @@ -1,21 +0,0 @@ -import React from 'react'; -import CONST from '@src/CONST'; -import BaseVideoChatButtonAndMenu from './BaseVideoChatButtonAndMenu'; -import type VideoChatButtonAndMenuProps from './types'; - -// On Android creating a new google meet meeting requires the CALL_PHONE permission in some cases -// so we're just opening the google meet app instead, more details: -// https://github.com/Expensify/App/issues/8851#issuecomment-1120236904 -function VideoChatButtonAndMenu(props: VideoChatButtonAndMenuProps) { - return ( - - ); -} - -VideoChatButtonAndMenu.displayName = 'VideoChatButtonAndMenu'; - -export default VideoChatButtonAndMenu; diff --git a/src/components/VideoChatButtonAndMenu/index.tsx b/src/components/VideoChatButtonAndMenu/index.tsx deleted file mode 100644 index fa381c18d64a..000000000000 --- a/src/components/VideoChatButtonAndMenu/index.tsx +++ /dev/null @@ -1,18 +0,0 @@ -import React from 'react'; -import CONST from '@src/CONST'; -import BaseVideoChatButtonAndMenu from './BaseVideoChatButtonAndMenu'; -import type VideoChatButtonAndMenuProps from './types'; - -function VideoChatButtonAndMenu(props: VideoChatButtonAndMenuProps) { - return ( - - ); -} - -VideoChatButtonAndMenu.displayName = 'VideoChatButtonAndMenu'; - -export default VideoChatButtonAndMenu; diff --git a/src/components/VideoChatButtonAndMenu/types.ts b/src/components/VideoChatButtonAndMenu/types.ts deleted file mode 100644 index b8e263b48d01..000000000000 --- a/src/components/VideoChatButtonAndMenu/types.ts +++ /dev/null @@ -1,9 +0,0 @@ -type VideoChatButtonAndMenuProps = { - /** If this is the Concierge chat, we'll open the modal for requesting a setup call instead of showing popover menu */ - isConcierge?: boolean; - - /** URL to the assigned guide's appointment booking calendar */ - guideCalendarLink?: string; -}; - -export default VideoChatButtonAndMenuProps; diff --git a/src/languages/en.ts b/src/languages/en.ts index 95c8379aa4d5..54e3e3884f12 100755 --- a/src/languages/en.ts +++ b/src/languages/en.ts @@ -382,8 +382,6 @@ export default { }, videoChatButtonAndMenu: { tooltip: 'Start a call', - zoom: 'Zoom', - googleMeet: 'Google Meet', }, hello: 'Hello', phoneCountryCode: '1', diff --git a/src/languages/es.ts b/src/languages/es.ts index 3926f074f653..bc8f6df5906d 100644 --- a/src/languages/es.ts +++ b/src/languages/es.ts @@ -372,8 +372,6 @@ export default { }, videoChatButtonAndMenu: { tooltip: 'Iniciar una llamada', - zoom: 'Zoom', - googleMeet: 'Google Meet', }, hello: 'Hola', phoneCountryCode: '34', diff --git a/src/pages/home/HeaderView.js b/src/pages/home/HeaderView.js index e3185eea2731..73f54e3eeecd 100644 --- a/src/pages/home/HeaderView.js +++ b/src/pages/home/HeaderView.js @@ -4,8 +4,6 @@ import React, {memo, useMemo} from 'react'; import {View} from 'react-native'; import {withOnyx} from 'react-native-onyx'; import _ from 'underscore'; -import GoogleMeetIcon from '@assets/images/google-meet.svg'; -import ZoomIcon from '@assets/images/zoom-icon.svg'; import Button from '@components/Button'; import ConfirmModal from '@components/ConfirmModal'; import DisplayNames from '@components/DisplayNames'; @@ -104,14 +102,12 @@ function HeaderView(props) { const subtitle = ReportUtils.getChatRoomSubtitle(reportHeaderData); const parentNavigationSubtitleData = ReportUtils.getParentNavigationSubtitle(reportHeaderData); const isConcierge = ReportUtils.hasSingleParticipant(props.report) && _.contains(participants, CONST.ACCOUNT_ID.CONCIERGE); - const isAutomatedExpensifyAccount = ReportUtils.hasSingleParticipant(props.report) && ReportUtils.hasAutomatedExpensifyAccountIDs(participants); const parentReportAction = ReportActionsUtils.getParentReportAction(props.report); const isCanceledTaskReport = ReportUtils.isCanceledTaskReport(props.report, parentReportAction); const isWhisperAction = ReportActionsUtils.isWhisperAction(parentReportAction); const isUserCreatedPolicyRoom = ReportUtils.isUserCreatedPolicyRoom(props.report); const isPolicyMember = useMemo(() => !_.isEmpty(props.policy), [props.policy]); const canLeaveRoom = ReportUtils.canLeaveRoom(props.report, isPolicyMember); - const isArchivedRoom = ReportUtils.isArchivedRoom(props.report); // We hide the button when we are chatting with an automated Expensify account since it's not possible to contact // these users via alternative means. It is possible to request a call with Concierge so we leave the option for them. @@ -186,21 +182,6 @@ function HeaderView(props) { Link.openExternalLink(props.guideCalendarLink); }), }); - } else if (!isAutomatedExpensifyAccount && !isTaskReport && !isArchivedRoom) { - threeDotMenuItems.push({ - icon: ZoomIcon, - text: translate('videoChatButtonAndMenu.zoom'), - onSelected: Session.checkIfActionIsAllowed(() => { - Link.openExternalLink(CONST.NEW_ZOOM_MEETING_URL); - }), - }); - threeDotMenuItems.push({ - icon: GoogleMeetIcon, - text: translate('videoChatButtonAndMenu.googleMeet'), - onSelected: Session.checkIfActionIsAllowed(() => { - Link.openExternalLink(CONST.NEW_GOOGLE_MEET_MEETING_URL); - }), - }); } const shouldShowThreeDotsButton = !!threeDotMenuItems.length;