signal-desktop/ts/components/SafetyNumberModal.tsx

34 lines
902 B
TypeScript
Raw Normal View History

// Copyright 2021 Signal Messenger, LLC
// SPDX-License-Identifier: AGPL-3.0-only
import React from 'react';
import { Modal } from './Modal';
import type { PropsType as SafetyNumberViewerPropsType } from './SafetyNumberViewer';
import { SafetyNumberViewer } from './SafetyNumberViewer';
type PropsType = {
toggleSafetyNumberModal: () => unknown;
2022-03-02 18:24:28 +00:00
} & Omit<SafetyNumberViewerPropsType, 'onClose'>;
export const SafetyNumberModal = ({
i18n,
toggleSafetyNumberModal,
...safetyNumberViewerProps
}: PropsType): JSX.Element | null => {
return (
<Modal
hasXButton
i18n={i18n}
moduleClassName="module-SafetyNumberViewer__modal"
2022-03-02 18:24:28 +00:00
onClose={toggleSafetyNumberModal}
title={i18n('SafetyNumberModal__title')}
>
2022-03-02 18:24:28 +00:00
<SafetyNumberViewer
i18n={i18n}
onClose={toggleSafetyNumberModal}
{...safetyNumberViewerProps}
/>
</Modal>
);
};