Introduce the new Settings tab

Co-authored-by: Jamie Kyle <jamie@signal.org>
Co-authored-by: Fedor Indutny <indutny@signal.org>
Co-authored-by: Fedor Indutny <79877362+indutny-signal@users.noreply.github.com>
This commit is contained in:
Scott Nonnenberg 2025-05-15 13:58:20 +10:00 committed by GitHub
commit fe9d042e40
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
55 changed files with 1468 additions and 2092 deletions

View file

@ -3,16 +3,19 @@
import type { ReactNode } from 'react';
import React, { useCallback } from 'react';
import { isBeta } from '../util/version';
import { DialogType } from '../types/Dialogs';
import type { LocalizerType } from '../types/Util';
import { PRODUCTION_DOWNLOAD_URL, BETA_DOWNLOAD_URL } from '../types/support';
import { I18n } from './I18n';
import { LeftPaneDialog } from './LeftPaneDialog';
import type { WidthBreakpoint } from './_util';
import { formatFileSize } from '../util/formatFileSize';
import { getLocalizedUrl } from '../util/getLocalizedUrl';
import type { LocalizerType } from '../types/Util';
import type { DismissOptions } from './LeftPaneDialog';
import type { WidthBreakpoint } from './_util';
function contactSupportLink(parts: ReactNode): JSX.Element {
const localizedSupportLink = getLocalizedUrl(
'https://support.signal.org/hc/LOCALE/requests/new?desktop'
@ -32,6 +35,7 @@ function contactSupportLink(parts: ReactNode): JSX.Element {
export type PropsType = {
containerWidthBreakpoint: WidthBreakpoint;
dialogType: DialogType;
disableDismiss?: boolean;
dismissDialog: () => void;
downloadSize?: number;
downloadedSize?: number;
@ -45,6 +49,7 @@ export type PropsType = {
export function DialogUpdate({
containerWidthBreakpoint,
dialogType,
disableDismiss,
dismissDialog,
downloadSize,
downloadedSize,
@ -215,6 +220,19 @@ export function DialogUpdate({
title = i18n('icu:DialogUpdate__downloaded');
}
let dismissOptions: DismissOptions = {
hasXButton: true,
onClose: snoozeUpdate,
closeLabel: i18n('icu:autoUpdateIgnoreButtonLabel'),
};
if (disableDismiss) {
dismissOptions = {
hasXButton: false,
onClose: undefined,
closeLabel: undefined,
};
}
return (
<LeftPaneDialog
containerWidthBreakpoint={containerWidthBreakpoint}
@ -225,9 +243,7 @@ export function DialogUpdate({
hasAction
onClick={startUpdate}
clickLabel={clickLabel}
hasXButton
onClose={snoozeUpdate}
closeLabel={i18n('icu:autoUpdateIgnoreButtonLabel')}
{...dismissOptions}
/>
);
}