Show What's New dialog in app via Help -> Go to release notes

This commit is contained in:
Scott Nonnenberg 2021-10-22 17:41:45 -07:00 committed by GitHub
parent 3e38a4b761
commit 191bfee18c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
14 changed files with 249 additions and 142 deletions

View file

@ -1,9 +1,14 @@
// Copyright 2021 Signal Messenger, LLC
// SPDX-License-Identifier: AGPL-3.0-only
import React from 'react';
import { ContactModalStateType } from '../state/ducks/globalModals';
import { LocalizerType } from '../types/Util';
import { WhatsNewModal } from './WhatsNewModal';
type PropsType = {
i18n: LocalizerType;
// ContactModal
contactModalState?: ContactModalStateType;
renderContactModal: () => JSX.Element;
@ -13,9 +18,13 @@ type PropsType = {
// SafetyNumberModal
safetyNumberModalContactId?: string;
renderSafetyNumber: () => JSX.Element;
// WhatsNewModal
isWhatsNewVisible: boolean;
hideWhatsNewModal: () => unknown;
};
export const GlobalModalContainer = ({
i18n,
// ContactModal
contactModalState,
renderContactModal,
@ -25,6 +34,9 @@ export const GlobalModalContainer = ({
// SafetyNumberModal
safetyNumberModalContactId,
renderSafetyNumber,
// WhatsNewModal
hideWhatsNewModal,
isWhatsNewVisible,
}: PropsType): JSX.Element | null => {
if (safetyNumberModalContactId) {
return renderSafetyNumber();
@ -38,5 +50,9 @@ export const GlobalModalContainer = ({
return renderProfileEditor();
}
if (isWhatsNewVisible) {
return <WhatsNewModal hideWhatsNewModal={hideWhatsNewModal} i18n={i18n} />;
}
return null;
};