Skip to content

Commit

Permalink
donzo
Browse files Browse the repository at this point in the history
  • Loading branch information
nikola418 committed Jun 25, 2022
1 parent d1eb2e1 commit 974cd4d
Show file tree
Hide file tree
Showing 9 changed files with 326 additions and 108 deletions.
17 changes: 12 additions & 5 deletions food-ordering-app/components/Navbar.jsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
import Image from "next/image";
import styles from "../styles/Navbar.module.css"
import Link from "next/link"
import { useSelector } from "react-redux"

const Navbar = () => {
const quantity = useSelector((state) => state.cart.quantity)

return (
<div className={styles.container}>
Expand Down Expand Up @@ -29,12 +32,16 @@ const Navbar = () => {
<li className={styles.listItem}>Contact</li>
</ul>
</div>
<div className={styles.item}>
<div className={styles.cart}>
<Image src="/img/basket-white.png" alt="" width="30px" height="30px" />
<div className={styles.counter}>2</div>
<div className={styles.item} >
<Link href="/cart" passHref >
<a>
<div className={styles.cart}>
<Image src="/img/basket-white.png" alt="" width="30px" height="30px" />
<div className={styles.counter}>{quantity}</div>
</div>
</a>
</Link>
</div>
</div>
</div>
);
}
Expand Down
Empty file.
Loading

1 comment on commit 974cd4d

@nikola418
Copy link
Owner Author

Choose a reason for hiding this comment

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

aight (y)

Please sign in to comment.