File tree Expand file tree Collapse file tree 6 files changed +125
-2
lines changed Expand file tree Collapse file tree 6 files changed +125
-2
lines changed Original file line number Diff line number Diff line change 1+ import React from 'react'
2+ import CustomButton from '../custom-button/custom-button.component'
3+ import './cart-dropdown.styles.scss'
4+ export default function CartDropdown ( ) {
5+ return (
6+ < div className = "cart-dropdown" >
7+ < div className = "cart-item" >
8+ < CustomButton > GO TO CHECKOUT</ CustomButton >
9+ </ div >
10+ </ div >
11+ )
12+ }
Original file line number Diff line number Diff line change 1+ .cart-dropdown {
2+ position : absolute ;
3+ width : 240px ;
4+ height : 340px ;
5+ display : flex ;
6+ flex-direction : column ;
7+ padding : 20px ;
8+ border : 1px solid black ;
9+ background-color : white ;
10+ top : 90px ;
11+ right : 40px ;
12+ z-index : 5 ;
13+
14+ .cart-items {
15+ height : 240px ;
16+ display : flex ;
17+ flex-direction : column ;
18+ overflow : scroll ;
19+ }
20+
21+ button {
22+ margin-top : auto ;
23+ }
24+ }
Original file line number Diff line number Diff line change 1+ import React from 'react'
2+ import './cart-icon.styles.scss'
3+ import { ReactComponent as ShoppingIcon } from '../../assets/shopping-bag.svg'
4+ export default function CartIcon ( ) {
5+ return (
6+ < div className = "cart-icon" >
7+ < ShoppingIcon className = "shopping-icon" />
8+ < span className = "item-count" > 0</ span >
9+ </ div >
10+ )
11+ }
Original file line number Diff line number Diff line change 1+ .cart-icon {
2+ width : 45px ;
3+ height : 45px ;
4+ position : relative ;
5+ display : flex ;
6+ align-items : center ;
7+ justify-content : center ;
8+ cursor : pointer ;
9+
10+ .shopping-icon {
11+ width : 24px ;
12+ height : 24px ;
13+ }
14+
15+ .item-count {
16+ position : absolute ;
17+ font-size : 10px ;
18+ font-weight : bold ;
19+ bottom : 12px ;
20+ }
21+ }
Original file line number Diff line number Diff line change @@ -4,7 +4,8 @@ import './header.styles.scss'
44import { ReactComponent as Logo } from '../../assets/newLogo.svg'
55import { Link } from 'react-router-dom'
66import { auth } from '../../firebase/firebase.utils'
7-
7+ import CartIcon from '../cart-icon/Cart-icon'
8+ import CartDropdown from '../cart-dropdown/cart-dropdown.component'
89function Header ( { currentUser } ) {
910 return (
1011 < div className = "header" >
@@ -28,8 +29,9 @@ function Header({ currentUser }) {
2829 SIGN IN
2930 </ Link >
3031 }
31-
32+ < CartIcon />
3233 </ div >
34+ < CartDropdown />
3335 </ div >
3436 )
3537}
You can’t perform that action at this time.
0 commit comments