style: make release type selector behave the same in both creation and change modals

This commit is contained in:
zhom
2025-06-17 03:42:47 +04:00
parent 469f161293
commit 8d793a6868
2 changed files with 32 additions and 23 deletions
-1
View File
@@ -164,7 +164,6 @@ export function ChangeVersionDialog({
</div>
</div>
{/* Release Type Selection - only show if multiple release types are available */}
{!releaseTypes.stable || !releaseTypes.nightly ? (
<Alert>
<AlertDescription>
+32 -22
View File
@@ -36,6 +36,7 @@ import type {
import { invoke } from "@tauri-apps/api/core";
import { useEffect, useState } from "react";
import { toast } from "sonner";
import { Alert, AlertDescription } from "./ui/alert";
type BrowserTypeString =
| "mullvad-browser"
@@ -369,28 +370,37 @@ export function CreateProfileDialog({
</Select>
</div>
{/* Release Type Selection */}
<div className="grid gap-2">
<Label>Release Type</Label>
{isLoadingReleaseTypes ? (
<div className="text-sm text-muted-foreground">
Loading release types...
</div>
) : (
<ReleaseTypeSelector
selectedReleaseType={selectedReleaseType}
onReleaseTypeSelect={setSelectedReleaseType}
availableReleaseTypes={releaseTypes}
browser={selectedBrowser ?? ""}
isDownloading={isDownloading}
onDownload={() => {
void handleDownload();
}}
placeholder="Select release type..."
downloadedVersions={downloadedVersions}
/>
)}
</div>
{selectedBrowser &&
(!releaseTypes.stable || !releaseTypes.nightly) ? (
<Alert>
<AlertDescription>
Only {releaseTypes.stable ?? releaseTypes.nightly} releases are
available for {getBrowserDisplayName(selectedBrowser)}.
</AlertDescription>
</Alert>
) : (
<div className="grid gap-2">
<Label>Release Type</Label>
{isLoadingReleaseTypes ? (
<div className="text-sm text-muted-foreground">
Loading release types...
</div>
) : (
<ReleaseTypeSelector
selectedReleaseType={selectedReleaseType}
onReleaseTypeSelect={setSelectedReleaseType}
availableReleaseTypes={releaseTypes}
browser={selectedBrowser ?? ""}
isDownloading={isDownloading}
onDownload={() => {
void handleDownload();
}}
placeholder="Select release type..."
downloadedVersions={downloadedVersions}
/>
)}
</div>
)}
{/* Proxy Settings */}
<div className="grid gap-4 pt-4 border-t">