// Copyright 2020-2021 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only import React from 'react'; import { Dialogs } from '../types/Dialogs'; import { Intl } from './Intl'; import { LocalizerType } from '../types/Util'; export type PropsType = { ackRender: () => void; dialogType: Dialogs; didSnooze: boolean; dismissDialog: () => void; hasNetworkDialog: boolean; i18n: LocalizerType; showEventsCount: number; snoozeUpdate: () => void; startUpdate: () => void; }; export const UpdateDialog = ({ ackRender, dialogType, didSnooze, dismissDialog, hasNetworkDialog, i18n, snoozeUpdate, startUpdate, }: PropsType): JSX.Element | null => { React.useEffect(() => { ackRender(); }); if (hasNetworkDialog) { return null; } if (dialogType === Dialogs.None) { return null; } if (dialogType === Dialogs.Cannot_Update) { return (

{i18n('cannotUpdate')}

https://signal.org/download/ , ]} i18n={i18n} id="cannotUpdateDetail" />
); } if (dialogType === Dialogs.MacOS_Read_Only) { return (

{i18n('cannotUpdate')}

Signal.app, folder: /Applications, }} i18n={i18n} id="readOnlyVolume" />
); } return (

{i18n('autoUpdateNewVersionTitle')}

{i18n('autoUpdateNewVersionMessage')}
{!didSnooze && ( )}
); };