signal-desktop/ts/windows/about/app.tsx

37 lines
1 KiB
TypeScript
Raw Normal View History

2023-03-14 15:55:31 +00:00
// Copyright 2023 Signal Messenger, LLC
// SPDX-License-Identifier: AGPL-3.0-only
import React from 'react';
import ReactDOM from 'react-dom';
import { About } from '../../components/About';
import { i18n } from '../sandboxedInit';
2023-03-14 15:55:31 +00:00
import { strictAssert } from '../../util/assert';
const { AboutWindowProps } = window.Signal;
2023-03-14 15:55:31 +00:00
strictAssert(AboutWindowProps, 'window values not provided');
let platform = '';
if (AboutWindowProps.platform === 'darwin') {
if (AboutWindowProps.arch === 'arm64') {
2023-04-21 21:21:55 +00:00
platform = ` (${i18n('icu:appleSilicon')})`;
} else {
platform = ' (Intel)';
}
}
const environmentText = `${AboutWindowProps.environmentText}${platform}`;
2023-03-14 15:55:31 +00:00
ReactDOM.render(
<About
closeAbout={() => window.SignalContext.executeMenuRole('close')}
environment={environmentText}
executeMenuRole={window.SignalContext.executeMenuRole}
hasCustomTitleBar={window.SignalContext.OS.hasCustomTitleBar()}
i18n={i18n}
version={window.SignalContext.getVersion()}
2023-03-14 15:55:31 +00:00
/>,
document.getElementById('app')
);