Skip to content
This repository was archived by the owner on Feb 9, 2024. It is now read-only.

London10 | Seyyednavid Hejazijouybari | React | Hotel-Project(Week1 - 3)#583

Open
seyyednavid wants to merge 11 commits into
CodeYourFuture:masterfrom
seyyednavid:master
Open

London10 | Seyyednavid Hejazijouybari | React | Hotel-Project(Week1 - 3)#583
seyyednavid wants to merge 11 commits into
CodeYourFuture:masterfrom
seyyednavid:master

Conversation

@seyyednavid

Copy link
Copy Markdown

No description provided.

@seyyednavid seyyednavid changed the title London10 | Seyyednavid Hejazijouybari | React | Hotel-Project London10 | Seyyednavid Hejazijouybari | React | Hotel-Project(Week1 - 3) Jun 16, 2023
@sonarqubecloud

Copy link
Copy Markdown

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
No Duplication information No Duplication information

@BGIvanG BGIvanG left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall the website functions great and looks really good I liked the reset button. The code looks good aswell. Just be careful with the gitignore file since removing that caused the push of the node_modules which makes it hard to review the code in the normal way and required me to use the commits.

Comment thread .gitignore

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removing the Gitignore (which is used to tell github what files not to include when commiting or pushing)from the project causes the node_modules to be committed which makes it hard to review and also cause the upload time to increase. This is a nice blog explaining it a bit more https://dev.to/grawl/why-you-dont-have-to-commit-nodemodules-folder-33nm.

Comment thread src/App.js Outdated
@@ -1,15 +1,21 @@
import React from "react";

import Header from "./Heading"

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Its normally best practise to name the component and the file the same thing since it makes searching for them much easier.

Comment thread src/Heading.js Outdated

const Heading = (props) => {
return (
<React.Fragment>

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Normally, its easier to just be able to use <> instead of React.Fragment in these situations.

Comment thread src/TouristInfoCards.js
import londonImg from "./images/london.jpeg";
import glassgowImg from "./images/glasgow.jpeg";

const TouristInfoCards = (props) => {

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If no props are being used inside of the component it doesnt need to have the props keyword here.

Comment thread src/Bookings.js Outdated
};

useEffect(() => {
fetch("https://cyf-react.glitch.me")

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would be good to add a .catch to this api request to handle errors.

Comment thread src/Order.js Outdated
const Order = (props) => {
const [orders, setOrders] = useState(0);
const orderOne = () => {
setOrders((prevOrder) => prevOrder + 1);

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is currently working great however if you wish to shorten it you can just do prevOrder + 1 without requiring the arrow function

Comment thread src/SearchResults.js
};

useEffect(() => {
fetch(`https://cyf-react.glitch.me/customers/${userID}`)

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would be great to add error handling on this file.

Comment thread src/SearchResults.js
</thead>
<tbody>
{props.results.map((person) => {
const startDate = moment(person.checkInDate);

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For this it might be best to have the calculation above the jsx so that the logic and jsx is seprate

@migmow migmow added the reviewed A volunteer has reviewed this PR label Jul 14, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

reviewed A volunteer has reviewed this PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants