From f245c2fab7cc7475a988e7c3b7fa14e132692346 Mon Sep 17 00:00:00 2001 From: Yauheni Date: Wed, 8 May 2024 09:18:21 +0200 Subject: [PATCH 01/15] Move Leave button into a row of the Report Details page --- src/CONST.ts | 1 - src/components/ChatDetailsQuickActionsBar.tsx | 40 +++------ src/libs/PolicyUtils.ts | 2 +- src/libs/ReportUtils.ts | 2 +- src/pages/ReportDetailsPage.tsx | 82 ++++++++++++++----- 5 files changed, 75 insertions(+), 52 deletions(-) diff --git a/src/CONST.ts b/src/CONST.ts index efb0463457b1..ea35b7de34b9 100755 --- a/src/CONST.ts +++ b/src/CONST.ts @@ -2066,7 +2066,6 @@ const CONST = { INFO: 'info', }, REPORT_DETAILS_MENU_ITEM: { - SHARE_CODE: 'shareCode', MEMBERS: 'member', INVITE: 'invite', SETTINGS: 'settings', diff --git a/src/components/ChatDetailsQuickActionsBar.tsx b/src/components/ChatDetailsQuickActionsBar.tsx index f15fc31aec45..d289587ce953 100644 --- a/src/components/ChatDetailsQuickActionsBar.tsx +++ b/src/components/ChatDetailsQuickActionsBar.tsx @@ -1,11 +1,12 @@ -import React, {useState} from 'react'; +import React from 'react'; import {View} from 'react-native'; import useLocalize from '@hooks/useLocalize'; import useThemeStyles from '@hooks/useThemeStyles'; +import Navigation from '@libs/Navigation/Navigation'; import * as Report from '@userActions/Report'; +import ROUTES from '@src/ROUTES'; import type {Report as OnyxReportType} from '@src/types/onyx'; import Button from './Button'; -import ConfirmModal from './ConfirmModal'; import * as Expensicons from './Icon/Expensicons'; type ChatDetailsQuickActionsBarProps = { @@ -14,45 +15,26 @@ type ChatDetailsQuickActionsBarProps = { function ChatDetailsQuickActionsBar({report}: ChatDetailsQuickActionsBarProps) { const styles = useThemeStyles(); - const [isLastMemberLeavingGroupModalVisible, setIsLastMemberLeavingGroupModalVisible] = useState(false); const {translate} = useLocalize(); const isPinned = !!report.isPinned; return ( - { - setIsLastMemberLeavingGroupModalVisible(false); - Report.leaveGroupChat(report.reportID); - }} - onCancel={() => setIsLastMemberLeavingGroupModalVisible(false)} - prompt={translate('groupChat.lastMemberWarning')} - confirmText={translate('common.leave')} - cancelText={translate('common.cancel')} - />