@facuadroverSubmitted over 1 year ago
Błażej
@blazejpakAll comments
- @blazejpakPosted over 1 year ago
Hey,
image doesn't work because u added too much dots in src. It should be ./img/image-qr-code.png instead ../img/image-qr-code.png
If u use double dots, u are going back to previous folder (like fore example desktop if u have your main folder on this place), not to deeper folder
0 - @F4YYSubmitted over 1 year ago@blazejpakPosted over 1 year ago
Hey, read about window.matchMedia("(prefers-color-scheme:dark)").matches{}
It will automatically check what the prefer scheme you have in options.
const [themeDark, setThemeDark] = React.useState(false); useEffect(() => { if (window.matchMedia("(prefers-color-scheme:dark)").matches) { setThemeDark(true) } else { setThemeDark(false) } }, []); //Add dark class to html tag useEffect(() => { if (themeDark) { document.documentElement.classList.add("dark"); } else document.documentElement.classList.remove("dark"); }, [themeDark]); //
What's more, since react 18+, you don't have to import React and use for example React.useState()
But to sum up, great work, really.
0 - @iusamahubSubmitted over 1 year ago@blazejpakPosted over 1 year ago
Hey,
nice, but I suggest to add 100vh to body(in this project it would be good). And better if u don't manipulate styles on body element.
1