Fix GlobalModalContainer missing types

This commit is contained in:
Josh Perez 2022-12-22 17:28:47 -05:00 committed by GitHub
parent 23c95fd7f6
commit ba79595563
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 26 additions and 9 deletions

View file

@ -16,29 +16,31 @@ import { ConfirmationDialog } from './ConfirmationDialog';
import { SignalConnectionsModal } from './SignalConnectionsModal'; import { SignalConnectionsModal } from './SignalConnectionsModal';
import { WhatsNewModal } from './WhatsNewModal'; import { WhatsNewModal } from './WhatsNewModal';
// NOTE: All types should be required for this component so that the smart
// component gives you type errors when adding/removing props.
export type PropsType = { export type PropsType = {
i18n: LocalizerType; i18n: LocalizerType;
theme: ThemeType; theme: ThemeType;
// AddUserToAnotherGroupModal // AddUserToAnotherGroupModal
addUserToAnotherGroupModalContactId?: string; addUserToAnotherGroupModalContactId: string | undefined;
renderAddUserToAnotherGroup: () => JSX.Element; renderAddUserToAnotherGroup: () => JSX.Element;
// ContactModal // ContactModal
contactModalState?: ContactModalStateType; contactModalState: ContactModalStateType | undefined;
renderContactModal: () => JSX.Element; renderContactModal: () => JSX.Element;
// ErrorModal // ErrorModal
errorModalProps?: { description?: string; title?: string }; errorModalProps: { description?: string; title?: string } | undefined;
renderErrorModal: (opts: { renderErrorModal: (opts: {
description?: string; description?: string;
title?: string; title?: string;
}) => JSX.Element; }) => JSX.Element;
// ForwardMessageModal // ForwardMessageModal
forwardMessageProps?: ForwardMessagePropsType; forwardMessageProps: ForwardMessagePropsType | undefined;
renderForwardMessageModal: () => JSX.Element; renderForwardMessageModal: () => JSX.Element;
// ProfileEditor // ProfileEditor
isProfileEditorVisible: boolean; isProfileEditorVisible: boolean;
renderProfileEditor: () => JSX.Element; renderProfileEditor: () => JSX.Element;
// SafetyNumberModal // SafetyNumberModal
safetyNumberModalContactId?: string; safetyNumberModalContactId: string | undefined;
renderSafetyNumber: () => JSX.Element; renderSafetyNumber: () => JSX.Element;
// ShortcutGuideModal // ShortcutGuideModal
isShortcutGuideModalVisible: boolean; isShortcutGuideModalVisible: boolean;
@ -47,18 +49,20 @@ export type PropsType = {
isSignalConnectionsVisible: boolean; isSignalConnectionsVisible: boolean;
toggleSignalConnectionsModal: () => unknown; toggleSignalConnectionsModal: () => unknown;
// StickerPackPreviewModal // StickerPackPreviewModal
stickerPackPreviewId?: string; stickerPackPreviewId: string | undefined;
renderStickerPreviewModal: () => JSX.Element | null; renderStickerPreviewModal: () => JSX.Element | null;
// StoriesSettings // StoriesSettings
isStoriesSettingsVisible: boolean; isStoriesSettingsVisible: boolean;
renderStoriesSettings: () => JSX.Element; renderStoriesSettings: () => JSX.Element;
// SendAnywayDialog // SendAnywayDialog
hasSafetyNumberChangeModal: boolean; hasSafetyNumberChangeModal: boolean;
safetyNumberChangedBlockingData?: SafetyNumberChangedBlockingDataType; safetyNumberChangedBlockingData:
| SafetyNumberChangedBlockingDataType
| undefined;
renderSendAnywayDialog: () => JSX.Element; renderSendAnywayDialog: () => JSX.Element;
// UserNotFoundModal // UserNotFoundModal
hideUserNotFoundModal: () => unknown; hideUserNotFoundModal: () => unknown;
userNotFoundModalState?: UserNotFoundModalStateType; userNotFoundModalState: UserNotFoundModalStateType | undefined;
// WhatsNewModal // WhatsNewModal
isWhatsNewVisible: boolean; isWhatsNewVisible: boolean;
hideWhatsNewModal: () => unknown; hideWhatsNewModal: () => unknown;

View file

@ -54,13 +54,18 @@ export function SmartGlobalModalContainer(): JSX.Element {
const { const {
addUserToAnotherGroupModalContactId, addUserToAnotherGroupModalContactId,
contactModalState,
errorModalProps,
forwardMessageProps,
isProfileEditorVisible, isProfileEditorVisible,
isSignalConnectionsVisible,
isShortcutGuideModalVisible, isShortcutGuideModalVisible,
isSignalConnectionsVisible,
isStoriesSettingsVisible, isStoriesSettingsVisible,
isWhatsNewVisible, isWhatsNewVisible,
safetyNumberChangedBlockingData,
safetyNumberModalContactId, safetyNumberModalContactId,
stickerPackPreviewId, stickerPackPreviewId,
userNotFoundModalState,
} = useSelector<StateType, GlobalModalsStateType>( } = useSelector<StateType, GlobalModalsStateType>(
state => state.globalModals state => state.globalModals
); );
@ -109,6 +114,10 @@ export function SmartGlobalModalContainer(): JSX.Element {
return ( return (
<GlobalModalContainer <GlobalModalContainer
addUserToAnotherGroupModalContactId={addUserToAnotherGroupModalContactId}
contactModalState={contactModalState}
errorModalProps={errorModalProps}
forwardMessageProps={forwardMessageProps}
hasSafetyNumberChangeModal={hasSafetyNumberChangeModal} hasSafetyNumberChangeModal={hasSafetyNumberChangeModal}
hideUserNotFoundModal={hideUserNotFoundModal} hideUserNotFoundModal={hideUserNotFoundModal}
hideWhatsNewModal={hideWhatsNewModal} hideWhatsNewModal={hideWhatsNewModal}
@ -128,8 +137,12 @@ export function SmartGlobalModalContainer(): JSX.Element {
renderShortcutGuideModal={renderShortcutGuideModal} renderShortcutGuideModal={renderShortcutGuideModal}
renderStickerPreviewModal={renderStickerPreviewModal} renderStickerPreviewModal={renderStickerPreviewModal}
renderStoriesSettings={renderStoriesSettings} renderStoriesSettings={renderStoriesSettings}
safetyNumberChangedBlockingData={safetyNumberChangedBlockingData}
safetyNumberModalContactId={safetyNumberModalContactId}
stickerPackPreviewId={stickerPackPreviewId}
theme={theme} theme={theme}
toggleSignalConnectionsModal={toggleSignalConnectionsModal} toggleSignalConnectionsModal={toggleSignalConnectionsModal}
userNotFoundModalState={userNotFoundModalState}
/> />
); );
} }