Skip to content

6rian/dictionary

Repository files navigation

Frontend Mentor - Dictionary web app solution

This is a solution to the Dictionary web app challenge on Frontend Mentor. Frontend Mentor challenges help you improve your coding skills by building realistic projects.

Table of contents

Overview

The challenge

Users should be able to:

  • Search for words using the input field
  • See the Free Dictionary API's response for the searched word
  • See a form validation message when trying to submit a blank form
  • Play the audio file for a word when it's available
  • Switch between serif, sans serif, and monospace fonts
  • Switch between light and dark themes
  • View the optimal layout for the interface depending on their device's screen size
  • See hover and focus states for all interactive elements on the page
  • Bonus: Have the correct color scheme chosen for them based on their computer preferences. Hint: Research prefers-color-scheme in CSS.

Screenshot

Links

My process

Built with

  • Semantic HTML5 markup
  • CSS custom properties
  • Flexbox
  • Mobile-first workflow
  • TypeScript
  • React
  • SCSS

What I learned

Even though this is a small app with a shallow component tree, I wanted to combine use of React's context and reducer hooks to set up global state. In my opinion, isolating state updates to a reducer results in cleaner components and was worth the little bit of overhead the setup added.

This allowed me to easily update the search field's content when the definition changes due to the user clicking on links within definitions, made the <App> component more focused, and eliminated some prop drilling.

Continued development

  • Add unit tests
  • Cache API responses

Useful resources

Author

About

Web-based dictionary app. Solution for challenge on FrontendMentor.io.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published