feat: Delivery Item

This commit is contained in:
sonnguyenkieio 2021-09-09 15:43:50 +07:00
parent 717ff0fa27
commit 06fc9cb288
4 changed files with 7 additions and 8 deletions

View File

@ -22,7 +22,7 @@ const DeliveryItem = ({ id, status, products, totalPrice, reOrderLink } : Delive
<div className={s.separator}></div>
<Products products={products} />
<TotalPrice totalPrice={totalPrice} />
<ReOrder show={status==="delivered" ? "show" : ""} href={reOrderLink} />
<ReOrder show={status==="delivered" ? true : false} href={reOrderLink} />
</section>
)
}

View File

@ -24,7 +24,7 @@
background-color: var(--info-dark);
}
&.delivered {
background-color: var(--positive);
background-color: var(--primary);
}
}
}

View File

@ -1,10 +1,10 @@
@import '../../../../../../styles/utilities';
.reOrder {
@apply text-white custom-border-radius hidden;
@apply text-white custom-border-radius hidden font-bold;
padding: .8rem 1.2rem;
margin-right: 2.4rem;
background-color: var(--positive);
background-color: var(--primary);
&.show {
@apply block;

View File

@ -3,16 +3,15 @@ import React from "react"
import s from './ReOrder.module.scss'
import Link from 'next/link'
interface ReOrderProps {
show: string;
show: boolean;
href?: string;
}
const ReOrder = ({ show="", href="#" } : ReOrderProps) => {
const ReOrder = ({ show=false, href="#" } : ReOrderProps) => {
return (
<div className={classNames(s.reOrder, {
[s[show]]: show
[s.show]: show
})}>
<Link href={href}>
<a>Re-Order</a>