signal-desktop/ts/components/DialogExpiredBuild.tsx

41 lines
942 B
TypeScript
Raw Normal View History

// Copyright 2020-2021 Signal Messenger, LLC
2020-10-30 20:34:04 +00:00
// SPDX-License-Identifier: AGPL-3.0-only
import React from 'react';
import type { LocalizerType } from '../types/Util';
import type { WidthBreakpoint } from './_util';
2021-09-17 22:20:49 +00:00
import { LeftPaneDialog } from './LeftPaneDialog';
import { openLinkInWebBrowser } from '../util/openLinkInWebBrowser';
2021-09-17 22:20:49 +00:00
type PropsType = {
containerWidthBreakpoint: WidthBreakpoint;
hasExpired: boolean;
i18n: LocalizerType;
};
2022-11-18 00:45:19 +00:00
export function DialogExpiredBuild({
containerWidthBreakpoint,
hasExpired,
i18n,
2022-11-18 00:45:19 +00:00
}: PropsType): JSX.Element | null {
if (!hasExpired) {
return null;
}
return (
<LeftPaneDialog
containerWidthBreakpoint={containerWidthBreakpoint}
type="error"
onClick={() => {
openLinkInWebBrowser('https://signal.org/download/');
}}
clickLabel={i18n('upgrade')}
hasAction
>
2021-09-17 22:20:49 +00:00
{i18n('expiredWarning')}{' '}
</LeftPaneDialog>
);
2022-11-18 00:45:19 +00:00
}