Design comparison
SolutionDesign
Community feedback
- @AlekseiBestuzhevPosted over 1 year ago
Hello.
- The countries of the Oceania region (not only them, but in the majority) throw a 400 error when opened.
- There is no Antarctic in the filter.
- When I open the country Antarctica, the application crashes.
Otherwise great, keep it up!👍
Marked as helpful0@F4YYPosted over 1 year agoHi @AlekseiBestuzhev,
Thanks for your keen eyes to see error in my code. I've just resolved it and updated additional code and now it looks fine - searchable, filterable and clickable.
Keep happy coding...
0 - @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
Please log in to post a comment
Log in with GitHubJoin our Discord community
Join thousands of Frontend Mentor community members taking the challenges, sharing resources, helping each other, and chatting about all things front-end!
Join our Discord