cyyong95 / fm-interactive-rating

Interactive rating challenge from frontend mentor

Home Page:fm-interactive-rating-1wya.vercel.app

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Frontend Mentor - Interactive rating component

This is a solution to the Interactive rating component 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:

  • View the optimal layout for the app depending on their device's screen size
  • See hover states for all interactive elements on the page
  • Select and submit a number rating
  • See the "Thank you" card state after submitting a rating

Screenshot

interactive rating design clone
Desktop view

interactive rating thank you design clone Desktop Thank you view

interactive rating mobile design clone
Mobile view

interactive rating mobile thank you design clone
Mobile Thank you view

Links

My process

Built with

  • ReactJS
  • Typescript
  • CSS Module
  • React Testing Library (RTL)

What I learned

  • useState hook

    • Allows us to add state to a function component
  • CSS module

    • Classnames and animation names are locally scoped
    • Different components can be using the same class name but have different css properties
    • It is recommended to use camelCase to avoid facing unexpected behavior example when trying to access a kebab-case classname in JS
  • React Testing Library

    • Allows us to import and render the component for testing
    • Important to test what user sees/interacts with on the website instead of the logic behind the components
  • Typescript

    • Reduce bugs by doing static type checks when passing arguments into methods

About

Interactive rating challenge from frontend mentor

fm-interactive-rating-1wya.vercel.app


Languages

Language:TypeScript 64.4%Language:CSS 27.4%Language:HTML 8.2%