From 5762ea4ff34059fe656feeea8e6090f1b3405183 Mon Sep 17 00:00:00 2001 From: Yauheni Date: Thu, 25 Apr 2024 14:45:56 +0200 Subject: [PATCH 1/8] Move Leave button into a row of the Report Details page --- src/CONST.ts | 1 - src/components/ChatDetailsQuickActionsBar.tsx | 40 +++------- src/pages/ReportDetailsPage.tsx | 78 +++++++++++++------ 3 files changed, 67 insertions(+), 52 deletions(-) diff --git a/src/CONST.ts b/src/CONST.ts index 204feb44b089..0eb725427f6f 100755 --- a/src/CONST.ts +++ b/src/CONST.ts @@ -1936,7 +1936,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')} - />