always have shaderbackground in the bg

This commit is contained in:
code002lover 2025-12-09 13:55:12 +01:00
parent 7586133152
commit baa18484ca
2 changed files with 1 additions and 5 deletions

View File

@ -17,15 +17,12 @@ function App() {
localStorage.getItem("token") || "" localStorage.getItem("token") || ""
); );
const [theme, setTheme] = useState<string>("default"); const [theme, setTheme] = useState<string>("default");
const [isShaderTheme, setIsShaderTheme] = useState(false);
useEffect(() => { useEffect(() => {
if (theme !== "default") { if (theme !== "default") {
document.body.classList.add("shader-theme"); document.body.classList.add("shader-theme");
setIsShaderTheme(true);
} else { } else {
document.body.classList.remove("shader-theme"); document.body.classList.remove("shader-theme");
setIsShaderTheme(false);
} }
}, [theme]); }, [theme]);
@ -88,7 +85,7 @@ function App() {
<option value="clouds">Clouds Theme</option> <option value="clouds">Clouds Theme</option>
</select> </select>
</div> </div>
{isShaderTheme && <ShaderBackground theme= {theme} />} <ShaderBackground theme= {theme} />
<Routes> <Routes>
<Route path="/" element={<PersonList people={people} />} /> <Route path="/" element={<PersonList people={people} />} />
<Route path="/games" element={<GameList />} /> <Route path="/games" element={<GameList />} />

View File

@ -154,7 +154,6 @@ export const ShaderBackground: React.FC<ShaderBackgroundProps> = ({
shader_code = CLOUDS_SHADER_CODE; shader_code = CLOUDS_SHADER_CODE;
break; break;
default: default:
console.error("Unknown shader theme:", theme);
return; return;
} }