[feat] hide notice on successful start + tool button bg on dark mode
This commit is contained in:
0
src-tauri/src/steam/user.rs
Normal file
0
src-tauri/src/steam/user.rs
Normal file
@@ -30,21 +30,21 @@ export default function PreferenceLayout({
|
|||||||
<CardIcon
|
<CardIcon
|
||||||
type="menu"
|
type="menu"
|
||||||
onClick={() => router.push("/preference/general")}
|
onClick={() => router.push("/preference/general")}
|
||||||
className={cn(pathname === "/preference/general" && "bg-black/5")}
|
className={cn(pathname === "/preference/general" && "bg-black/5 dark:bg-white/5")}
|
||||||
>
|
>
|
||||||
<SettingConfig /> 通用
|
<SettingConfig /> 通用
|
||||||
</CardIcon>
|
</CardIcon>
|
||||||
<CardIcon
|
<CardIcon
|
||||||
type="menu"
|
type="menu"
|
||||||
onClick={() => router.push("/preference/path")}
|
onClick={() => router.push("/preference/path")}
|
||||||
className={cn(pathname === "/preference/path" && "bg-black/5")}
|
className={cn(pathname === "/preference/path" && "bg-black/5 dark:bg-white/5")}
|
||||||
>
|
>
|
||||||
<AssemblyLine /> 路径
|
<AssemblyLine /> 路径
|
||||||
</CardIcon>
|
</CardIcon>
|
||||||
<CardIcon
|
<CardIcon
|
||||||
type="menu"
|
type="menu"
|
||||||
onClick={() => router.push("/preference/replay")}
|
onClick={() => router.push("/preference/replay")}
|
||||||
className={cn(pathname === "/preference/replay" && "bg-black/5")}
|
className={cn(pathname === "/preference/replay" && "bg-black/5 dark:bg-white/5")}
|
||||||
>
|
>
|
||||||
<Videocamera /> 录像
|
<Videocamera /> 录像
|
||||||
</CardIcon>
|
</CardIcon>
|
||||||
|
|||||||
@@ -41,7 +41,7 @@ export function Prepare() {
|
|||||||
const init = async () => {
|
const init = async () => {
|
||||||
await steam.store.start()
|
await steam.store.start()
|
||||||
await app.store.start()
|
await app.store.start()
|
||||||
if (!app.state.inited) await autoGetPaths()
|
if (!app.state.inited) await autoGetPaths(false)
|
||||||
setInited(true)
|
setInited(true)
|
||||||
}
|
}
|
||||||
void init()
|
void init()
|
||||||
@@ -86,7 +86,7 @@ export function Prepare() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const autoGetPaths = async () => {
|
const autoGetPaths = async (toast?: boolean) => {
|
||||||
try {
|
try {
|
||||||
const steam_path = await invoke<string>("get_steam_path")
|
const steam_path = await invoke<string>("get_steam_path")
|
||||||
if (steam_path) steam.setDir(steam_path)
|
if (steam_path) steam.setDir(steam_path)
|
||||||
@@ -101,7 +101,7 @@ export function Prepare() {
|
|||||||
})
|
})
|
||||||
if (cs2_path) {
|
if (cs2_path) {
|
||||||
steam.setCsDir(cs2_path)
|
steam.setCsDir(cs2_path)
|
||||||
addToast({ title: "自动获取路径成功", color: "success" })
|
if (toast) addToast({ title: "自动获取路径成功", color: "success" })
|
||||||
}
|
}
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
addToast({ title: "自动获取CS2路径失败", color: "danger" })
|
addToast({ title: "自动获取CS2路径失败", color: "danger" })
|
||||||
|
|||||||
@@ -36,7 +36,7 @@ const CardIcon = ({ children, type, className, ...rest }: CardProps) => {
|
|||||||
className={cn(
|
className={cn(
|
||||||
"flex gap-1.5 items-center font-semibold",
|
"flex gap-1.5 items-center font-semibold",
|
||||||
type === "menu" &&
|
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,
|
className,
|
||||||
)}
|
)}
|
||||||
{...rest}
|
{...rest}
|
||||||
|
|||||||
@@ -1,14 +1,13 @@
|
|||||||
import type { ReactNode } from "react"
|
import type { ReactNode } from "react"
|
||||||
|
|
||||||
interface ToolButtonProps
|
interface ToolButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElement> {
|
||||||
extends React.ButtonHTMLAttributes<HTMLButtonElement> {
|
|
||||||
children?: ReactNode
|
children?: ReactNode
|
||||||
}
|
}
|
||||||
export const ToolButton = ({ children, ...rest }: ToolButtonProps) => {
|
export const ToolButton = ({ children, ...rest }: ToolButtonProps) => {
|
||||||
return (
|
return (
|
||||||
<button
|
<button
|
||||||
type="button"
|
type="button"
|
||||||
className="flex gap-0.5 active:scale-95 items-center min-w-7 justify-center px-2 py-1.5 bg-black/5 transition hover:bg-black/10 rounded-md text-sm leading-none"
|
className="flex gap-0.5 active:scale-95 items-center min-w-7 justify-center px-2 py-1.5 bg-black/5 transition hover:bg-black/10 dark:bg-white/5 dark:hover:bg-white/10 rounded-md text-sm leading-none"
|
||||||
{...rest}
|
{...rest}
|
||||||
>
|
>
|
||||||
{children}
|
{children}
|
||||||
|
|||||||
Reference in New Issue
Block a user