Design comparison
Solution retrospective
Custom dictionary website. All feedback and criticism are welcome!
Hi all! Been a while since I last submitted a challenge, and I learned a lot the past few months! I decided to modify the challenge, so you will notice my design is slightly different. And I used styled-components because I had never used it before, so I wanted to have the experience!
For starters, I decided to remove the single play-audio button and added a smaller one with the phonetic writing and accent/origin between it. It also renders multiple buttons if there is more than one pronunciation provided. I also tried to add a small animation to the antonym/synonym buttons.
Another change I made, I added a new button right next to the search box, since we're dealing with fetching data, I decided to make so it will not fetch data as you type, as that can be troublesome. There's a way around it by memoizing but I still thought it was better this way, since it's how the other big dictionaries online did it.
One difficulty I've had was the typescript in the useDictionary context. I had to leave the useDictionaryContext()
with any
as I couldn't figure out what I did wrong.
Community feedback
- @brunomoletaPosted 7 months ago
Hello Luciano,
I cloned your repo to do a Code Review.
This is the first PR, I plan to do at least one more, because this was more of a first contact with the project.
The main thing that's hard to understand is how someone who hasn't done the project is how things are going in
Search.tsx
.It has several functions and as much as they are commented out, it's a bit confusing.
The first thing I did was to fix the initial state of
validation
using:const [validation, setValidation] = useState<ValidationType>({ isEmpty: true, isValid: false, isLoading: false, currentWord: “”, });
You were using
undefined
if I'm not mistaken. But it's either Empty or not, Valid or not. So the state starts Empty and not Valid [...].At the moment the App is broken, but I'll send you the PR anyway so you can follow my line of reasoning.
In the worst case, if another PR isn't sent and you don't want to merge, which is perfectly acceptable,
I suggest reviewing the way this state was initialized and simplify the
Search.tsx
component.You would then have to adjust several things.
Best regards from Brazil, Bruno
Marked as helpful1
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