This commit is contained in:
Michael Freno
2025-12-16 22:42:05 -05:00
commit 8fb748f401
81 changed files with 4378 additions and 0 deletions

29
src/context/splash.tsx Normal file
View File

@@ -0,0 +1,29 @@
import { Accessor, createContext, useContext } from "solid-js";
import { createSignal } from "solid-js";
// Create context with initial value
const SplashContext = createContext<{
showSplash: Accessor<boolean>;
setShowSplash: (show: boolean) => void;
}>({
showSplash: () => true,
setShowSplash: () => {},
});
export function useSplash() {
const context = useContext(SplashContext);
if (!context) {
throw new Error("useSplash must be used within a SplashProvider");
}
return context;
}
export function SplashProvider(props: { children: any }) {
const [showSplash, setShowSplash] = createSignal(true);
return (
<SplashContext.Provider value={{ showSplash, setShowSplash }}>
{props.children}
</SplashContext.Provider>
);
}