2023-01-18 23:31:10 +00:00
|
|
|
// Copyright 2023 Signal Messenger, LLC
|
|
|
|
// SPDX-License-Identifier: AGPL-3.0-only
|
|
|
|
|
2024-03-13 20:44:13 +00:00
|
|
|
import React, { memo } from 'react';
|
2023-01-18 23:31:10 +00:00
|
|
|
import { useSelector } from 'react-redux';
|
|
|
|
import { UnsupportedOSDialog } from '../../components/UnsupportedOSDialog';
|
|
|
|
import { getIntl } from '../selectors/user';
|
|
|
|
import { getExpirationTimestamp } from '../selectors/expiration';
|
|
|
|
import type { WidthBreakpoint } from '../../components/_util';
|
2023-04-20 21:23:19 +00:00
|
|
|
import OS from '../../util/os/osMain';
|
2023-01-18 23:31:10 +00:00
|
|
|
|
|
|
|
export type PropsType = Readonly<{
|
|
|
|
type: 'warning' | 'error';
|
|
|
|
containerWidthBreakpoint: WidthBreakpoint;
|
|
|
|
}>;
|
|
|
|
|
2024-03-13 20:44:13 +00:00
|
|
|
export const SmartUnsupportedOSDialog = memo(function SmartUnsupportedOSDialog(
|
|
|
|
ownProps: PropsType
|
|
|
|
): JSX.Element {
|
2023-01-18 23:31:10 +00:00
|
|
|
const i18n = useSelector(getIntl);
|
|
|
|
const expirationTimestamp = useSelector(getExpirationTimestamp);
|
2023-04-20 21:23:19 +00:00
|
|
|
const osName = OS.getName();
|
2023-01-18 23:31:10 +00:00
|
|
|
|
|
|
|
return (
|
|
|
|
<UnsupportedOSDialog
|
|
|
|
{...ownProps}
|
|
|
|
i18n={i18n}
|
|
|
|
expirationTimestamp={expirationTimestamp}
|
2023-04-20 21:23:19 +00:00
|
|
|
OS={osName}
|
2023-01-18 23:31:10 +00:00
|
|
|
/>
|
|
|
|
);
|
2024-03-13 20:44:13 +00:00
|
|
|
});
|