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.
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
More screenshot in the folder
- Solution URL: Github Repo
- Live Site URL: Site(vercel)
- Semantic HTML5 markup
- CSS custom properties
- Flexbox
- React - JS library
- React-Router-Dom - For the routes
- Styled Components - For styles
- React-Toastify - For notifications
- Eslint - For better code patterns
<li tabIndex={-1}>1</li>
. -webkit-box-shadow: 0px 6px 36px -5px rgba(0,0,0,0.77);
-moz-box-shadow: 0px 6px 36px -5px rgba(0,0,0,0.77);
box-shadow: 0px 6px 36px -5px rgba(0,0,0,0.77);
const handleSubmit = (e) => {
e.preventDefault();
// Checking if no stars were given 💬
if (!stars) return toast.info('Select a value');
// Checking if the value does not correspond to a star 💬
if (stars === '12345') {
return toast.info('Error with the value, please select again.');
}
localStorage.setItem('stars', JSON.stringify(stars));
// Navigate to the thanks page 💬
navigate('/thanks');
return true;
};
}
Clone the repo
git clone https://github.com/EuCaue/interactive-rating-component.git
Open the terminal inside of it
run npm i
Then click in localhost with ctrl key pressed