From 30b1b87feac882bc93e2403715a7a84f5abe176c Mon Sep 17 00:00:00 2001 From: Gregory Schier Date: Tue, 21 Feb 2023 17:56:48 -0800 Subject: [PATCH] Some minor tweaks --- package.json | 3 ++- src-tauri/src/main.rs | 10 ++++------ src-web/App.tsx | 3 ++- src-web/components/Button.tsx | 2 +- src-web/components/Dropdown.tsx | 3 +++ src-web/components/WindowDragRegion.tsx | 2 +- 6 files changed, 13 insertions(+), 10 deletions(-) diff --git a/package.json b/package.json index dc803f80..bf7576da 100644 --- a/package.json +++ b/package.json @@ -8,7 +8,8 @@ "dev": "vite", "lint": "eslint . --ext .ts,.tsx", "preview": "vite preview", - "tauri-dev": "concurrently -n app,rsw \"tauri dev\" \"rsw watch\"" + "tauri-dev": "concurrently -n app,rsw \"tauri dev\" \"rsw watch\"", + "tauri-build": "tauri build" }, "dependencies": { "@codemirror/lang-html": "^6.4.2", diff --git a/src-tauri/src/main.rs b/src-tauri/src/main.rs index a1e76ccd..0230f272 100644 --- a/src-tauri/src/main.rs +++ b/src-tauri/src/main.rs @@ -7,16 +7,14 @@ #[macro_use] extern crate objc; +use tauri::{CustomMenuItem, Manager, SystemTray, SystemTrayEvent, SystemTrayMenu, WindowEvent}; + +use window_ext::WindowExt; + mod commands; mod runtime; mod window_ext; -use tauri::{ - CustomMenuItem, Manager, SystemTray, SystemTrayEvent, SystemTrayMenu, SystemTrayMenuItem, - WindowEvent, -}; -use window_ext::WindowExt; - fn main() { // here `"quit".to_string()` defines the menu item id, and the second parameter is the menu item label. let quit = CustomMenuItem::new("quit".to_string(), "Quit"); diff --git a/src-web/App.tsx b/src-web/App.tsx index ebc2b1eb..4d8613a1 100644 --- a/src-web/App.tsx +++ b/src-web/App.tsx @@ -66,7 +66,7 @@ function App() { -
Hello, Friend!
+
Send Request
@@ -74,6 +74,7 @@ function App() { & { diff --git a/src-web/components/Dropdown.tsx b/src-web/components/Dropdown.tsx index 5067140a..0b6c4d87 100644 --- a/src-web/components/Dropdown.tsx +++ b/src-web/components/Dropdown.tsx @@ -16,6 +16,7 @@ interface DropdownMenuRadioProps { children: ReactNode; onValueChange: ((value: string) => void) | null; value: string; + label?: string; items: { label: string; value: string; @@ -26,6 +27,7 @@ export function DropdownMenuRadio({ children, items, onValueChange, + label, value, }: DropdownMenuRadioProps) { return ( @@ -33,6 +35,7 @@ export function DropdownMenuRadio({ {children} + {label && {label}} {items.map((item) => ( diff --git a/src-web/components/WindowDragRegion.tsx b/src-web/components/WindowDragRegion.tsx index 6db3426f..3f079eb6 100644 --- a/src-web/components/WindowDragRegion.tsx +++ b/src-web/components/WindowDragRegion.tsx @@ -6,7 +6,7 @@ type Props = HTMLAttributes; export function WindowDragRegion({ className, ...props }: Props) { return (