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.
- Host: GitHub
- URL: https://github.com/arnobt78/reviews--react-fundamental-project-3
- Owner: arnobt78
- Created: 2025-02-08T20:21:29.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2025-02-08T20:28:30.000Z (over 1 year ago)
- Last Synced: 2025-02-08T21:25:11.674Z (over 1 year ago)
- Topics: html-css-javascript, netlify-deployment, react, react-dom, react-fundamentals, react-icons, react-vite, reactjs, reactjs-components, reviews
- Language: CSS
- Homepage: https://reviews-arnob.netlify.app/
- Size: 708 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README

## 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.