New state for Update Dialog

This commit is contained in:
Fedor Indutny 2023-03-15 09:57:27 -07:00 committed by GitHub
parent 5949cc11b1
commit a1ab62f878
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
8 changed files with 93 additions and 29 deletions

View file

@ -162,17 +162,6 @@ export function DialogUpdate({
return null;
}
let title = i18n('autoUpdateNewVersionTitle');
if (
downloadSize &&
(dialogType === DialogType.DownloadReady ||
dialogType === DialogType.FullDownloadReady ||
dialogType === DialogType.Downloading)
) {
title += ` (${formatFileSize(downloadSize, { round: 0 })})`;
}
const versionTitle = version
? i18n('DialogUpdate--version-available', [version])
: undefined;
@ -186,7 +175,7 @@ export function DialogUpdate({
<LeftPaneDialog
containerWidthBreakpoint={containerWidthBreakpoint}
icon="update"
title={title}
title={i18n('icu:DialogUpdate__downloading')}
hoverText={versionTitle}
>
<div className="LeftPaneDialog__progress--container">
@ -199,15 +188,25 @@ export function DialogUpdate({
);
}
let clickLabel: string;
let title = i18n('autoUpdateNewVersionTitle');
if (
downloadSize &&
(dialogType === DialogType.DownloadReady ||
dialogType === DialogType.FullDownloadReady)
) {
title += ` (${formatFileSize(downloadSize, { round: 0 })})`;
}
let clickLabel = i18n('autoUpdateNewVersionMessage');
let type: 'warning' | undefined;
if (dialogType === DialogType.DownloadReady) {
clickLabel = i18n('downloadNewVersionMessage');
} else if (dialogType === DialogType.FullDownloadReady) {
clickLabel = i18n('downloadFullNewVersionMessage');
type = 'warning';
} else {
clickLabel = i18n('autoUpdateNewVersionMessage');
} else if (dialogType === DialogType.DownloadedUpdate) {
title = i18n('icu:DialogUpdate__downloaded');
}
return (