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 { 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 = {
i18n: LocalizerType;
theme: ThemeType;
// AddUserToAnotherGroupModal
addUserToAnotherGroupModalContactId?: string;
addUserToAnotherGroupModalContactId: string | undefined;
renderAddUserToAnotherGroup: () => JSX.Element;
// ContactModal
contactModalState?: ContactModalStateType;
contactModalState: ContactModalStateType | undefined;
renderContactModal: () => JSX.Element;
// ErrorModal
errorModalProps?: { description?: string; title?: string };
errorModalProps: { description?: string; title?: string } | undefined;
renderErrorModal: (opts: {
description?: string;
title?: string;
}) => JSX.Element;
// ForwardMessageModal
forwardMessageProps?: ForwardMessagePropsType;
forwardMessageProps: ForwardMessagePropsType | undefined;
renderForwardMessageModal: () => JSX.Element;
// ProfileEditor
isProfileEditorVisible: boolean;
renderProfileEditor: () => JSX.Element;
// SafetyNumberModal
safetyNumberModalContactId?: string;
safetyNumberModalContactId: string | undefined;
renderSafetyNumber: () => JSX.Element;
// ShortcutGuideModal
isShortcutGuideModalVisible: boolean;
@ -47,18 +49,20 @@ export type PropsType = {
isSignalConnectionsVisible: boolean;
toggleSignalConnectionsModal: () => unknown;
// StickerPackPreviewModal
stickerPackPreviewId?: string;
stickerPackPreviewId: string | undefined;
renderStickerPreviewModal: () => JSX.Element | null;
// StoriesSettings
isStoriesSettingsVisible: boolean;
renderStoriesSettings: () => JSX.Element;
// SendAnywayDialog
hasSafetyNumberChangeModal: boolean;
safetyNumberChangedBlockingData?: SafetyNumberChangedBlockingDataType;
safetyNumberChangedBlockingData:
| SafetyNumberChangedBlockingDataType
| undefined;
renderSendAnywayDialog: () => JSX.Element;
// UserNotFoundModal
hideUserNotFoundModal: () => unknown;
userNotFoundModalState?: UserNotFoundModalStateType;
userNotFoundModalState: UserNotFoundModalStateType | undefined;
// WhatsNewModal
isWhatsNewVisible: boolean;
hideWhatsNewModal: () => unknown;

View file

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