2021-01-14 18:07:05 +00:00
|
|
|
// Copyright 2020-2021 Signal Messenger, LLC
|
2020-10-30 20:34:04 +00:00
|
|
|
// SPDX-License-Identifier: AGPL-3.0-only
|
|
|
|
|
2020-02-12 21:30:58 +00:00
|
|
|
import React from 'react';
|
|
|
|
|
2021-10-26 19:15:33 +00:00
|
|
|
import type { LocalizerType } from '../types/Util';
|
2021-10-12 23:59:08 +00:00
|
|
|
import type { WidthBreakpoint } from './_util';
|
2020-02-12 21:30:58 +00:00
|
|
|
|
2021-09-17 22:20:49 +00:00
|
|
|
import { LeftPaneDialog } from './LeftPaneDialog';
|
2021-10-12 23:59:08 +00:00
|
|
|
import { openLinkInWebBrowser } from '../util/openLinkInWebBrowser';
|
2021-09-17 22:20:49 +00:00
|
|
|
|
2021-01-14 18:07:05 +00:00
|
|
|
type PropsType = {
|
2021-10-12 23:59:08 +00:00
|
|
|
containerWidthBreakpoint: WidthBreakpoint;
|
2020-02-12 21:30:58 +00:00
|
|
|
hasExpired: boolean;
|
|
|
|
i18n: LocalizerType;
|
2021-01-14 18:07:05 +00:00
|
|
|
};
|
2020-02-12 21:30:58 +00:00
|
|
|
|
2021-08-19 22:56:29 +00:00
|
|
|
export const DialogExpiredBuild = ({
|
2021-10-12 23:59:08 +00:00
|
|
|
containerWidthBreakpoint,
|
2020-02-12 21:30:58 +00:00
|
|
|
hasExpired,
|
|
|
|
i18n,
|
|
|
|
}: PropsType): JSX.Element | null => {
|
|
|
|
if (!hasExpired) {
|
|
|
|
return null;
|
|
|
|
}
|
|
|
|
|
|
|
|
return (
|
2021-10-12 23:59:08 +00:00
|
|
|
<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>
|
2020-02-12 21:30:58 +00:00
|
|
|
);
|
|
|
|
};
|