doc: add hideButton to hide the button in orders page
This commit is contained in:
1 parent
d04cae7c01
commit
24e9fce241
1 file changed
+4
-2
@@ -2,7 +2,7 @@ import React from "react";
|
|||||||
import { useStateValue } from "../redux/StateProvider";
|
import { useStateValue } from "../redux/StateProvider";
|
||||||
import "./CheckoutProduct.css";
|
import "./CheckoutProduct.css";
|
||||||
|
|
||||||
function CheckoutProduct({ id, image, title, price, rating }) {
|
function CheckoutProduct({ id, image, title, price, rating, hideButton }) {
|
||||||
const [{ bakset }, dispatch] = useStateValue();
|
const [{ bakset }, dispatch] = useStateValue();
|
||||||
const removeFromBasket = () => {
|
const removeFromBasket = () => {
|
||||||
dispatch({
|
dispatch({
|
||||||
@@ -27,7 +27,9 @@ function CheckoutProduct({ id, image, title, price, rating }) {
|
|||||||
<p>🌟</p>
|
<p>🌟</p>
|
||||||
))}
|
))}
|
||||||
</article>
|
</article>
|
||||||
<button onClick={removeFromBasket}>Remove from Basket</button>
|
{!hideButton && (
|
||||||
|
<button onClick={removeFromBasket}>Remove from Basket</button>
|
||||||
|
)}
|
||||||
</article>
|
</article>
|
||||||
</section>
|
</section>
|
||||||
);
|
);
|
||||||
|
|||||||
Reference in new issue
Block a user