Display differential download size in UI

This commit is contained in:
Fedor Indutny 2022-02-25 10:44:03 -08:00 committed by GitHub
parent 052a8e65e2
commit 29c2f77d40
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
9 changed files with 320 additions and 151 deletions

View file

@ -137,6 +137,7 @@ export const DialogUpdate = ({
if (
downloadSize &&
(dialogType === DialogType.DownloadReady ||
dialogType === DialogType.FullDownloadReady ||
dialogType === DialogType.Downloading)
) {
title += ` (${formatFileSize(downloadSize, { round: 0 })})`;
@ -169,8 +170,12 @@ export const DialogUpdate = ({
}
let clickLabel: string;
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');
}
@ -179,6 +184,7 @@ export const DialogUpdate = ({
<LeftPaneDialog
containerWidthBreakpoint={containerWidthBreakpoint}
icon="update"
type={type}
title={title}
hoverText={versionTitle}
hasAction