Some minor tweaks

This commit is contained in:
Gregory Schier
2023-02-21 17:56:48 -08:00
parent 45b7bc2c84
commit 30b1b87fea
6 changed files with 13 additions and 10 deletions

View File

@@ -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",

View File

@@ -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");

View File

@@ -66,7 +66,7 @@ function App() {
</nav>
<VStack className="w-full">
<HStack as={WindowDragRegion} items="center" className="pl-4 pr-1">
<h5>Hello, Friend!</h5>
<h5 className="pointer-events-none text-gray-800">Send Request</h5>
<IconButton icon="gear" className="ml-auto" size="sm" />
</HStack>
<VStack className="p-4 max-w-[35rem] mx-auto" space={3}>
@@ -74,6 +74,7 @@ function App() {
<DropdownMenuRadio
onValueChange={setMethod}
value={method}
label="HTTP Method"
items={[
{ label: 'GET', value: 'get' },
{ label: 'PUT', value: 'put' },

View File

@@ -1,5 +1,5 @@
import classnames from 'classnames';
import { ButtonHTMLAttributes, forwardRef } from 'react';
import classnames from 'classnames';
import { Icon } from './Icon';
export type ButtonProps = ButtonHTMLAttributes<HTMLButtonElement> & {

View File

@@ -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({
<DropdownMenuTrigger>{children}</DropdownMenuTrigger>
<DropdownMenuPortal>
<DropdownMenuContent>
{label && <DropdownMenuLabel>{label}</DropdownMenuLabel>}
<DropdownMenuRadioGroup onValueChange={onValueChange ?? undefined} value={value}>
{items.map((item) => (
<DropdownMenuRadioItem key={item.value} value={item.value}>

View File

@@ -6,7 +6,7 @@ type Props = HTMLAttributes<HTMLDivElement>;
export function WindowDragRegion({ className, ...props }: Props) {
return (
<div
className={classnames(className, 'w-full h-11 border-b border-gray-500/10')}
className={classnames(className, 'w-full h-11 flex-shrink-0 border-b border-gray-500/10')}
data-tauri-drag-region=""
{...props}
/>