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