Skip to content

Implement the ratings feature on your site using the smallest logic on the internet 😎πŸ”₯⚑

Notifications You must be signed in to change notification settings

SaadARazzaq/React-Ratings-App

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

6 Commits
Β 
Β 
Β 
Β 

Repository files navigation

React-Ratings-App

image

Welcome to the Star Ratings App! This is a simple React application that generates star ratings based on the number of stars given. The app uses a function to create a string of filled and empty stars representing the rating with proper intuition of Problem in the code as well as in this Readme.

🧠 Intuition (SLICE FUNCTION EXPLAINED => See Code)

As we used 5 filled and 5 empty stars and used slice method here. Suppose I entered '1', then in slice method, 5 - stars meaning (5 - 1) becomes 4 so it will start from 4th star that is filled and 10 - stars meaning (10 - 1) becomes 9 so iterates from 4,5,6,7,8,9 where 5 to 9 are empty stars displaying 4 empty stars and one filled star.

🏁 Getting Started

To run the app locally, follow these steps:

  1. Clone or Download the Repository:

    • Click the "Code" button above to clone or download the repository.
    • If you choose to clone, use your preferred Git tool to clone the repository to your local machine.
    • If you choose to download, extract the downloaded ZIP file to your desired location.
  2. Navigate to the Project Directory: Open your terminal/command prompt and navigate to the project folder.

  3. Install Dependencies: Install the required dependencies using npm:

    npm install
    
  4. Start the Development Server: Start the development server to run the app:

    npm start
    
    

The app will be accessible at http://localhost:3000 in your web browser.

πŸ‘€What's Inside

This project includes a simple React component that demonstrates the concept of star ratings. The main component, App.js, contains a function that generates star ratings based on a provided number of stars. The app then displays example ratings using this function.

🎯Project Aim

The aim of this project is to provide a clear and simple example of how to generate and display star ratings using React. It's a foundational example that can be expanded upon to include more advanced features or integrated into larger applications.

Feel free to explore and modify the code to suit your needs!


Created with πŸ’– by Saad

About

Implement the ratings feature on your site using the smallest logic on the internet 😎πŸ”₯⚑

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published