feat: initialize zhixing-web with React, React Router, and Tailwind CSS
- Set up the main application structure with App component and routing. - Implemented global state management for UI theme using Zustand. - Created API utilities for fetching system status. - Developed system status page with responsive design and theme toggle. - Added testing setup with Vitest and initial tests for system status page. - Configured TypeScript with appropriate settings for the application. - Integrated Tailwind CSS for styling and responsive design. - Established Vite configuration for development and testing environments.
This commit is contained in:
@@ -0,0 +1,20 @@
|
||||
import { create } from "zustand"
|
||||
import { persist } from "zustand/middleware"
|
||||
|
||||
type Theme = "dark" | "light"
|
||||
|
||||
interface UiState {
|
||||
theme: Theme
|
||||
toggleTheme: () => void
|
||||
}
|
||||
|
||||
export const useUiStore = create<UiState>()(
|
||||
persist(
|
||||
(set) => ({
|
||||
theme: "light",
|
||||
toggleTheme: () =>
|
||||
set((state) => ({ theme: state.theme === "light" ? "dark" : "light" })),
|
||||
}),
|
||||
{ name: "zhixing-ui" },
|
||||
),
|
||||
)
|
||||
Reference in New Issue
Block a user