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

Issue #19 | Recreate Nav bar using MUI #47

Merged
merged 16 commits into from
Mar 29, 2024
Merged

Issue #19 | Recreate Nav bar using MUI #47

merged 16 commits into from
Mar 29, 2024

Conversation

MiliMade
Copy link
Collaborator

Description

This code adds a NavBar component that uses MUI's app bar component to create a responsive nav bar.

Related Issue

closes #42

Acceptance Criteria

  • Use the Appbar in MUI to display a Navbar

  • Implement a hamburger dropdown if Appbar doesnt already do so

Type of Changes

Type
✨ New feature
🎆 Enhancement

Updates

Before

image

After

  • Nav bar on medium or larger screens

image

  • Nav bar on screens smaller than medium

image

image

Testing Steps / QA Criteria

  • From your terminal, pull down this branch with git pull origin gl-km-mui-nav-bar and check that branch out with git checkout gl-km-mui-nav-bar
  • In the terminal, enter npm start
  • In the browser, go to localhost:3000 and sign in
  • Test the different links in the nav bar to see if they still work
  • Using your browsers developer tools, test the responsiveness of the nav bar and click the hamburger to test the links like before.

@MiliMade MiliMade changed the title Gl km mui nav bar Issue #19 | Recreate Nav bar using MUI Mar 28, 2024
Copy link

github-actions bot commented Mar 28, 2024

Visit the preview URL for this PR (updated for commit 0c994bf):

https://tcl-70-smart-shopping-list--pr47-gl-km-mui-nav-bar-3geyvllv.web.app

(expires Fri, 05 Apr 2024 20:30:33 GMT)

🔥 via Firebase Hosting GitHub Action 🌎

Sign: 7bb526f3a6607712c7f73ffd6c0dfff4c62b86d9

Copy link
Collaborator

@lyleschemmerling lyleschemmerling left a comment

Choose a reason for hiding this comment

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

overall I like the direction that this is going. I added a few comments pertaining to the code

@@ -69,29 +72,51 @@ export function ListItem({
}, [isChecked, itemId, listPath]);

const urgency = calculateUrgency(daysUntilNextPurchase, dateLastPurchased);
const label = { inputProps: { 'aria-label': `${name}` } };
const color =
Copy link
Collaborator

Choose a reason for hiding this comment

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

nested ternarys, even with identation, are problematic. This would be better with an if or a switch

edit: this doesn't look used?

Copy link
Collaborator

@g-lee2 g-lee2 Mar 29, 2024

Choose a reason for hiding this comment

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

Hi Lyle! Oops, I was looking at the wrong code. But we fixed this in the other branch for our other PR (Issue#20)! Should fix the issue mentioned in the comment directly below

<Chip
label={urgency}
sx={{
backgroundColor:
Copy link
Collaborator

Choose a reason for hiding this comment

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

same

import { NavLink } from 'react-router-dom';
import SvgIcon from '@mui/material/SvgIcon';

function NavBar() {
Copy link
Collaborator

Choose a reason for hiding this comment

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

this is really more of a component than it is a view so I think this should live in ../components

vertical: 'top',
horizontal: 'left',
}}
open={Boolean(anchorElNav)}
Copy link
Collaborator

Choose a reason for hiding this comment

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

See the MDN article for Boolean

Warning: You should rarely find yourself using Boolean as a constructor.

Suggested change
open={Boolean(anchorElNav)}
open={!!anchorElNav}

Copy link
Collaborator

@amandaguan-ag amandaguan-ag left a comment

Choose a reason for hiding this comment

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

Looking good

@MiliMade MiliMade merged commit 5f44875 into main Mar 29, 2024
2 checks passed
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.

19. Create Navbar
4 participants