diff --git a/src/CONST.ts b/src/CONST.ts index 19720c05a93c..95cb4f94b169 100755 --- a/src/CONST.ts +++ b/src/CONST.ts @@ -2055,6 +2055,7 @@ 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 d289587ce953..f15fc31aec45 100644 --- a/src/components/ChatDetailsQuickActionsBar.tsx +++ b/src/components/ChatDetailsQuickActionsBar.tsx @@ -1,12 +1,11 @@ -import React from 'react'; +import React, {useState} 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 = { @@ -15,26 +14,45 @@ 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')} + />