diff --git a/src-tauri/src/steam/user.rs b/src-tauri/src/steam/user.rs new file mode 100644 index 0000000..e69de29 diff --git a/src/app/(main)/preference/layout.tsx b/src/app/(main)/preference/layout.tsx index bec5ae6..ec05683 100644 --- a/src/app/(main)/preference/layout.tsx +++ b/src/app/(main)/preference/layout.tsx @@ -30,21 +30,21 @@ export default function PreferenceLayout({ router.push("/preference/general")} - className={cn(pathname === "/preference/general" && "bg-black/5")} + className={cn(pathname === "/preference/general" && "bg-black/5 dark:bg-white/5")} > 通用 router.push("/preference/path")} - className={cn(pathname === "/preference/path" && "bg-black/5")} + className={cn(pathname === "/preference/path" && "bg-black/5 dark:bg-white/5")} > 路径 router.push("/preference/replay")} - className={cn(pathname === "/preference/replay" && "bg-black/5")} + className={cn(pathname === "/preference/replay" && "bg-black/5 dark:bg-white/5")} > 录像 diff --git a/src/components/cstb/Prepare.tsx b/src/components/cstb/Prepare.tsx index 5bfde9d..bf9f08a 100644 --- a/src/components/cstb/Prepare.tsx +++ b/src/components/cstb/Prepare.tsx @@ -41,7 +41,7 @@ export function Prepare() { const init = async () => { await steam.store.start() await app.store.start() - if (!app.state.inited) await autoGetPaths() + if (!app.state.inited) await autoGetPaths(false) setInited(true) } void init() @@ -86,7 +86,7 @@ export function Prepare() { } } - const autoGetPaths = async () => { + const autoGetPaths = async (toast?: boolean) => { try { const steam_path = await invoke("get_steam_path") if (steam_path) steam.setDir(steam_path) @@ -101,7 +101,7 @@ export function Prepare() { }) if (cs2_path) { steam.setCsDir(cs2_path) - addToast({ title: "自动获取路径成功", color: "success" }) + if (toast) addToast({ title: "自动获取路径成功", color: "success" }) } } catch (e) { addToast({ title: "自动获取CS2路径失败", color: "danger" }) diff --git a/src/components/window/Card.tsx b/src/components/window/Card.tsx index 5877f8f..da170d5 100644 --- a/src/components/window/Card.tsx +++ b/src/components/window/Card.tsx @@ -36,7 +36,7 @@ const CardIcon = ({ children, type, className, ...rest }: CardProps) => { className={cn( "flex gap-1.5 items-center font-semibold", type === "menu" && - "transition cursor-pointer hover:bg-black/5 px-2 py-1 rounded-md active:scale-95", + "transition cursor-pointer hover:bg-black/5 dark:hover:bg-white/5 px-2 py-1 rounded-md active:scale-95", className, )} {...rest} diff --git a/src/components/window/ToolButton.tsx b/src/components/window/ToolButton.tsx index 0fe90e7..235b706 100644 --- a/src/components/window/ToolButton.tsx +++ b/src/components/window/ToolButton.tsx @@ -1,14 +1,13 @@ import type { ReactNode } from "react" -interface ToolButtonProps - extends React.ButtonHTMLAttributes { +interface ToolButtonProps extends React.ButtonHTMLAttributes { children?: ReactNode } export const ToolButton = ({ children, ...rest }: ToolButtonProps) => { return (