mirror of
https://gitea.smigz.com/smiggiddy/odin-codeprojects.git
synced 2025-07-15 05:40:36 -04:00
added cart and store components
This commit is contained in:
parent
556a7f8fe2
commit
81d70ec032
13 changed files with 254 additions and 54 deletions
|
@ -1,11 +1,13 @@
|
|||
import styles from "./navbar.module.css";
|
||||
import { Link } from "react-router-dom";
|
||||
import PropTypes from "prop-types";
|
||||
|
||||
export default function Navbar(props) {
|
||||
export default function Navbar({ cartItems }) {
|
||||
return (
|
||||
<nav className={styles.nav}>
|
||||
<h1>Smig.Tech</h1>
|
||||
<Nav />
|
||||
<button>I'm Ready</button>
|
||||
{cartItems ? <h1>{cartItems}</h1> : <button>I'm Ready</button>}
|
||||
</nav>
|
||||
);
|
||||
}
|
||||
|
@ -13,8 +15,16 @@ export default function Navbar(props) {
|
|||
function Nav() {
|
||||
return (
|
||||
<ul className={styles.nav}>
|
||||
<li>home</li>
|
||||
<li>shop</li>
|
||||
<li>
|
||||
<Link to="/">home</Link>
|
||||
</li>
|
||||
<li>
|
||||
<Link to="store">shop</Link>
|
||||
</li>
|
||||
</ul>
|
||||
);
|
||||
}
|
||||
|
||||
Navbar.propTypes = {
|
||||
cartItems: PropTypes.number,
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue