always have shaderbackground in the bg
This commit is contained in:
parent
7586133152
commit
baa18484ca
@ -17,15 +17,12 @@ function App() {
|
||||
localStorage.getItem("token") || ""
|
||||
);
|
||||
const [theme, setTheme] = useState<string>("default");
|
||||
const [isShaderTheme, setIsShaderTheme] = useState(false);
|
||||
|
||||
useEffect(() => {
|
||||
if (theme !== "default") {
|
||||
document.body.classList.add("shader-theme");
|
||||
setIsShaderTheme(true);
|
||||
} else {
|
||||
document.body.classList.remove("shader-theme");
|
||||
setIsShaderTheme(false);
|
||||
}
|
||||
}, [theme]);
|
||||
|
||||
@ -88,7 +85,7 @@ function App() {
|
||||
<option value="clouds">Clouds Theme</option>
|
||||
</select>
|
||||
</div>
|
||||
{isShaderTheme && <ShaderBackground theme= {theme} />}
|
||||
<ShaderBackground theme= {theme} />
|
||||
<Routes>
|
||||
<Route path="/" element={<PersonList people={people} />} />
|
||||
<Route path="/games" element={<GameList />} />
|
||||
|
||||
@ -154,7 +154,6 @@ export const ShaderBackground: React.FC<ShaderBackgroundProps> = ({
|
||||
shader_code = CLOUDS_SHADER_CODE;
|
||||
break;
|
||||
default:
|
||||
console.error("Unknown shader theme:", theme);
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user