From a435e1dda8f80277fc5a1152448a9ceaef9a0838 Mon Sep 17 00:00:00 2001 From: Richie McIlroy <33632126+richiemcilroy@users.noreply.github.com> Date: Wed, 15 Jan 2025 14:49:07 +0000 Subject: [PATCH] feat: use KSelect for export --- apps/desktop/src/routes/editor/Header.tsx | 119 +++++++++++++++++----- 1 file changed, 93 insertions(+), 26 deletions(-) diff --git a/apps/desktop/src/routes/editor/Header.tsx b/apps/desktop/src/routes/editor/Header.tsx index 8b6cf788..3a16cc59 100644 --- a/apps/desktop/src/routes/editor/Header.tsx +++ b/apps/desktop/src/routes/editor/Header.tsx @@ -13,6 +13,7 @@ import { } from "solid-js"; import { type as ostype } from "@tauri-apps/plugin-os"; import { Tooltip } from "@kobalte/core"; +import { Select as KSelect } from "@kobalte/core/select"; import { createMutation } from "@tanstack/solid-query"; import { getRequestEvent } from "solid-js/web"; import { save } from "@tauri-apps/plugin-dialog"; @@ -26,7 +27,14 @@ import { checkIsUpgradedAndUpdate, } from "~/utils/plans"; import { FPS, useEditorContext } from "./context"; -import { Dialog, DialogContent } from "./ui"; +import { + Dialog, + DialogContent, + MenuItem, + MenuItemList, + PopperContent, + topLeftAnimateClasses, +} from "./ui"; import { DEFAULT_PROJECT_CONFIG } from "./projectConfig"; import { type ProgressState, @@ -53,7 +61,7 @@ const RESOLUTION_OPTIONS: ResolutionOption[] = [ const FPS_OPTIONS = [ { label: "30 FPS", value: 30 }, { label: "60 FPS", value: 60 }, -] as const; +] satisfies Array<{ label: string; value: number }>; export function Header() { const currentWindow = getCurrentWindow(); @@ -229,42 +237,101 @@ export function Header() { Export -
+
- + + class="flex-1 text-sm text-left truncate"> + {(state) => ( + {state.selectedOption()?.label} + )} + + + + + + + + as={KSelect.Content} + class={cx(topLeftAnimateClasses, "z-50")} + > + + class="max-h-32 overflow-y-auto" + as={KSelect.Listbox} + /> + + +
- + + class="flex-1 text-sm text-left truncate"> + {(state) => ( + {state.selectedOption()?.label} + )} + + + + + + + + as={KSelect.Content} + class={cx(topLeftAnimateClasses, "z-50")} + > + + class="max-h-32 overflow-y-auto" + as={KSelect.Listbox} + /> + + +