Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reimplemented using modern react, added daily specials #8

Open
wants to merge 53 commits into
base: gh-pages
Choose a base branch
from

Conversation

anudaweerasinghe
Copy link
Contributor

Demo available at https://dining.scottylabs.org/

gramliu and others added 30 commits February 19, 2022 15:07
Copy link
Owner

@bezi bezi left a comment

Choose a reason for hiding this comment

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

Have some high-level feedback that I scattered throughout. That said, please feel free to go forth and do what you will with the site :) Just have some strong opinions I'm always happy to share.

@@ -0,0 +1,25 @@
{
"short_name": "React App",
Copy link
Owner

Choose a reason for hiding this comment

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

  • Looks like you checked in the React logos (public/logo*)

Also, you should update this to be production values, this manifest gets used by Android and friends.

} from "@mui/material";
import ExpandMoreIcon from "@mui/icons-material/ExpandMore";

const StyledCard = styled(Card)({
Copy link
Owner

Choose a reason for hiding this comment

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

I like the use of styled components, but if you're going to use them then your CSS is now code and you probably want to use some constants somewhere to get rid of all the duplication in the colors, font families, etc.

statusMsg,
todaysSoups,
}) {
const [modalOpen, setModalOpen] = useState(false);
Copy link
Owner

Choose a reason for hiding this comment

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

Name boolean values with is or another such word (has, should, etc) i.e. isModalOpen, setIsModalOpen

isOpen,
statusMsg,
todaysSoups,
}) {
Copy link
Owner

Choose a reason for hiding this comment

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

If you're modernizing everything, I'd suggest using Typescript.

statusMsg={statusMsg}
todaysSpecials={todaysSpecials || []}
todaysSoups={todaysSoups || []}
key={index}
Copy link
Owner

Choose a reason for hiding this comment

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

nit: setting the key to the index defeats the purpose of the key. Just use the name since that should be unique, right?

@@ -0,0 +1,13 @@
body {
margin: 0;
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen',
Copy link
Owner

Choose a reason for hiding this comment

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

If you're inlining fonts everywhere, then don't have CSS specifying this. Or pick one or the other.

// If you want to start measuring performance in your app, pass a function
// to log results (for example: reportWebVitals(console.log))
// or send to an analytics endpoint. Learn more: https://bit.ly/CRA-vitals
reportWebVitals();
Copy link
Owner

Choose a reason for hiding this comment

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

Are you actually using web vitals? No worries if not, everyone just forgets that this file is here haha.

} else if (hours >= 17 && hours < 24) {
message = evening[Math.floor(Math.random() * evening.length)];
}
const getGreeting = () => {
Copy link
Owner

Choose a reason for hiding this comment

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

Nit: just export default function getGreeting.

@@ -1,5 +1,4 @@
var hours = new Date().getHours();
Copy link
Owner

Choose a reason for hiding this comment

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

nit: Luke-warm take: Util directories are useless, they do not actually add anything to helping find the file or make it tidier :)
nit 2: if you have a single top-export, call the file the same thing (thus: getGreeting.js)

async function queryLocations() {
try {
// Query locations
const { data } = await axios.get(BASE_URL);
Copy link
Owner

Choose a reason for hiding this comment

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

Nit: Now that fetch has gotten so good, I don't see the value in loading a library to do what is now a standard utility.

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.

5 participants