diff --git a/src-tauri/src/commands.rs b/src-tauri/src/commands.rs index 028efb25..657da338 100644 --- a/src-tauri/src/commands.rs +++ b/src-tauri/src/commands.rs @@ -1,4 +1,4 @@ -use http::header::{HeaderName, CONTENT_TYPE, USER_AGENT}; +use http::header::{HeaderName, USER_AGENT}; use http::{HeaderMap, HeaderValue, Method}; use reqwest::redirect::Policy; use tauri::{AppHandle, Wry}; diff --git a/src/App.tsx b/src/App.tsx index 99ebf0b5..2d8f30d3 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -6,7 +6,7 @@ import { Input } from './components/Input'; import { Stacks } from './components/Stacks'; import { Button } from './components/Button'; import { Grid } from './components/Grid'; -import { Dropdown, DropdownMenuRadio } from './components/Dropdown.tsx'; +import { DropdownMenuRadio } from './components/Dropdown'; interface Response { url: string; diff --git a/src/components/Button.tsx b/src/components/Button.tsx index 69a806e5..260c1a16 100644 --- a/src/components/Button.tsx +++ b/src/components/Button.tsx @@ -5,7 +5,7 @@ type Props = ButtonHTMLAttributes & { color?: 'primary' | 'secondary'; }; -export const Button = forwardRef(function Button( +export const Button = forwardRef(function Button( { className, color = 'primary', ...props }: Props, ref, ) { diff --git a/src/components/Dropdown.tsx b/src/components/Dropdown.tsx index b55c38fd..5c8ee398 100644 --- a/src/components/Dropdown.tsx +++ b/src/components/Dropdown.tsx @@ -8,11 +8,10 @@ import { HamburgerMenuIcon, } from '@radix-ui/react-icons'; import { forwardRef, HTMLAttributes, ReactNode, useState } from 'react'; -import { Button } from './Button.tsx'; +import { Button } from './Button'; import classnames from 'classnames'; -import { HotKey } from './HotKey.tsx'; +import { HotKey } from './HotKey'; -// eslint-disable-next-line @typescript-eslint/no-empty-interface interface DropdownMenuRadioProps { children: ReactNode; onValueChange: (value: string) => void; @@ -20,7 +19,7 @@ interface DropdownMenuRadioProps { items: { label: string; value: string; - }; + }[]; } export function DropdownMenuRadio({ @@ -86,7 +85,7 @@ export function Dropdown() { setBookmarksChecked(!!v)} rightSlot={⌘B} leftSlot={ @@ -98,7 +97,7 @@ export function Dropdown() { setUrlsChecked(!!v)} leftSlot={ @@ -125,34 +124,37 @@ export function Dropdown() { const dropdownMenuClasses = 'bg-background rounded-md shadow-lg p-1.5 border border-gray-100'; -const DropdownMenuPortal = forwardRef(function DropdownMenuPortal( - { children }: { children: DropdownMenuContent }, - ref, -) { +interface DropdownMenuPortalProps { + children: ReactNode; +} + +function DropdownMenuPortal({ children }: DropdownMenuPortalProps) { return ( - + ('#radix-portal')}> {children} ); -}); +} -const DropdownMenuContent = forwardRef(function DropdownMenuContent( - { className, children, ...props }: DropdownMenu.DropdownMenuContentProps, - ref, -) { - return ( - - {children} - - ); -}); +const DropdownMenuContent = forwardRef( + function DropdownMenuContent( + { className, children, ...props }: DropdownMenu.DropdownMenuContentProps, + ref, + ) { + return ( + + {children} + + ); + }, +); type DropdownMenuItemProps = DropdownMenu.DropdownMenuItemProps & ItemInnerProps; @@ -232,20 +234,22 @@ function DropdownMenuRadioItem({ rightSlot, children, ...props }: DropdownMenuRa ); } -const DropdownMenuSubContent = forwardRef(function DropdownMenuSubContent( - { className, ...props }: DropdownMenu.DropdownMenuSubContentProps, - ref, -) { - return ( - - ); -}); +const DropdownMenuSubContent = forwardRef( + function DropdownMenuSubContent( + { className, ...props }: DropdownMenu.DropdownMenuSubContentProps, + ref, + ) { + return ( + + ); + }, +); function DropdownMenuLabel({ className, children, ...props }: DropdownMenu.DropdownMenuLabelProps) { return ( @@ -283,7 +287,7 @@ interface ItemInnerProps extends HTMLAttributes { noHover?: boolean; } -const ItemInner = forwardRef(function ItemInner( +const ItemInner = forwardRef(function ItemInner( { leftSlot, rightSlot, children, className, noHover, ...props }: ItemInnerProps, ref, ) { diff --git a/src/components/Grid.tsx b/src/components/Grid.tsx index 1aef3b0a..e74b80b8 100644 --- a/src/components/Grid.tsx +++ b/src/components/Grid.tsx @@ -1,5 +1,5 @@ import classnames from 'classnames'; -import { ButtonHTMLAttributes, HTMLAttributes } from 'react'; +import {HTMLAttributes} from 'react'; const colsClasses = { none: 'grid-cols-none',