refactor: frontend (#5068)

* refactor: setting components

* refactor: frontend

* fix: settings router
This commit is contained in:
Sline
2025-10-15 18:57:44 +08:00
committed by GitHub
parent a591ee1efc
commit 0b4403b67b
34 changed files with 1072 additions and 861 deletions

View File

@@ -0,0 +1,20 @@
import { createContext, use } from "react";
export interface ChainProxyContextType {
isChainMode: boolean;
setChainMode: (isChain: boolean) => void;
chainConfigData: string | null;
setChainConfigData: (data: string | null) => void;
}
export const ChainProxyContext = createContext<ChainProxyContextType | null>(
null,
);
export const useChainProxy = () => {
const context = use(ChainProxyContext);
if (!context) {
throw new Error("useChainProxy must be used within a ChainProxyProvider");
}
return context;
};