Vite App with styled components, Redux, and React-Dropdown component
Design comparison
Solution retrospective
How to improve accessibility with React?
Community feedback
- @pikapikamartPosted almost 3 years ago
Hey, awesome work on this one. The desktop layout looks great, but on my end, I only get a 3 country card per row. I am using a 1366x768 monitor, also you can make the country cards be justified at center so that when another country card needs to be wrapped in another row, the remaining will be centered something like instead of being left on the left-side like when you go to 106px. The mobile state looks great though.
Some other suggestions on the site would be:
- I am getting some logs so maybe checking if you have left some
console.log
on your code. - Always have a
main
element to wrap the main content of the site. For this usemain
tag on the.homepage
selector. - The theme toggle works but the markup could be improved on that one. When you are building out a theme toggle in general, it will be better to use radio-buttons since a theme toggle is a selection and radio-buttons are intended for those. The radio-buttons will be placed insidea
fieldset
along with alegend
tag that will describe what is the purpose of thoseinput
tags. You can have a look at my solution on this same challenge. Inspect the markup on how it is made and let me know if you have queries about this one. - Do not remove the
outline
styling. If you did, always include a visual-indicator on the:focus-visible
for those interactive elements like thebutton
a
tag and others. - Also, you don't use
span
inside ansvg
. Another one, thesvg
for the theme toggle is just a decorativesvg
so adding anaria-hidden="true"
attribute on it would be really great. - The search-icon on the search-bar as well is decorative so hide it using the method above.
- Your search-bar
input
right now currently lacks associatedlabel
to it or anaria-label
to which will define the purpose of theinput
element. Always include it so that user will know what they need to give on eachinput
. It could be something likearia-label="country name"
. - Also, when you are typing out the country name, since you are adding like a
:hover
and bringing up a clear-button, it would be really great to just place thebutton
directly on the markup so that user could toggle it even without using mouse. Making inclusive components should be prioritize when building it. - For the filter-bar, currently it is only limited for mouse clicks since you are not using an interactive element on it. Remember that interactive components needs to use interactive elements. For this one, you could use
select
tag, though it can't be styled. Another approach would be to userole="listbox"
, you can see that on my solution since I implemented that one. - For each of the country card, the
a
tag should not be nesting all of those components since it will be an invalid markup. You could use thea
tag to wrap theimg
and maybe just use thea
tag's::after
to occupy the full height and width of the single-country-card so that the whole can be toggled. - Those 3 information about the country card could use a
ul
tag since those are "list" of informations.
VISITING A COUNTRY (on your app) :
- Don't wrap an
a
tag inside of abutton
or the other way around. Use onlya
tag on thego back
link. - The country name could be an
h1
because remember that every page of a site needs to have anh1
, so for this, use theh1
on the name since it is all about the country on the single page. - Again, those 8 information could use a
ul
tag since they are "list" of information. Also, it would be really nice to add some paddings on those orgap
because right now, every text are almost touching each other. - For the
border
ul
tag, using any other element exceptli
tag as the direct child oful
is invalid. Change thep
tag on that one or maybe just use like:
div.border__holder h2.Border ul >li
A markup of something like that would be fine.
- Lastly, change each border-countries to using only
a
tag.a
tag inside abutton
or vice-versa just adds an extra tab when navigating.
Aside from those, great job again on this one.
Marked as helpful0@dimolf345Posted almost 3 years ago@pikapikamart thanks a lot for all your suggestions!
I definitely agree with all you have said, and you're right this project is quite poor on HTML semantic because I focused my attention in how to structure a react project and how to use React Redux and React router, since it was my second React project.
Anyway, I will try to fix all these bugs ASAP. Thanks a lot again!
1 - I am getting some logs so maybe checking if you have left some
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