An open API service indexing awesome lists of open source software.

https://github.com/arnobt78/reviews--react-fundamental-project-3

This project is a simple React application that displays user reviews. Users can navigate through the reviews, view a random review, and see the details of each reviewer.
https://github.com/arnobt78/reviews--react-fundamental-project-3

html-css-javascript netlify-deployment react react-dom react-fundamentals react-icons react-vite reactjs reactjs-components reviews

Last synced: over 1 year ago
JSON representation

This project is a simple React application that displays user reviews. Users can navigate through the reviews, view a random review, and see the details of each reviewer.

Awesome Lists containing this project

README

          

Screenshot 2025-02-09 at 02 12 20

## Reviews Project - React Fundamental Project 3

This project is a simple React application that displays user reviews. Users can navigate through the reviews, view a random review, and see the details of each reviewer.

**Online Live:** https://reviews-arnob.netlify.app/

## Setup

1. **Clone the repository:**

```sh
git clone
cd
```

2. **Install dependencies:**

```sh
npm install
```

3. **Run the development server:**

```sh
npm run dev
```

## Project Details and Steps

### Explore Data

Navigate to data.js and take a look at the data structure

### Import Reviews

First, import the reviews data into your project. This data should be an array of objects, with each object representing a person's review and containing properties such as name, job, image URL, and text.

### Setup State Value (Index)

Then, set up a state value that controls which person from the list is displayed.

### React Icons (Optional)

[Docs](https://react-icons.github.io/react-icons/)

```sh
npm install react-icons --save
```

App.jsx

```js
import { FaBeer } from "react-icons/fa";
const App = () => {
return;


Reviews Starter

;

;
};
```

### Render First Person

To render the first person in the list, you can access the first item in the reviews array and use its properties to display the person's image (inline styles), name, job, and review text.

### Prev and Next

To allow the user to cycle through the reviews, you can set up buttons to display the next and previous reviews in the list. You can do this by keeping track of the current index in the reviews array, and updating the index when the user clicks the next or previous button. You can then use the updated index to access the corresponding person's review from the reviews array.

### Random

To allow the user to display a random person's review, you can set up a button with functionality to randomly select an index in the reviews array. You can then use the selected index to display the corresponding person's review.

### Extra

The modulus operator in JavaScript is represented by the percent sign (%). It returns the remainder of a division operation between two numbers.

Overall, the flow of the application should look something like this:

- Import the reviews data into your project as an array of objects.
- Set up the reviews data as a state variable using the useState hook.
- Render the first person's review in the list using their image, name, job, and text properties.
- Set up buttons to display the next and previous reviews in the list. Keep track of the current index in the reviews array and update it when the user clicks the next or previous button.
- Set up a button to display a random person's review. This button should select a random index in the reviews array and use it to display the corresponding person's review.