[feat] optimization for getting cs2 path + add Toast for auto path

This commit is contained in:
Purp1e
2025-03-23 01:08:50 +08:00
parent ad5a1bd870
commit e7b6d81319
12 changed files with 184 additions and 81 deletions

View File

@@ -42,15 +42,18 @@ const Nav = () => {
const router = useRouter()
const pathname = usePathname()
const app = useAppStore()
return (
<nav className="absolute top-0 right-0 flex flex-row h-16 gap-0.5 p-4" data-tauri-drag-region>
<ResetModal />
{pathname !== "/" && (
<button
type="button"
className="px-2 py-0 transition duration-150 rounded hover:bg-zinc-200/80 dark:hover:bg-zinc-100/10 active:scale-95"
onClick={() => (pathname !== "/" ? router.push("/") : router.back())}
onClick={() => {
app.setInited(false)
if(pathname !== "/") router.push("/")
}}
>
<RocketOne size={16} />
</button>
@@ -64,6 +67,8 @@ const Nav = () => {
{theme === "light" ? <SunOne size={16} /> : <Moon size={16} />}
</button>
<ResetModal />
{/* { platform() === "windows" && ( */}
<>
<button
@@ -127,9 +132,7 @@ function ResetModal() {
<>
<ModalHeader className="flex flex-col gap-1"></ModalHeader>
<ModalBody>
<p>
CS工具箱的偏好设置为默认设置
</p>
<p>CS工具箱的偏好设置为默认设置</p>
</ModalBody>
<ModalFooter>
<Button color="danger" variant="light" onPress={onClose}>