diff --git a/electron.vite.config.ts b/electron.vite.config.ts index 5c94114fc..6e8be56ed 100644 --- a/electron.vite.config.ts +++ b/electron.vite.config.ts @@ -1,7 +1,8 @@ import fs from "node:fs" import { resolve } from "node:path" -import { defineConfig, externalizeDepsPlugin } from "electron-vite" + import react from "@vitejs/plugin-react" +import { defineConfig, externalizeDepsPlugin } from "electron-vite" const pkg = JSON.parse(fs.readFileSync("package.json", "utf8")) diff --git a/eslint.config.mjs b/eslint.config.mjs index 4aaaa81a2..c1c22b643 100644 --- a/eslint.config.mjs +++ b/eslint.config.mjs @@ -26,11 +26,6 @@ export default defineConfig( // change to more like prettier "@stylistic/operator-linebreak": ["error", "after"], "@stylistic/max-statements-per-line": "off", - - // run auto fix later - "simple-import-sort/exports": "off", - "simple-import-sort/imports": "off", - "@typescript-eslint/consistent-type-imports": "off", }, }, // fix later or just always ignore diff --git a/src/main/index.ts b/src/main/index.ts index 388c996de..a9d3a9496 100644 --- a/src/main/index.ts +++ b/src/main/index.ts @@ -1,10 +1,13 @@ import "dotenv/config" -import { app, BrowserWindow, Menu } from "electron" + import path from "node:path" -import { electronApp, optimizer } from "@electron-toolkit/utils" -import { createWindow } from "./window" + import { registerIpcMain } from "@egoist/tipc/main" +import { electronApp, optimizer } from "@electron-toolkit/utils" +import { app, BrowserWindow, Menu } from "electron" + import { router } from "./tipc" +import { createWindow } from "./window" registerIpcMain(router) diff --git a/src/main/tipc.ts b/src/main/tipc.ts index c8b19a71c..c372581b4 100644 --- a/src/main/tipc.ts +++ b/src/main/tipc.ts @@ -1,5 +1,6 @@ import { tipc } from "@egoist/tipc/main" -import { Menu, MessageBoxOptions, ShareMenu, dialog } from "electron" +import type { MessageBoxOptions } from "electron" +import { dialog, Menu, ShareMenu } from "electron" const t = tipc.create() diff --git a/src/main/window.ts b/src/main/window.ts index 7bcf3ffba..e39fe3333 100644 --- a/src/main/window.ts +++ b/src/main/window.ts @@ -1,6 +1,8 @@ -import { shell, BrowserWindow } from "electron" import path from "node:path" + import { is } from "@electron-toolkit/utils" +import { BrowserWindow, shell } from "electron" + import icon from "../../resources/icon.png?asset" export function createWindow(options?: { diff --git a/src/preload/index.d.ts b/src/preload/index.d.ts index ffa872fe7..7cf58d6a2 100644 --- a/src/preload/index.d.ts +++ b/src/preload/index.d.ts @@ -1,4 +1,4 @@ -import { ElectronAPI } from "@electron-toolkit/preload" +import type { ElectronAPI } from "@electron-toolkit/preload" declare global { interface Window { diff --git a/src/preload/index.ts b/src/preload/index.ts index ace306c1c..013b57607 100644 --- a/src/preload/index.ts +++ b/src/preload/index.ts @@ -1,5 +1,5 @@ -import { contextBridge } from "electron" import { electronAPI } from "@electron-toolkit/preload" +import { contextBridge } from "electron" // Custom APIs for renderer const api = {} diff --git a/src/renderer/src/components/entry-column/article-item.tsx b/src/renderer/src/components/entry-column/article-item.tsx index f6919b76a..8e4f56dc6 100644 --- a/src/renderer/src/components/entry-column/article-item.tsx +++ b/src/renderer/src/components/entry-column/article-item.tsx @@ -1,7 +1,7 @@ -import dayjs from "@renderer/lib/dayjs" -import { EntriesResponse } from "@renderer/lib/types" -import { Image } from "@renderer/components/ui/image" import { FeedIcon } from "@renderer/components/feed-icon" +import { Image } from "@renderer/components/ui/image" +import dayjs from "@renderer/lib/dayjs" +import type { EntriesResponse } from "@renderer/lib/types" export function ArticleItem({ entry }: { entry: EntriesResponse[number] }) { return ( diff --git a/src/renderer/src/components/entry-column/index.tsx b/src/renderer/src/components/entry-column/index.tsx index 3e80e7131..83a0ae6d5 100644 --- a/src/renderer/src/components/entry-column/index.tsx +++ b/src/renderer/src/components/entry-column/index.tsx @@ -1,14 +1,14 @@ -import { useEntries } from "@renderer/lib/queries/entries" -import { m } from "framer-motion" -import { cn } from "@renderer/lib/utils" -import { ArticleItem } from "./article-item" -import { SocialMediaItem } from "./social-media-item" -import { PictureItem } from "./picture-item" -import { VideoItem } from "./video-item" -import { NotificationItem } from "./notification-item" -import { EntryItemWrapper } from "./item-wrapper" - import { useMainLayoutContext } from "@renderer/contexts/outlet/main-layout" +import { useEntries } from "@renderer/lib/queries/entries" +import { cn } from "@renderer/lib/utils" +import { m } from "framer-motion" + +import { ArticleItem } from "./article-item" +import { EntryItemWrapper } from "./item-wrapper" +import { NotificationItem } from "./notification-item" +import { PictureItem } from "./picture-item" +import { SocialMediaItem } from "./social-media-item" +import { VideoItem } from "./video-item" const gridMode = new Set([2, 3]) diff --git a/src/renderer/src/components/entry-column/item-wrapper.tsx b/src/renderer/src/components/entry-column/item-wrapper.tsx index b98d17ccc..07d54f803 100644 --- a/src/renderer/src/components/entry-column/item-wrapper.tsx +++ b/src/renderer/src/components/entry-column/item-wrapper.tsx @@ -1,7 +1,7 @@ import { useMainLayoutContext } from "@renderer/contexts/outlet/main-layout" import { useEntryActions } from "@renderer/hooks/useEntryActions" import { showNativeMenu } from "@renderer/lib/native-menu" -import { EntriesResponse } from "@renderer/lib/types" +import type { EntriesResponse } from "@renderer/lib/types" import { cn } from "@renderer/lib/utils" export function EntryItemWrapper({ diff --git a/src/renderer/src/components/entry-column/notification-item.tsx b/src/renderer/src/components/entry-column/notification-item.tsx index e08355135..88b6f3d34 100644 --- a/src/renderer/src/components/entry-column/notification-item.tsx +++ b/src/renderer/src/components/entry-column/notification-item.tsx @@ -1,6 +1,6 @@ -import dayjs from "@renderer/lib/dayjs" -import { EntriesResponse } from "@renderer/lib/types" import { FeedIcon } from "@renderer/components/feed-icon" +import dayjs from "@renderer/lib/dayjs" +import type { EntriesResponse } from "@renderer/lib/types" export function NotificationItem({ entry, diff --git a/src/renderer/src/components/entry-column/picture-item.tsx b/src/renderer/src/components/entry-column/picture-item.tsx index cf262e49e..a360bb154 100644 --- a/src/renderer/src/components/entry-column/picture-item.tsx +++ b/src/renderer/src/components/entry-column/picture-item.tsx @@ -1,7 +1,7 @@ -import dayjs from "@renderer/lib/dayjs" -import { EntriesResponse } from "@renderer/lib/types" -import { Image } from "@renderer/components/ui/image" import { FeedIcon } from "@renderer/components/feed-icon" +import { Image } from "@renderer/components/ui/image" +import dayjs from "@renderer/lib/dayjs" +import type { EntriesResponse } from "@renderer/lib/types" export function PictureItem({ entry }: { entry: EntriesResponse[number] }) { return ( diff --git a/src/renderer/src/components/entry-column/social-media-item.tsx b/src/renderer/src/components/entry-column/social-media-item.tsx index 18e38be9f..3e67ef57f 100644 --- a/src/renderer/src/components/entry-column/social-media-item.tsx +++ b/src/renderer/src/components/entry-column/social-media-item.tsx @@ -1,7 +1,7 @@ -import dayjs from "@renderer/lib/dayjs" -import { EntriesResponse } from "@renderer/lib/types" -import { Image } from "@renderer/components/ui/image" import { FeedIcon } from "@renderer/components/feed-icon" +import { Image } from "@renderer/components/ui/image" +import dayjs from "@renderer/lib/dayjs" +import type { EntriesResponse } from "@renderer/lib/types" export function SocialMediaItem({ entry }: { entry: EntriesResponse[number] }) { return ( diff --git a/src/renderer/src/components/entry-column/video-item.tsx b/src/renderer/src/components/entry-column/video-item.tsx index 49dcf8453..fa0c647ca 100644 --- a/src/renderer/src/components/entry-column/video-item.tsx +++ b/src/renderer/src/components/entry-column/video-item.tsx @@ -1,7 +1,7 @@ -import dayjs from "@renderer/lib/dayjs" -import { EntriesResponse } from "@renderer/lib/types" -import { Image } from "@renderer/components/ui/image" import { FeedIcon } from "@renderer/components/feed-icon" +import { Image } from "@renderer/components/ui/image" +import dayjs from "@renderer/lib/dayjs" +import type { EntriesResponse } from "@renderer/lib/types" export function VideoItem({ entry }: { entry: EntriesResponse[number] }) { return ( diff --git a/src/renderer/src/components/entry-content/index.tsx b/src/renderer/src/components/entry-content/index.tsx index bbf85c7cf..5d0b319ba 100644 --- a/src/renderer/src/components/entry-content/index.tsx +++ b/src/renderer/src/components/entry-content/index.tsx @@ -1,9 +1,10 @@ import { parseHtml } from "@renderer/lib/parse-html" -import { ActiveEntry } from "@renderer/lib/types" -import { useEffect, useState } from "react" -import { m } from "framer-motion" -import { EntryShare } from "./share" import { useEntry } from "@renderer/lib/queries/entries" +import type { ActiveEntry } from "@renderer/lib/types" +import { m } from "framer-motion" +import { useEffect, useState } from "react" + +import { EntryShare } from "./share" export function EntryContent({ entryId }: { entryId: ActiveEntry }) { const entry = useEntry({ diff --git a/src/renderer/src/components/entry-content/share.tsx b/src/renderer/src/components/entry-content/share.tsx index 4ea0da0ef..d6643bd23 100644 --- a/src/renderer/src/components/entry-content/share.tsx +++ b/src/renderer/src/components/entry-content/share.tsx @@ -1,3 +1,4 @@ +import { Button } from "@renderer/components/ui/button" import { Tooltip, TooltipContent, @@ -5,8 +6,7 @@ import { TooltipTrigger, } from "@renderer/components/ui/tooltip" import { useEntryActions } from "@renderer/hooks/useEntryActions" -import { EntriesResponse } from "@renderer/lib/types" -import { Button } from "@renderer/components/ui/button" +import type { EntriesResponse } from "@renderer/lib/types" export function EntryShare({ view, diff --git a/src/renderer/src/components/feed-column/category-remove-dialog.tsx b/src/renderer/src/components/feed-column/category-remove-dialog.tsx index 345a777f2..c1eea4690 100644 --- a/src/renderer/src/components/feed-column/category-remove-dialog.tsx +++ b/src/renderer/src/components/feed-column/category-remove-dialog.tsx @@ -1,5 +1,3 @@ -import { useMutation, useQueryClient } from "@tanstack/react-query" -import { apiFetch } from "@renderer/lib/queries/api-fetch" import { AlertDialogAction, AlertDialogCancel, @@ -9,6 +7,8 @@ import { AlertDialogHeader, AlertDialogTitle, } from "@renderer/components/ui/alert-dialog" +import { apiFetch } from "@renderer/lib/queries/api-fetch" +import { useMutation, useQueryClient } from "@tanstack/react-query" export function CategoryRemoveDialog({ feedIdList, diff --git a/src/renderer/src/components/feed-column/category-rename-dialog.tsx b/src/renderer/src/components/feed-column/category-rename-dialog.tsx index 15de4e1ff..716f924f0 100644 --- a/src/renderer/src/components/feed-column/category-rename-dialog.tsx +++ b/src/renderer/src/components/feed-column/category-rename-dialog.tsx @@ -1,6 +1,10 @@ -import { z } from "zod" import { zodResolver } from "@hookform/resolvers/zod" -import { useForm } from "react-hook-form" +import { Button } from "@renderer/components/ui/button" +import { + DialogContent, + DialogHeader, + DialogTitle, +} from "@renderer/components/ui/dialog" import { Form, FormControl, @@ -8,15 +12,11 @@ import { FormItem, FormMessage, } from "@renderer/components/ui/form" -import { useMutation, useQueryClient } from "@tanstack/react-query" -import { - DialogContent, - DialogHeader, - DialogTitle, -} from "@renderer/components/ui/dialog" -import { Button } from "@renderer/components/ui/button" -import { apiFetch } from "@renderer/lib/queries/api-fetch" import { Input } from "@renderer/components/ui/input" +import { apiFetch } from "@renderer/lib/queries/api-fetch" +import { useMutation, useQueryClient } from "@tanstack/react-query" +import { useForm } from "react-hook-form" +import { z } from "zod" const formSchema = z.object({ category: z.string(), diff --git a/src/renderer/src/components/feed-column/category.tsx b/src/renderer/src/components/feed-column/category.tsx index 0e4a90060..0fba91f30 100644 --- a/src/renderer/src/components/feed-column/category.tsx +++ b/src/renderer/src/components/feed-column/category.tsx @@ -8,11 +8,12 @@ import { client } from "@renderer/lib/client" import { levels } from "@renderer/lib/constants" import { showNativeMenu } from "@renderer/lib/native-menu" import { apiFetch } from "@renderer/lib/queries/api-fetch" -import { Response as SubscriptionsResponse } from "@renderer/lib/queries/subscriptions" +import type { Response as SubscriptionsResponse } from "@renderer/lib/queries/subscriptions" import { cn } from "@renderer/lib/utils" import { useMutation, useQueryClient } from "@tanstack/react-query" import { AnimatePresence, m } from "framer-motion" import { useEffect, useState } from "react" + import { CategoryRenameDialog } from "./category-rename-dialog" import { FeedItem } from "./item" diff --git a/src/renderer/src/components/feed-column/index.tsx b/src/renderer/src/components/feed-column/index.tsx index 12e0a4f49..68ff33362 100644 --- a/src/renderer/src/components/feed-column/index.tsx +++ b/src/renderer/src/components/feed-column/index.tsx @@ -14,6 +14,7 @@ import { m, useSpring } from "framer-motion" import { Lethargy } from "lethargy" import { useEffect, useRef, useState } from "react" import { Link } from "react-router-dom" + import { FeedList } from "./list" const lethargy = new Lethargy() diff --git a/src/renderer/src/components/feed-column/item.tsx b/src/renderer/src/components/feed-column/item.tsx index a789b2d3c..2d9fd3aeb 100644 --- a/src/renderer/src/components/feed-column/item.tsx +++ b/src/renderer/src/components/feed-column/item.tsx @@ -15,7 +15,7 @@ import { levels } from "@renderer/lib/constants" import dayjs from "@renderer/lib/dayjs" import { showNativeMenu } from "@renderer/lib/native-menu" import { apiFetch } from "@renderer/lib/queries/api-fetch" -import { SubscriptionResponse } from "@renderer/lib/types" +import type { SubscriptionResponse } from "@renderer/lib/types" import { cn } from "@renderer/lib/utils" import { useMutation, useQueryClient } from "@tanstack/react-query" import { useState } from "react" diff --git a/src/renderer/src/components/feed-column/list.tsx b/src/renderer/src/components/feed-column/list.tsx index 495962956..8767664ef 100644 --- a/src/renderer/src/components/feed-column/list.tsx +++ b/src/renderer/src/components/feed-column/list.tsx @@ -3,6 +3,7 @@ import { levels, views } from "@renderer/lib/constants" import { useSubscriptions } from "@renderer/lib/queries/subscriptions" import { cn } from "@renderer/lib/utils" import { useState } from "react" + import { FeedCategory } from "./category" export function FeedList({ diff --git a/src/renderer/src/components/feed-icon.tsx b/src/renderer/src/components/feed-icon.tsx index 37cb66fa6..1b1ac9d87 100644 --- a/src/renderer/src/components/feed-icon.tsx +++ b/src/renderer/src/components/feed-icon.tsx @@ -1,6 +1,6 @@ -import { FeedResponse } from "@renderer/lib/types" import { SiteIcon } from "@renderer/components/site-icon" import { Image } from "@renderer/components/ui/image" +import type { FeedResponse } from "@renderer/lib/types" import { cn } from "@renderer/lib/utils" export function FeedIcon({ diff --git a/src/renderer/src/components/feed-summary.tsx b/src/renderer/src/components/feed-summary.tsx index 888693f18..672eaa34f 100644 --- a/src/renderer/src/components/feed-summary.tsx +++ b/src/renderer/src/components/feed-summary.tsx @@ -1,5 +1,5 @@ -import { FeedResponse } from "@renderer/lib/types" import { FeedIcon } from "@renderer/components/feed-icon" +import type { FeedResponse } from "@renderer/lib/types" export function FollowSummary({ feed, diff --git a/src/renderer/src/components/follow/button.tsx b/src/renderer/src/components/follow/button.tsx index 5741f1d5a..9ecc9b007 100644 --- a/src/renderer/src/components/follow/button.tsx +++ b/src/renderer/src/components/follow/button.tsx @@ -1,9 +1,10 @@ import { Button } from "@renderer/components/ui/button" import { Dialog, DialogTrigger } from "@renderer/components/ui/dialog" -import { FollowDialog } from "./dialog" -import { FeedResponse } from "@renderer/lib/types" +import type { FeedResponse } from "@renderer/lib/types" import { useState } from "react" +import { FollowDialog } from "./dialog" + export function FollowButton({ feed }: { feed: FeedResponse }) { const [open, setOpen] = useState(false) const [isSuccessful, setIsSuccessful] = useState(false) diff --git a/src/renderer/src/components/follow/dialog.tsx b/src/renderer/src/components/follow/dialog.tsx index 4a6145074..c4a69e194 100644 --- a/src/renderer/src/components/follow/dialog.tsx +++ b/src/renderer/src/components/follow/dialog.tsx @@ -1,22 +1,20 @@ -import { z } from "zod" import { zodResolver } from "@hookform/resolvers/zod" -import { useForm } from "react-hook-form" -import { - Form, - FormControl, - FormField, - FormItem, - FormLabel, - FormMessage, - FormDescription, -} from "@renderer/components/ui/form" -import { useMutation, useQueryClient } from "@tanstack/react-query" +import { AutoComplete } from "@renderer/components/ui/autocomplete" +import { Button } from "@renderer/components/ui/button" import { DialogContent, DialogHeader, DialogTitle, } from "@renderer/components/ui/dialog" -import { Button } from "@renderer/components/ui/button" +import { + Form, + FormControl, + FormDescription, + FormField, + FormItem, + FormLabel, + FormMessage, +} from "@renderer/components/ui/form" import { Select, SelectContent, @@ -24,14 +22,17 @@ import { SelectTrigger, SelectValue, } from "@renderer/components/ui/select" -import { views } from "@renderer/lib/constants" -import { cn } from "@renderer/lib/utils" import { Switch } from "@renderer/components/ui/switch" -import { FollowSummary } from "../feed-summary" +import { views } from "@renderer/lib/constants" import { apiFetch } from "@renderer/lib/queries/api-fetch" -import { SubscriptionResponse } from "@renderer/lib/types" -import { AutoComplete } from "@renderer/components/ui/autocomplete" import { useSubscriptionCategories } from "@renderer/lib/queries/subscriptions" +import type { SubscriptionResponse } from "@renderer/lib/types" +import { cn } from "@renderer/lib/utils" +import { useMutation, useQueryClient } from "@tanstack/react-query" +import { useForm } from "react-hook-form" +import { z } from "zod" + +import { FollowSummary } from "../feed-summary" const formSchema = z.object({ view: z.string(), diff --git a/src/renderer/src/components/follow/form.tsx b/src/renderer/src/components/follow/form.tsx index 4dc55fa46..037749f1e 100644 --- a/src/renderer/src/components/follow/form.tsx +++ b/src/renderer/src/components/follow/form.tsx @@ -1,7 +1,11 @@ -import { z } from "zod" import { zodResolver } from "@hookform/resolvers/zod" -import { useForm } from "react-hook-form" import { Button } from "@renderer/components/ui/button" +import { + Card, + CardContent, + CardFooter, + CardHeader, +} from "@renderer/components/ui/card" import { Form, FormControl, @@ -10,20 +14,17 @@ import { FormLabel, FormMessage, } from "@renderer/components/ui/form" -import { Input } from "@renderer/components/ui/input" -import { useEffect } from "react" -import { useMutation } from "@tanstack/react-query" import { Image } from "@renderer/components/ui/image" -import { FeedResponse, EntriesResponse } from "@renderer/lib/types" -import { - Card, - CardContent, - CardFooter, - CardHeader, -} from "@renderer/components/ui/card" -import { FollowButton } from "./button" -import { FollowSummary } from "../feed-summary" +import { Input } from "@renderer/components/ui/input" import { apiFetch } from "@renderer/lib/queries/api-fetch" +import type { EntriesResponse, FeedResponse } from "@renderer/lib/types" +import { useMutation } from "@tanstack/react-query" +import { useEffect } from "react" +import { useForm } from "react-hook-form" +import { z } from "zod" + +import { FollowSummary } from "../feed-summary" +import { FollowButton } from "./button" const formSchema = z.object({ keyword: z.string().min(1), diff --git a/src/renderer/src/components/follow/import.tsx b/src/renderer/src/components/follow/import.tsx index 68315f9f5..966aa175a 100644 --- a/src/renderer/src/components/follow/import.tsx +++ b/src/renderer/src/components/follow/import.tsx @@ -1,7 +1,6 @@ -import { z } from "zod" import { zodResolver } from "@hookform/resolvers/zod" -import { useForm } from "react-hook-form" import { Button } from "@renderer/components/ui/button" +import { Card, CardContent, CardHeader } from "@renderer/components/ui/card" import { Form, FormControl, @@ -11,12 +10,14 @@ import { FormMessage, } from "@renderer/components/ui/form" import { Input } from "@renderer/components/ui/input" -import { useMutation, useQueryClient } from "@tanstack/react-query" -import { Card, CardContent, CardHeader } from "@renderer/components/ui/card" -import { FollowSummary } from "../feed-summary" import { apiFetch } from "@renderer/lib/queries/api-fetch" -import { cn } from "@renderer/lib/utils" import type { FeedResponse } from "@renderer/lib/types" +import { cn } from "@renderer/lib/utils" +import { useMutation, useQueryClient } from "@tanstack/react-query" +import { useForm } from "react-hook-form" +import { z } from "zod" + +import { FollowSummary } from "../feed-summary" type FeedResponseList = { id: string diff --git a/src/renderer/src/components/ui/alert-dialog.tsx b/src/renderer/src/components/ui/alert-dialog.tsx index 367405d8f..071ddbd9c 100644 --- a/src/renderer/src/components/ui/alert-dialog.tsx +++ b/src/renderer/src/components/ui/alert-dialog.tsx @@ -1,8 +1,7 @@ -import * as React from "react" import * as AlertDialogPrimitive from "@radix-ui/react-alert-dialog" - -import { cn } from "@renderer/lib/utils" import { buttonVariants } from "@renderer/components/ui/button" +import { cn } from "@renderer/lib/utils" +import * as React from "react" const AlertDialog = AlertDialogPrimitive.Root @@ -126,14 +125,14 @@ AlertDialogCancel.displayName = AlertDialogPrimitive.Cancel.displayName export { AlertDialog, - AlertDialogPortal, - AlertDialogOverlay, - AlertDialogTrigger, - AlertDialogContent, - AlertDialogHeader, - AlertDialogFooter, - AlertDialogTitle, - AlertDialogDescription, AlertDialogAction, AlertDialogCancel, + AlertDialogContent, + AlertDialogDescription, + AlertDialogFooter, + AlertDialogHeader, + AlertDialogOverlay, + AlertDialogPortal, + AlertDialogTitle, + AlertDialogTrigger, } diff --git a/src/renderer/src/components/ui/autocomplete.tsx b/src/renderer/src/components/ui/autocomplete.tsx index 0cc0b64cb..41bb96060 100644 --- a/src/renderer/src/components/ui/autocomplete.tsx +++ b/src/renderer/src/components/ui/autocomplete.tsx @@ -1,13 +1,12 @@ import { Command, CommandGroup, + CommandInput, CommandItem, CommandList, - CommandInput, } from "@renderer/components/ui/command" -import { useState, useCallback } from "react" - import { cn } from "@renderer/lib/utils" +import { useCallback, useState } from "react" import * as React from "react" export interface InputProps diff --git a/src/renderer/src/components/ui/avatar.tsx b/src/renderer/src/components/ui/avatar.tsx index 52dfcb372..c1cd1868f 100644 --- a/src/renderer/src/components/ui/avatar.tsx +++ b/src/renderer/src/components/ui/avatar.tsx @@ -1,7 +1,6 @@ -import * as React from "react" import * as AvatarPrimitive from "@radix-ui/react-avatar" - import { cn } from "@renderer/lib/utils" +import * as React from "react" const Avatar = React.forwardRef< React.ElementRef, @@ -45,4 +44,4 @@ const AvatarFallback = React.forwardRef< )) AvatarFallback.displayName = AvatarPrimitive.Fallback.displayName -export { Avatar, AvatarImage, AvatarFallback } +export { Avatar, AvatarFallback, AvatarImage } diff --git a/src/renderer/src/components/ui/button.tsx b/src/renderer/src/components/ui/button.tsx index b4a6f3a98..76e4f93fa 100644 --- a/src/renderer/src/components/ui/button.tsx +++ b/src/renderer/src/components/ui/button.tsx @@ -1,9 +1,8 @@ -import * as React from "react" import { Slot } from "@radix-ui/react-slot" -import { cva } from "class-variance-authority" -import type { VariantProps } from "class-variance-authority" - import { cn } from "@renderer/lib/utils" +import type { VariantProps } from "class-variance-authority" +import { cva } from "class-variance-authority" +import * as React from "react" const buttonVariants = cva( "inline-flex items-center justify-center whitespace-nowrap rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50", diff --git a/src/renderer/src/components/ui/card.tsx b/src/renderer/src/components/ui/card.tsx index cfa6ef453..4f46728b9 100644 --- a/src/renderer/src/components/ui/card.tsx +++ b/src/renderer/src/components/ui/card.tsx @@ -1,6 +1,5 @@ -import * as React from "react" - import { cn } from "@renderer/lib/utils" +import * as React from "react" const Card = React.forwardRef< HTMLDivElement, @@ -76,4 +75,4 @@ const CardFooter = React.forwardRef< )) CardFooter.displayName = "CardFooter" -export { Card, CardHeader, CardFooter, CardTitle, CardDescription, CardContent } +export { Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle } diff --git a/src/renderer/src/components/ui/checkbox.tsx b/src/renderer/src/components/ui/checkbox.tsx index 6a7f45c4c..4e94fd48f 100644 --- a/src/renderer/src/components/ui/checkbox.tsx +++ b/src/renderer/src/components/ui/checkbox.tsx @@ -1,8 +1,7 @@ -import * as React from "react" import * as CheckboxPrimitive from "@radix-ui/react-checkbox" -import { Check } from "lucide-react" - import { cn } from "@renderer/lib/utils" +import { Check } from "lucide-react" +import * as React from "react" const Checkbox = React.forwardRef< React.ElementRef, diff --git a/src/renderer/src/components/ui/collapsible.tsx b/src/renderer/src/components/ui/collapsible.tsx index 713a20306..b6c57a5f7 100644 --- a/src/renderer/src/components/ui/collapsible.tsx +++ b/src/renderer/src/components/ui/collapsible.tsx @@ -6,4 +6,4 @@ const { CollapsibleTrigger } = CollapsiblePrimitive const { CollapsibleContent } = CollapsiblePrimitive -export { Collapsible, CollapsibleTrigger, CollapsibleContent } +export { Collapsible, CollapsibleContent, CollapsibleTrigger } diff --git a/src/renderer/src/components/ui/command.tsx b/src/renderer/src/components/ui/command.tsx index c217d1883..b08fbbd03 100644 --- a/src/renderer/src/components/ui/command.tsx +++ b/src/renderer/src/components/ui/command.tsx @@ -1,10 +1,9 @@ -import * as React from "react" import type { DialogProps } from "@radix-ui/react-dialog" +import { Dialog, DialogContent } from "@renderer/components/ui/dialog" +import { cn } from "@renderer/lib/utils" import { Command as CommandPrimitive } from "cmdk" import { Search } from "lucide-react" - -import { cn } from "@renderer/lib/utils" -import { Dialog, DialogContent } from "@renderer/components/ui/dialog" +import * as React from "react" const Command = React.forwardRef< React.ElementRef, @@ -139,11 +138,11 @@ CommandShortcut.displayName = "CommandShortcut" export { Command, CommandDialog, - CommandInput, - CommandList, CommandEmpty, CommandGroup, + CommandInput, CommandItem, - CommandShortcut, + CommandList, CommandSeparator, + CommandShortcut, } diff --git a/src/renderer/src/components/ui/dialog.tsx b/src/renderer/src/components/ui/dialog.tsx index 7308df705..51e7834b4 100644 --- a/src/renderer/src/components/ui/dialog.tsx +++ b/src/renderer/src/components/ui/dialog.tsx @@ -1,8 +1,7 @@ -import * as React from "react" import * as DialogPrimitive from "@radix-ui/react-dialog" -import { X } from "lucide-react" - import { cn } from "@renderer/lib/utils" +import { X } from "lucide-react" +import * as React from "react" const Dialog = DialogPrimitive.Root @@ -108,13 +107,13 @@ DialogDescription.displayName = DialogPrimitive.Description.displayName export { Dialog, - DialogPortal, - DialogOverlay, DialogClose, - DialogTrigger, DialogContent, - DialogHeader, - DialogFooter, - DialogTitle, DialogDescription, + DialogFooter, + DialogHeader, + DialogOverlay, + DialogPortal, + DialogTitle, + DialogTrigger, } diff --git a/src/renderer/src/components/ui/form.tsx b/src/renderer/src/components/ui/form.tsx index f474fc954..81e87f02b 100644 --- a/src/renderer/src/components/ui/form.tsx +++ b/src/renderer/src/components/ui/form.tsx @@ -1,18 +1,19 @@ -import * as React from "react" -import * as LabelPrimitive from "@radix-ui/react-label" +import type * as LabelPrimitive from "@radix-ui/react-label" import { Slot } from "@radix-ui/react-slot" -import { - Controller, +import { Label } from "@renderer/components/ui/label" +import { cn } from "@renderer/lib/utils" +import * as React from "react" +import type { ControllerProps, FieldPath, FieldValues, +} from "react-hook-form" +import { + Controller, FormProvider, useFormContext, } from "react-hook-form" -import { cn } from "@renderer/lib/utils" -import { Label } from "@renderer/components/ui/label" - const Form = FormProvider type FormFieldContextValue< @@ -163,12 +164,12 @@ const FormMessage = React.forwardRef< FormMessage.displayName = "FormMessage" export { - useFormField, Form, - FormItem, - FormLabel, FormControl, FormDescription, - FormMessage, FormField, + FormItem, + FormLabel, + FormMessage, + useFormField, } diff --git a/src/renderer/src/components/ui/image.tsx b/src/renderer/src/components/ui/image.tsx index 9a7cacf30..9e8691f90 100644 --- a/src/renderer/src/components/ui/image.tsx +++ b/src/renderer/src/components/ui/image.tsx @@ -1,6 +1,7 @@ -import { ImgHTMLAttributes, useState } from "react" -import { cn } from "@renderer/lib/utils" import { getProxyUrl } from "@renderer/lib/img-proxy" +import { cn } from "@renderer/lib/utils" +import type { ImgHTMLAttributes } from "react" +import { useState } from "react" const failedList = new Set() export const Image = ({ diff --git a/src/renderer/src/components/ui/input.tsx b/src/renderer/src/components/ui/input.tsx index b07486c6e..2bf5e1344 100644 --- a/src/renderer/src/components/ui/input.tsx +++ b/src/renderer/src/components/ui/input.tsx @@ -1,6 +1,5 @@ -import * as React from "react" - import { cn } from "@renderer/lib/utils" +import * as React from "react" export type InputProps = React.InputHTMLAttributes diff --git a/src/renderer/src/components/ui/label.tsx b/src/renderer/src/components/ui/label.tsx index 8648b1ded..edc358e9e 100644 --- a/src/renderer/src/components/ui/label.tsx +++ b/src/renderer/src/components/ui/label.tsx @@ -1,9 +1,8 @@ -import * as React from "react" import * as LabelPrimitive from "@radix-ui/react-label" -import { cva } from "class-variance-authority" -import type { VariantProps } from "class-variance-authority" - import { cn } from "@renderer/lib/utils" +import type { VariantProps } from "class-variance-authority" +import { cva } from "class-variance-authority" +import * as React from "react" const labelVariants = cva( "text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70", diff --git a/src/renderer/src/components/ui/popover.tsx b/src/renderer/src/components/ui/popover.tsx index 115774133..1cc3fc45a 100644 --- a/src/renderer/src/components/ui/popover.tsx +++ b/src/renderer/src/components/ui/popover.tsx @@ -1,7 +1,6 @@ -import * as React from "react" import * as PopoverPrimitive from "@radix-ui/react-popover" - import { cn } from "@renderer/lib/utils" +import * as React from "react" const Popover = PopoverPrimitive.Root @@ -26,4 +25,4 @@ const PopoverContent = React.forwardRef< )) PopoverContent.displayName = PopoverPrimitive.Content.displayName -export { Popover, PopoverTrigger, PopoverContent } +export { Popover, PopoverContent, PopoverTrigger } diff --git a/src/renderer/src/components/ui/select.tsx b/src/renderer/src/components/ui/select.tsx index 3995e9a33..1a70ead69 100644 --- a/src/renderer/src/components/ui/select.tsx +++ b/src/renderer/src/components/ui/select.tsx @@ -1,8 +1,7 @@ -import * as React from "react" import * as SelectPrimitive from "@radix-ui/react-select" -import { Check, ChevronDown, ChevronUp } from "lucide-react" - import { cn } from "@renderer/lib/utils" +import { Check, ChevronDown, ChevronUp } from "lucide-react" +import * as React from "react" const Select = SelectPrimitive.Root @@ -146,13 +145,13 @@ SelectSeparator.displayName = SelectPrimitive.Separator.displayName export { Select, - SelectGroup, - SelectValue, - SelectTrigger, SelectContent, - SelectLabel, + SelectGroup, SelectItem, - SelectSeparator, - SelectScrollUpButton, + SelectLabel, SelectScrollDownButton, + SelectScrollUpButton, + SelectSeparator, + SelectTrigger, + SelectValue, } diff --git a/src/renderer/src/components/ui/switch.tsx b/src/renderer/src/components/ui/switch.tsx index 65fc766a8..88d7403d7 100644 --- a/src/renderer/src/components/ui/switch.tsx +++ b/src/renderer/src/components/ui/switch.tsx @@ -1,7 +1,6 @@ -import * as React from "react" import * as SwitchPrimitives from "@radix-ui/react-switch" - import { cn } from "@renderer/lib/utils" +import * as React from "react" const Switch = React.forwardRef< React.ElementRef, diff --git a/src/renderer/src/components/ui/tabs.tsx b/src/renderer/src/components/ui/tabs.tsx index 1d5d497f8..09bc2d6df 100644 --- a/src/renderer/src/components/ui/tabs.tsx +++ b/src/renderer/src/components/ui/tabs.tsx @@ -1,7 +1,6 @@ -import * as React from "react" import * as TabsPrimitive from "@radix-ui/react-tabs" - import { cn } from "@renderer/lib/utils" +import * as React from "react" const Tabs = TabsPrimitive.Root @@ -50,4 +49,4 @@ const TabsContent = React.forwardRef< )) TabsContent.displayName = TabsPrimitive.Content.displayName -export { Tabs, TabsList, TabsTrigger, TabsContent } +export { Tabs, TabsContent, TabsList, TabsTrigger } diff --git a/src/renderer/src/components/ui/toast.tsx b/src/renderer/src/components/ui/toast.tsx index 35ac94d60..56d51c4d8 100644 --- a/src/renderer/src/components/ui/toast.tsx +++ b/src/renderer/src/components/ui/toast.tsx @@ -1,10 +1,9 @@ -import * as React from "react" import * as ToastPrimitives from "@radix-ui/react-toast" -import { cva } from "class-variance-authority" -import type { VariantProps } from "class-variance-authority" -import { X } from "lucide-react" - import { cn } from "@renderer/lib/utils" +import type { VariantProps } from "class-variance-authority" +import { cva } from "class-variance-authority" +import { X } from "lucide-react" +import * as React from "react" const ToastProvider = ToastPrimitives.Provider @@ -114,13 +113,13 @@ type ToastProps = React.ComponentPropsWithoutRef type ToastActionElement = React.ReactElement export { - type ToastProps, - type ToastActionElement, - ToastProvider, - ToastViewport, Toast, - ToastTitle, - ToastDescription, - ToastClose, ToastAction, + type ToastActionElement, + ToastClose, + ToastDescription, + type ToastProps, + ToastProvider, + ToastTitle, + ToastViewport, } diff --git a/src/renderer/src/components/ui/tooltip.tsx b/src/renderer/src/components/ui/tooltip.tsx index 3d395a306..eb50182c2 100644 --- a/src/renderer/src/components/ui/tooltip.tsx +++ b/src/renderer/src/components/ui/tooltip.tsx @@ -1,7 +1,6 @@ -import * as React from "react" import * as TooltipPrimitive from "@radix-ui/react-tooltip" - import { cn } from "@renderer/lib/utils" +import * as React from "react" const TooltipProvider = TooltipPrimitive.Provider @@ -29,8 +28,8 @@ const TooltipPortal = TooltipPrimitive.Portal export { Tooltip, - TooltipTrigger, TooltipContent, - TooltipProvider, TooltipPortal, + TooltipProvider, + TooltipTrigger, } diff --git a/src/renderer/src/components/ui/use-toast.ts b/src/renderer/src/components/ui/use-toast.ts index bdd4d4b92..c26cfa80b 100644 --- a/src/renderer/src/components/ui/use-toast.ts +++ b/src/renderer/src/components/ui/use-toast.ts @@ -1,10 +1,9 @@ // Inspired by react-hot-toast library -import * as React from "react" - import type { ToastActionElement, ToastProps, } from "@renderer/components/ui/toast" +import * as React from "react" const TOAST_LIMIT = 1 const TOAST_REMOVE_DELAY = 1_000_000 @@ -192,4 +191,4 @@ function useToast() { } } -export { useToast, toast } +export { toast, useToast } diff --git a/src/renderer/src/components/user-button.tsx b/src/renderer/src/components/user-button.tsx index cbdd9ba00..d64fa8ab3 100644 --- a/src/renderer/src/components/user-button.tsx +++ b/src/renderer/src/components/user-button.tsx @@ -1,9 +1,9 @@ +import { useSession } from "@hono/auth-js/react" import { Avatar, AvatarFallback, AvatarImage, } from "@renderer/components/ui/avatar" -import { useSession } from "@hono/auth-js/react" import { cn } from "@renderer/lib/utils" export function UserButton({ diff --git a/src/renderer/src/contexts/outlet/main-layout.tsx b/src/renderer/src/contexts/outlet/main-layout.tsx index 979504d6a..0f8e0800e 100644 --- a/src/renderer/src/contexts/outlet/main-layout.tsx +++ b/src/renderer/src/contexts/outlet/main-layout.tsx @@ -1,4 +1,4 @@ -import type { ActiveList, ActiveEntry } from "@renderer/lib/types" +import type { ActiveEntry, ActiveList } from "@renderer/lib/types" import { Outlet, useOutletContext } from "react-router-dom" export interface MainLayoutContextType { diff --git a/src/renderer/src/hooks/useEntryActions.tsx b/src/renderer/src/hooks/useEntryActions.tsx index 46e9e8519..77a165e62 100644 --- a/src/renderer/src/hooks/useEntryActions.tsx +++ b/src/renderer/src/hooks/useEntryActions.tsx @@ -1,17 +1,15 @@ import { useToast } from "@renderer/components/ui/use-toast" -import { ofetch } from "ofetch" -import type { FetchError } from "ofetch" +import { client } from "@renderer/lib/client" +import { apiFetch } from "@renderer/lib/queries/api-fetch" +import type { EntriesResponse, ListResponse } from "@renderer/lib/types" +import type { InfiniteData, QueryKey } from "@tanstack/react-query" import { - QueryKey, useMutation, useQuery, useQueryClient, - } from "@tanstack/react-query" -import type { InfiniteData } from "@tanstack/react-query" -import { client } from "@renderer/lib/client" -import { EntriesResponse, ListResponse } from "@renderer/lib/types" -import { apiFetch } from "@renderer/lib/queries/api-fetch" +import type { FetchError } from "ofetch" +import { ofetch } from "ofetch" export const useEntryActions = ({ view, diff --git a/src/renderer/src/lib/dayjs.ts b/src/renderer/src/lib/dayjs.ts index 82dd2332b..aec440fd8 100644 --- a/src/renderer/src/lib/dayjs.ts +++ b/src/renderer/src/lib/dayjs.ts @@ -1,5 +1,4 @@ import dayjs from "dayjs" - import duration from "dayjs/plugin/duration" import relativeTime from "dayjs/plugin/relativeTime" diff --git a/src/renderer/src/lib/parse-html.ts b/src/renderer/src/lib/parse-html.ts index 69978f719..28f56764b 100644 --- a/src/renderer/src/lib/parse-html.ts +++ b/src/renderer/src/lib/parse-html.ts @@ -1,12 +1,12 @@ -import { unified } from "unified" -import rehypeParse from "rehype-parse" -import rehypeSanitize from "rehype-sanitize" -import rehypeInferDescriptionMeta from "rehype-infer-description-meta" -import rehypeStringify from "rehype-stringify" -import { VFile } from "vfile" -import { visit } from "unist-util-visit" import { toJsxRuntime } from "hast-util-to-jsx-runtime" import { Fragment, jsx, jsxs } from "react/jsx-runtime" +import rehypeInferDescriptionMeta from "rehype-infer-description-meta" +import rehypeParse from "rehype-parse" +import rehypeSanitize from "rehype-sanitize" +import rehypeStringify from "rehype-stringify" +import { unified } from "unified" +import { visit } from "unist-util-visit" +import { VFile } from "vfile" export const parseHtml = async (content: string) => { const file = new VFile(content) diff --git a/src/renderer/src/lib/queries/api-fetch.ts b/src/renderer/src/lib/queries/api-fetch.ts index 9386b04e1..58213d6a8 100644 --- a/src/renderer/src/lib/queries/api-fetch.ts +++ b/src/renderer/src/lib/queries/api-fetch.ts @@ -1,5 +1,5 @@ -import { ofetch } from "ofetch" import { getCsrfToken } from "@hono/auth-js/react" +import { ofetch } from "ofetch" export const apiFetch = ofetch.create({ baseURL: import.meta.env.VITE_API_URL, diff --git a/src/renderer/src/lib/queries/entries.ts b/src/renderer/src/lib/queries/entries.ts index 900616e79..93489350b 100644 --- a/src/renderer/src/lib/queries/entries.ts +++ b/src/renderer/src/lib/queries/entries.ts @@ -1,7 +1,8 @@ -import { useInfiniteQuery, useQuery } from "@tanstack/react-query" import { levels } from "@renderer/lib/constants" -import { EntriesResponse, ListResponse, DataResponse } from "../types" import { apiFetch } from "@renderer/lib/queries/api-fetch" +import { useInfiniteQuery, useQuery } from "@tanstack/react-query" + +import type { DataResponse, EntriesResponse, ListResponse } from "../types" export const useEntries = ({ level, diff --git a/src/renderer/src/lib/queries/subscriptions.ts b/src/renderer/src/lib/queries/subscriptions.ts index 8d52d91eb..d907a8a82 100644 --- a/src/renderer/src/lib/queries/subscriptions.ts +++ b/src/renderer/src/lib/queries/subscriptions.ts @@ -1,8 +1,9 @@ -import { useQuery } from "@tanstack/react-query" -import { SubscriptionResponse } from "../types" import { apiFetch } from "@renderer/lib/queries/api-fetch" +import { useQuery } from "@tanstack/react-query" import { parse } from "tldts" +import type { SubscriptionResponse } from "../types" + export type Response = { list: { list: SubscriptionResponse diff --git a/src/renderer/src/lib/query-client.ts b/src/renderer/src/lib/query-client.ts index 7ac76df82..9e440dfd8 100644 --- a/src/renderer/src/lib/query-client.ts +++ b/src/renderer/src/lib/query-client.ts @@ -1,6 +1,6 @@ +import { createSyncStoragePersister } from "@tanstack/query-sync-storage-persister" import { QueryClient } from "@tanstack/react-query" import { persistQueryClient } from "@tanstack/react-query-persist-client" -import { createSyncStoragePersister } from "@tanstack/query-sync-storage-persister" const queryClient = new QueryClient({ defaultOptions: { diff --git a/src/renderer/src/lib/utils.ts b/src/renderer/src/lib/utils.ts index 705a193b7..da0b278df 100644 --- a/src/renderer/src/lib/utils.ts +++ b/src/renderer/src/lib/utils.ts @@ -1,5 +1,5 @@ -import { clsx } from "clsx" import type { ClassValue } from "clsx" +import { clsx } from "clsx" import { twMerge } from "tailwind-merge" export function cn(...inputs: ClassValue[]) { diff --git a/src/renderer/src/main.tsx b/src/renderer/src/main.tsx index b36a61bfe..5ae242c7e 100644 --- a/src/renderer/src/main.tsx +++ b/src/renderer/src/main.tsx @@ -1,14 +1,15 @@ import "./assets/main.css" -import * as React from "react" -import ReactDOM from "react-dom/client" -import App from "./App" -import { RouterProvider, createBrowserRouter } from "react-router-dom" -import { LazyMotion, MotionConfig } from "framer-motion" -import { QueryClientProvider } from "@tanstack/react-query" import { authConfigManager, SessionProvider } from "@hono/auth-js/react" import { Toaster } from "@renderer/components/ui/toaster" import { queryClient } from "@renderer/lib/query-client" +import { QueryClientProvider } from "@tanstack/react-query" +import { LazyMotion, MotionConfig } from "framer-motion" +import * as React from "react" +import ReactDOM from "react-dom/client" +import { createBrowserRouter, RouterProvider } from "react-router-dom" + +import App from "./App" const router = createBrowserRouter([ { diff --git a/src/renderer/src/pages/(main)/(context)/follow/index.tsx b/src/renderer/src/pages/(main)/(context)/follow/index.tsx index b303a9cea..413a8241f 100644 --- a/src/renderer/src/pages/(main)/(context)/follow/index.tsx +++ b/src/renderer/src/pages/(main)/(context)/follow/index.tsx @@ -1,12 +1,12 @@ +import { FollowForm } from "@renderer/components/follow/form" +import { FollowImport } from "@renderer/components/follow/import" +import { Recommendations } from "@renderer/components/follow/recommendations" import { Tabs, TabsContent, TabsList, TabsTrigger, } from "@renderer/components/ui/tabs" -import { Recommendations } from "@renderer/components/follow/recommendations" -import { FollowForm } from "@renderer/components/follow/form" -import { FollowImport } from "@renderer/components/follow/import" export function Component() { const tabs = [ diff --git a/src/renderer/src/pages/(main)/layout.tsx b/src/renderer/src/pages/(main)/layout.tsx index 125e5e1cb..a1e0c7b7b 100644 --- a/src/renderer/src/pages/(main)/layout.tsx +++ b/src/renderer/src/pages/(main)/layout.tsx @@ -1,8 +1,8 @@ -import { useEffect, useState } from "react" -import { ActiveList, ActiveEntry } from "@renderer/lib/types" -import { useNavigate } from "react-router-dom" import { useSession } from "@hono/auth-js/react" import { MainLayoutOutlet } from "@renderer/contexts/outlet/main-layout" +import type { ActiveEntry, ActiveList } from "@renderer/lib/types" +import { useEffect, useState } from "react" +import { useNavigate } from "react-router-dom" export function Component() { const { status } = useSession() diff --git a/src/renderer/src/pages/login.tsx b/src/renderer/src/pages/login.tsx index 32040aff3..0b04b82a8 100644 --- a/src/renderer/src/pages/login.tsx +++ b/src/renderer/src/pages/login.tsx @@ -1,5 +1,5 @@ -import { Button } from "@renderer/components/ui/button" import { signIn, useSession } from "@hono/auth-js/react" +import { Button } from "@renderer/components/ui/button" import { useEffect, useState } from "react" import { useNavigate } from "react-router-dom" diff --git a/src/renderer/src/pages/redirect.tsx b/src/renderer/src/pages/redirect.tsx index ede9bb2d3..07545c85d 100644 --- a/src/renderer/src/pages/redirect.tsx +++ b/src/renderer/src/pages/redirect.tsx @@ -1,8 +1,8 @@ import { Button } from "@renderer/components/ui/button" import { UserButton } from "@renderer/components/user-button" +import { apiFetch } from "@renderer/lib/queries/api-fetch" import { useEffect } from "react" import { useNavigate } from "react-router-dom" -import { apiFetch } from "@renderer/lib/queries/api-fetch" export function Component() { const navigate = useNavigate() diff --git a/src/renderer/src/pages/settings/profile.tsx b/src/renderer/src/pages/settings/profile.tsx index 6bd4095cf..8e0e76521 100644 --- a/src/renderer/src/pages/settings/profile.tsx +++ b/src/renderer/src/pages/settings/profile.tsx @@ -1,6 +1,5 @@ +import { useSession } from "@hono/auth-js/react" import { zodResolver } from "@hookform/resolvers/zod" -import { useForm } from "react-hook-form" -import { z } from "zod" import { Button } from "@renderer/components/ui/button" import { Form, @@ -12,10 +11,11 @@ import { FormMessage, } from "@renderer/components/ui/form" import { Input } from "@renderer/components/ui/input" -import { useSession } from "@hono/auth-js/react" -import { useMutation } from "@tanstack/react-query" -import { apiFetch } from "@renderer/lib/queries/api-fetch" import { useToast } from "@renderer/components/ui/use-toast" +import { apiFetch } from "@renderer/lib/queries/api-fetch" +import { useMutation } from "@tanstack/react-query" +import { useForm } from "react-hook-form" +import { z } from "zod" const formSchema = z.object({ handle: z.string().max(50),