always have shaderbackground in the bg
This commit is contained in:
parent
7586133152
commit
baa18484ca
@ -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 />} />
|
||||||
|
|||||||
@ -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;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user