mirror of
https://github.com/mountain-loop/yaak.git
synced 2026-04-24 01:38:26 +02:00
Some minor tweaks
This commit is contained in:
@@ -8,7 +8,8 @@
|
|||||||
"dev": "vite",
|
"dev": "vite",
|
||||||
"lint": "eslint . --ext .ts,.tsx",
|
"lint": "eslint . --ext .ts,.tsx",
|
||||||
"preview": "vite preview",
|
"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": {
|
"dependencies": {
|
||||||
"@codemirror/lang-html": "^6.4.2",
|
"@codemirror/lang-html": "^6.4.2",
|
||||||
|
|||||||
@@ -7,16 +7,14 @@
|
|||||||
#[macro_use]
|
#[macro_use]
|
||||||
extern crate objc;
|
extern crate objc;
|
||||||
|
|
||||||
|
use tauri::{CustomMenuItem, Manager, SystemTray, SystemTrayEvent, SystemTrayMenu, WindowEvent};
|
||||||
|
|
||||||
|
use window_ext::WindowExt;
|
||||||
|
|
||||||
mod commands;
|
mod commands;
|
||||||
mod runtime;
|
mod runtime;
|
||||||
mod window_ext;
|
mod window_ext;
|
||||||
|
|
||||||
use tauri::{
|
|
||||||
CustomMenuItem, Manager, SystemTray, SystemTrayEvent, SystemTrayMenu, SystemTrayMenuItem,
|
|
||||||
WindowEvent,
|
|
||||||
};
|
|
||||||
use window_ext::WindowExt;
|
|
||||||
|
|
||||||
fn main() {
|
fn main() {
|
||||||
// here `"quit".to_string()` defines the menu item id, and the second parameter is the menu item label.
|
// 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");
|
let quit = CustomMenuItem::new("quit".to_string(), "Quit");
|
||||||
|
|||||||
@@ -66,7 +66,7 @@ function App() {
|
|||||||
</nav>
|
</nav>
|
||||||
<VStack className="w-full">
|
<VStack className="w-full">
|
||||||
<HStack as={WindowDragRegion} items="center" className="pl-4 pr-1">
|
<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" />
|
<IconButton icon="gear" className="ml-auto" size="sm" />
|
||||||
</HStack>
|
</HStack>
|
||||||
<VStack className="p-4 max-w-[35rem] mx-auto" space={3}>
|
<VStack className="p-4 max-w-[35rem] mx-auto" space={3}>
|
||||||
@@ -74,6 +74,7 @@ function App() {
|
|||||||
<DropdownMenuRadio
|
<DropdownMenuRadio
|
||||||
onValueChange={setMethod}
|
onValueChange={setMethod}
|
||||||
value={method}
|
value={method}
|
||||||
|
label="HTTP Method"
|
||||||
items={[
|
items={[
|
||||||
{ label: 'GET', value: 'get' },
|
{ label: 'GET', value: 'get' },
|
||||||
{ label: 'PUT', value: 'put' },
|
{ label: 'PUT', value: 'put' },
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import classnames from 'classnames';
|
|
||||||
import { ButtonHTMLAttributes, forwardRef } from 'react';
|
import { ButtonHTMLAttributes, forwardRef } from 'react';
|
||||||
|
import classnames from 'classnames';
|
||||||
import { Icon } from './Icon';
|
import { Icon } from './Icon';
|
||||||
|
|
||||||
export type ButtonProps = ButtonHTMLAttributes<HTMLButtonElement> & {
|
export type ButtonProps = ButtonHTMLAttributes<HTMLButtonElement> & {
|
||||||
|
|||||||
@@ -16,6 +16,7 @@ interface DropdownMenuRadioProps {
|
|||||||
children: ReactNode;
|
children: ReactNode;
|
||||||
onValueChange: ((value: string) => void) | null;
|
onValueChange: ((value: string) => void) | null;
|
||||||
value: string;
|
value: string;
|
||||||
|
label?: string;
|
||||||
items: {
|
items: {
|
||||||
label: string;
|
label: string;
|
||||||
value: string;
|
value: string;
|
||||||
@@ -26,6 +27,7 @@ export function DropdownMenuRadio({
|
|||||||
children,
|
children,
|
||||||
items,
|
items,
|
||||||
onValueChange,
|
onValueChange,
|
||||||
|
label,
|
||||||
value,
|
value,
|
||||||
}: DropdownMenuRadioProps) {
|
}: DropdownMenuRadioProps) {
|
||||||
return (
|
return (
|
||||||
@@ -33,6 +35,7 @@ export function DropdownMenuRadio({
|
|||||||
<DropdownMenuTrigger>{children}</DropdownMenuTrigger>
|
<DropdownMenuTrigger>{children}</DropdownMenuTrigger>
|
||||||
<DropdownMenuPortal>
|
<DropdownMenuPortal>
|
||||||
<DropdownMenuContent>
|
<DropdownMenuContent>
|
||||||
|
{label && <DropdownMenuLabel>{label}</DropdownMenuLabel>}
|
||||||
<DropdownMenuRadioGroup onValueChange={onValueChange ?? undefined} value={value}>
|
<DropdownMenuRadioGroup onValueChange={onValueChange ?? undefined} value={value}>
|
||||||
{items.map((item) => (
|
{items.map((item) => (
|
||||||
<DropdownMenuRadioItem key={item.value} value={item.value}>
|
<DropdownMenuRadioItem key={item.value} value={item.value}>
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ type Props = HTMLAttributes<HTMLDivElement>;
|
|||||||
export function WindowDragRegion({ className, ...props }: Props) {
|
export function WindowDragRegion({ className, ...props }: Props) {
|
||||||
return (
|
return (
|
||||||
<div
|
<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=""
|
data-tauri-drag-region=""
|
||||||
{...props}
|
{...props}
|
||||||
/>
|
/>
|
||||||
|
|||||||
Reference in New Issue
Block a user