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.

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

Copy link
Copy Markdown

Kudos, SonarCloud Quality Gate passed! Quality Gate passed

BugA0 Bugs
VulnerabilityA0 Vulnerabilities
Security HotspotA0 Security Hotspots
Code SmellA0 Code Smells

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

@BGIvanGBGIvanG 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 threadsrc/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 threadsrc/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.

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 threadsrc/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 threadsrc/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 threadsrc/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 threadsrc/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

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

Labels

reviewedA volunteer has reviewed this PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants

@seyyednavid@BGIvanG@migmow