[dep] update to eslint 9

This commit is contained in:
Purp1e
2024-11-11 10:04:00 +08:00
parent e308309fb8
commit b1d505fd6b
36 changed files with 353 additions and 218 deletions

View File

@@ -1,8 +1,15 @@
"use client"
import { ReactNode } from "react"
import {
Home,
MonitorOne,
Movie,
Setting,
Terminal,
Toolkit,
} from "@icon-park/react"
import clsx from "clsx"
import { Home, MonitorOne, Movie, Setting, Terminal, Toolkit } from "@icon-park/react"
import { useRouter, usePathname } from "next/navigation"
import { usePathname, useRouter } from "next/navigation"
import type { ReactNode } from "react"
// import { platform } from "@tauri-apps/plugin-os"
import useAppStore from "@/store/app"
@@ -24,11 +31,12 @@ const SideButton = ({
return (
<button
onClick={() => router.push(route || "/")}
type="button"
onKeyUp={() => router.push(route || "/")}
className={clsx(
className,
"p-2.5 hover:bg-black/5 rounded-lg transition relative",
path.startsWith(route) && "bg-black/5"
path.startsWith(route) && "bg-black/5",
)}
{...rest}
>
@@ -36,7 +44,7 @@ const SideButton = ({
<div
className={clsx(
path.startsWith(route) && "opacity-100",
"transition-opacity duration-300 opacity-0 h-3.5 w-0.5 absolute left-0.5 bg-purple-500 rounded-full top-1/2 -translate-y-1/2"
"transition-opacity duration-300 opacity-0 h-3.5 w-0.5 absolute left-0.5 bg-purple-500 rounded-full top-1/2 -translate-y-1/2",
)}
/>
</button>
@@ -49,10 +57,10 @@ const Avatar = () => {
return (
<div
onClick={() => router.push("/users")}
onKeyUp={() => router.push("/users")}
className={clsx(
"w-12 h-12 bg-gray-700 rounded-full shadow-2xl cursor-pointer transition active:scale-95 shadow-purple-800",
path.startsWith("/users") && "shadow-sm"
path.startsWith("/users") && "shadow-sm",
)}
>
<img src="favicon.ico" alt="avatar" draggable={false} />
@@ -66,7 +74,7 @@ const SideBar = () => {
return (
<div
className={clsx(
"absolute left-0 flex flex-col h-full select-none w-20 py-7"
"absolute left-0 flex flex-col h-full select-none w-20 py-7",
// platform() === "windows" ? "w-20" : "w-[4.25rem]"
)}
data-tauri-drag-region
@@ -99,9 +107,12 @@ const SideBar = () => {
</SideButton>
</section>
<div className="mx-auto text-sm text-center text-zinc-500" data-tauri-drag-region>
<div
className="mx-auto text-sm text-center text-zinc-500"
data-tauri-drag-region
>
<p></p>
<p onClick={() => setVersion("x.y.z")}>{version}</p>
<p onKeyUp={() => setVersion("x.y.z")}>{version}</p>
</div>
</div>
)