signal-desktop/ts/components/SafetyNumberNotReady.tsx

43 lines
1.1 KiB
TypeScript
Raw Normal View History

// Copyright 2023 Signal Messenger, LLC
// SPDX-License-Identifier: AGPL-3.0-only
import React from 'react';
import { Button, ButtonVariant } from './Button';
import { Modal } from './Modal';
2024-05-15 21:48:02 +00:00
import { I18n } from './I18n';
import { openLinkInWebBrowser } from '../util/openLinkInWebBrowser';
import type { LocalizerType } from '../types/Util';
2023-11-01 22:55:30 +00:00
import { SAFETY_NUMBER_URL } from '../types/support';
export type PropsType = {
i18n: LocalizerType;
onClose: () => void;
};
function onLearnMore() {
2023-11-01 22:55:30 +00:00
openLinkInWebBrowser(SAFETY_NUMBER_URL);
}
export function SafetyNumberNotReady({
i18n,
onClose,
}: PropsType): JSX.Element | null {
return (
<div className="module-SafetyNumberNotReady">
<div>
2024-05-15 21:48:02 +00:00
<I18n i18n={i18n} id="icu:SafetyNumberNotReady__body" />
</div>
<Modal.ButtonFooter>
<Button onClick={onLearnMore} variant={ButtonVariant.Secondary}>
2024-05-15 21:48:02 +00:00
<I18n i18n={i18n} id="icu:SafetyNumberNotReady__learn-more" />
</Button>
<Button onClick={onClose} variant={ButtonVariant.Secondary}>
2024-05-15 21:48:02 +00:00
<I18n i18n={i18n} id="icu:ok" />
</Button>
</Modal.ButtonFooter>
</div>
);
}