Skip to content

Conversation

@HTLuff
Copy link

@HTLuff HTLuff commented Jul 5, 2018

No description provided.

if (specificOrder) {
res.json(specificOrder);
} else {
res.status(404).json({ error: "Order not found" });
Copy link
Contributor

Choose a reason for hiding this comment

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

nice

}

getBasket(total) {
const deliveryCharge = total * 0.1;
Copy link
Contributor

Choose a reason for hiding this comment

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

It would be slightly cleaner to implement this function as a separate child component and make this component simpler. Also, personal opinion` an if/else would be easier to read than multiline ternary

@@ -0,0 +1,14 @@
import React from "react";

class Footer extends React.Component {
Copy link
Contributor

Choose a reason for hiding this comment

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

This could be a functional component

@@ -0,0 +1,14 @@
import React from "react";

class Header extends React.Component {
Copy link
Contributor

Choose a reason for hiding this comment

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

This could be a functional component

@@ -0,0 +1,44 @@
import React from "react";

class Item extends React.Component {
Copy link
Contributor

Choose a reason for hiding this comment

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

This could be a functional component

import Item from "./Item";
import Basket from "./Basket";

class Menu extends React.Component {
Copy link
Contributor

Choose a reason for hiding this comment

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

This could be a functional component

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants