Skip to content

Commit

Permalink
Cart Component
Browse files Browse the repository at this point in the history
  • Loading branch information
navin-moorthy committed Aug 13, 2019
1 parent b21099e commit 3a8867b
Show file tree
Hide file tree
Showing 4 changed files with 91 additions and 0 deletions.
53 changes: 53 additions & 0 deletions src/assets/shopping-bag.svg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
14 changes: 14 additions & 0 deletions src/components/cart-icon/cart-icon.component.jsx
@@ -0,0 +1,14 @@
import React from "react";

import { ReactComponent as ShoppingIcon } from "../../assets/shopping-bag.svg";

import "./cart-icon.styles.scss";

const CartIcon = () => (
<div className="cart-icon">
<ShoppingIcon className="shopping-icon" />
<span className="item-count">0</span>
</div>
);

export default CartIcon;
21 changes: 21 additions & 0 deletions src/components/cart-icon/cart-icon.styles.scss
@@ -0,0 +1,21 @@
.cart-icon {
width: 45px;
height: 45px;
position: relative;
display: flex;
align-items: center;
justify-content: center;
cursor: pointer;

.shopping-icon {
width: 24px;
height: 24px;
}

.item-count {
position: absolute;
font-size: 10px;
font-weight: bold;
bottom: 12px;
}
}
3 changes: 3 additions & 0 deletions src/components/header/header.component.jsx
Expand Up @@ -4,6 +4,8 @@ import { connect } from "react-redux";


import { auth } from "../../firebase/firebase.utils"; import { auth } from "../../firebase/firebase.utils";


import CartIcon from "../cart-icon/cart-icon.component";

import "./header.styles.scss"; import "./header.styles.scss";
import { ReactComponent as Logo } from "../../assets/crown.svg"; import { ReactComponent as Logo } from "../../assets/crown.svg";


Expand All @@ -28,6 +30,7 @@ const Header = ({ currentUser }) => (
SIGN IN SIGN IN
</Link> </Link>
)} )}
<CartIcon />
</div> </div>
</div> </div>
); );
Expand Down

0 comments on commit 3a8867b

Please sign in to comment.