// Copyright 2021 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only import React, { useCallback } from 'react'; import { useSelector } from 'react-redux'; import type { GlobalModalsStateType } from '../ducks/globalModals'; import type { StateType } from '../reducer'; import { ErrorModal } from '../../components/ErrorModal'; import { GlobalModalContainer } from '../../components/GlobalModalContainer'; import { SmartAddUserToAnotherGroupModal } from './AddUserToAnotherGroupModal'; import { SmartContactModal } from './ContactModal'; import { SmartForwardMessageModal } from './ForwardMessageModal'; import { SmartProfileEditorModal } from './ProfileEditorModal'; import { SmartSafetyNumberModal } from './SafetyNumberModal'; import { SmartSendAnywayDialog } from './SendAnywayDialog'; import { SmartShortcutGuideModal } from './ShortcutGuideModal'; import { SmartStickerPreviewModal } from './StickerPreviewModal'; import { SmartStoriesSettingsModal } from './StoriesSettingsModal'; import { getConversationsStoppingSend } from '../selectors/conversations'; import { getIntl, getTheme } from '../selectors/user'; import { useGlobalModalActions } from '../ducks/globalModals'; function renderProfileEditor(): JSX.Element { return ; } function renderContactModal(): JSX.Element { return ; } function renderForwardMessageModal(): JSX.Element { return ; } function renderStoriesSettings(): JSX.Element { return ; } function renderSendAnywayDialog(): JSX.Element { return ; } function renderShortcutGuideModal(): JSX.Element { return ; } export function SmartGlobalModalContainer(): JSX.Element { const conversationsStoppingSend = useSelector(getConversationsStoppingSend); const i18n = useSelector(getIntl); const theme = useSelector(getTheme); const hasSafetyNumberChangeModal = conversationsStoppingSend.length > 0; const { addUserToAnotherGroupModalContactId, contactModalState, errorModalProps, forwardMessageProps, isProfileEditorVisible, isShortcutGuideModalVisible, isSignalConnectionsVisible, isStoriesSettingsVisible, isWhatsNewVisible, safetyNumberChangedBlockingData, safetyNumberModalContactId, stickerPackPreviewId, userNotFoundModalState, isAuthorizingArtCreator, authArtCreatorData, } = useSelector( state => state.globalModals ); const { closeErrorModal, hideWhatsNewModal, hideUserNotFoundModal, toggleSignalConnectionsModal, cancelAuthorizeArtCreator, confirmAuthorizeArtCreator, } = useGlobalModalActions(); const renderAddUserToAnotherGroup = useCallback(() => { return ( ); }, [addUserToAnotherGroupModalContactId]); const renderSafetyNumber = useCallback( () => ( ), [safetyNumberModalContactId] ); const renderStickerPreviewModal = useCallback( () => stickerPackPreviewId ? ( ) : null, [stickerPackPreviewId] ); const renderErrorModal = useCallback( ({ description, title }: { description?: string; title?: string }) => ( ), [closeErrorModal, i18n] ); return ( ); }