feat: add loading state to download button and enhance UI with spinner

This commit is contained in:
Moyasee
2026-01-03 00:18:07 +02:00
parent c9729fb3eb
commit 2bc0266775
3 changed files with 26 additions and 3 deletions

View File

@@ -175,6 +175,7 @@
"repacks_modal_description": "Choose the repack you want to download",
"select_folder_hint": "To change the default folder, go to the <0>Settings</0>",
"download_now": "Download now",
"loading": "Loading...",
"no_shop_details": "Could not retrieve shop details.",
"download_options": "Download options",
"download_path": "Download path",

View File

@@ -93,4 +93,17 @@
&__change-path-button {
align-self: flex-end;
}
&__loading-spinner {
animation: spin 1s linear infinite;
}
}
@keyframes spin {
from {
transform: rotate(0deg);
}
to {
transform: rotate(360deg);
}
}

View File

@@ -7,7 +7,7 @@ import {
Modal,
TextField,
} from "@renderer/components";
import { DownloadIcon } from "@primer/octicons-react";
import { DownloadIcon, SyncIcon } from "@primer/octicons-react";
import {
Downloader,
formatBytes,
@@ -323,8 +323,17 @@ export function DownloadSettingsModal({
!hasWritePermission
}
>
<DownloadIcon />
{t("download_now")}
{downloadStarting ? (
<>
<SyncIcon className="download-settings-modal__loading-spinner" />
{t("loading")}
</>
) : (
<>
<DownloadIcon />
{t("download_now")}
</>
)}
</Button>
</div>
</Modal>