From a6773bd092db654360c599ca6b0108ea0e456e8c Mon Sep 17 00:00:00 2001 From: 苏向夜 Date: Wed, 25 Feb 2026 00:16:53 +0800 Subject: feat: prepare for nightly alpha --- packages/ui-new/src/pages/index-old.tsx | 187 -------------------------------- 1 file changed, 187 deletions(-) delete mode 100644 packages/ui-new/src/pages/index-old.tsx (limited to 'packages/ui-new/src/pages/index-old.tsx') diff --git a/packages/ui-new/src/pages/index-old.tsx b/packages/ui-new/src/pages/index-old.tsx deleted file mode 100644 index a6626c9..0000000 --- a/packages/ui-new/src/pages/index-old.tsx +++ /dev/null @@ -1,187 +0,0 @@ -import { useEffect } from "react"; -import { Outlet } from "react-router"; -import { BottomBar } from "@/components/bottom-bar"; -import { DownloadMonitor } from "@/components/download-monitor"; -import { GameConsole } from "@/components/game-console"; -import { LoginModal } from "@/components/login-modal"; -import { ParticleBackground } from "@/components/particle-background"; -import { Sidebar } from "@/components/sidebar"; - -import { useAuthStore } from "@/stores/auth-store"; -import { useGameStore } from "@/stores/game-store"; -import { useInstancesStore } from "@/stores/instances-store"; -import { useLogsStore } from "@/stores/logs-store"; -import { useSettingsStore } from "@/stores/settings-store"; -import { useUIStore } from "@/stores/ui-store"; - -export function IndexPage() { - const authStore = useAuthStore(); - const settingsStore = useSettingsStore(); - const uiStore = useUIStore(); - const instancesStore = useInstancesStore(); - const gameStore = useGameStore(); - const logsStore = useLogsStore(); - useEffect(() => { - // ENFORCE DARK MODE: Always add 'dark' class and attribute - document.documentElement.classList.add("dark"); - document.documentElement.setAttribute("data-theme", "dark"); - document.documentElement.classList.remove("light"); - - // Initialize stores - // Include store functions in the dependency array to satisfy hooks lint. - // These functions are stable in our store implementation, so listing them - // here is safe and prevents lint warnings. - authStore.checkAccount(); - settingsStore.loadSettings(); - logsStore.init(); - settingsStore.detectJava(); - instancesStore.loadInstances(); - gameStore.loadVersions(); - - // Note: getVersion() would need Tauri API setup - // getVersion().then((v) => uiStore.setAppVersion(v)); - }, [ - authStore.checkAccount, - settingsStore.loadSettings, - logsStore.init, - settingsStore.detectJava, - instancesStore.loadInstances, - gameStore.loadVersions, - ]); - - // Refresh versions when active instance changes - useEffect(() => { - if (instancesStore.activeInstanceId) { - gameStore.loadVersions(); - } else { - gameStore.setVersions([]); - } - }, [ - instancesStore.activeInstanceId, - gameStore.loadVersions, - gameStore.setVersions, - ]); - - return ( -
- {/* Modern Animated Background */} -
- {settingsStore.settings.customBackgroundPath && ( - Background console.error("Failed to load main background:", e)} - /> - )} - - {/* Dimming Overlay for readability */} - {settingsStore.settings.customBackgroundPath && ( -
- )} - - {!settingsStore.settings.customBackgroundPath && ( - <> - {settingsStore.settings.theme === "dark" ? ( -
- ) : ( -
- )} - - {uiStore.currentView === "home" && } - -
- - )} - - {/* Subtle Grid Overlay */} -
-
- - {/* Content Wrapper */} -
- {/* Floating Sidebar */} - - - {/* Main Content Area - Transparent & Flat */} -
- {/* Window Drag Region */} -
- - {/* App Content */} -
- {/* Views Container */} -
- -
- - {/* Download Monitor Overlay */} -
-
- -
-
- - {/* Bottom Bar */} - {uiStore.currentView === "home" && } -
-
-
- - {/* Logout Confirmation Dialog */} - {authStore.isLogoutConfirmOpen && ( -
-
-

Logout

-

- Are you sure you want to logout{" "} - - {authStore.currentAccount?.username} - - ? -

-
- - -
-
-
- )} - - {uiStore.showConsole && ( -
-
- -
-
- )} -
- ); -} -- cgit v1.2.3-70-g09d2