Skip to content

Commit

Permalink
add icon with ability to get guest promocode in cart
Browse files Browse the repository at this point in the history
  • Loading branch information
BoikoYV committed Oct 31, 2021
1 parent f29ddbb commit 1406411
Show file tree
Hide file tree
Showing 8 changed files with 593 additions and 13 deletions.
9 changes: 7 additions & 2 deletions public/promocodesList.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,16 @@
"discountInPercentage": 5
},
{
"code": "gtgtt90gt2",
"code": "gtgtt90gt2",
"discountInPercentage": 10
},
{
"code": "half",
"code": "half",
"discountInPercentage": 50
},
{
"promocodeType": "guest",
"code": "korgyland",
"discountInPercentage": 50
}
]
4 changes: 2 additions & 2 deletions src/components/Modal/basicModal/Modal.module.css
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
.modalBox {
width: 520px;
position: absolute;
z-index: 2;
z-index: 21;
background-color: #fefefe;
display: flex;
flex-direction: column;
Expand Down Expand Up @@ -66,7 +66,7 @@
}

.overlay {
z-index: 1;
z-index: 20;
width: 100%;
position: fixed;
top: 0;
Expand Down
5 changes: 1 addition & 4 deletions src/components/OrderTotals/OrderTotals.module.css
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
.orderTotals {
grid-area: orderTotal;
}

.promocodeForm {
margin-bottom: 25px;
}
Expand Down Expand Up @@ -52,6 +48,7 @@
background-color: #d3cdf94d;
border-radius: 15px;
padding: 20px;
margin-bottom: 30px;
box-shadow: 0px 0px 10px 1px hsl(245deg, 76%, 97%);
}

Expand Down
12 changes: 11 additions & 1 deletion src/index.css
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
src: local('Alumatica'), url(./fonts/Alumatica-Regular.woff2) format('woff2');
}

@import url('../src/pages/Cart/DogIcon.css');
body {
margin: 0;
font-family: sans-serif;
Expand Down Expand Up @@ -39,6 +40,15 @@ a {
text-decoration: none;
}

input:focus, button:focus {
input:focus, button:focus {
outline: 2px solid #667ad1;
}

.dogContainer {
background-color: #3f3456;
padding: 15px;
height: 220px;
border-radius: 15px;
position: relative;
cursor: pointer;
}
6 changes: 5 additions & 1 deletion src/pages/Cart/Cart.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import { setCurrentArticul } from '../../store/currentCardArticul/actions';
import Loader from '../../components/Loader/Loader';
import { CartForm } from '../../components/CartForm/CartForm';
import OrderTotals from '../../components/OrderTotals/OrderTotals'
import DogIcon from './DogIcon';

const Cart = () => {
const isLoading = useSelector(({ cards }) => cards.isLoading);
Expand Down Expand Up @@ -56,7 +57,10 @@ const Cart = () => {
<CartList
cards={filteredCards}
onClickHandler={onClickHandler} />
<OrderTotals />
<div className={styles.totalBlock}>
<OrderTotals />
<div className={styles.dogIcon}><DogIcon /></div>
</div>
<CartForm />
</>)
}
Expand Down
15 changes: 12 additions & 3 deletions src/pages/Cart/Cart.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,13 @@
.cartInner {
display: grid;
grid-template-columns: 2.2fr 1fr;
grid-template-areas: 'listTitles orderTotal' 'list orderTotal' 'orderForm orderTotal';
grid-template-areas: 'listTitles totalBlock' 'list totalBlock' 'orderForm totalBlock';
column-gap: 100px;
row-gap: 20px;
}

.totalBlock {
grid-area: totalBlock;
}

.cartTitle {
Expand All @@ -22,11 +27,11 @@
.listTitles {
grid-area: listTitles;
display: grid;
grid-template-columns: 120px 1.5fr repeat(3, 1fr) 50px;
grid-template-columns: 120px 1.5fr repeat(3, 1fr) 50px;
text-align: center;
column-gap: 3%;
justify-content: space-between;
margin-bottom: 50px;
margin-bottom: 34px;
border-bottom: 1px solid #586ece26;
padding-bottom: 30px;
}
Expand All @@ -40,4 +45,8 @@
font-family: "Alumatica", sans-serif;
font-size: 20px;
color: #667ad1;
}

.dogIcon {
position: relative;
}
Loading

0 comments on commit 1406411

Please sign in to comment.