Add login, reg, cart, newsletter und access to small batch releases
This commit is contained in:
1 parent
414967441a
commit
fb801e3752
30 files changed
+2979
-246
No files matched your search
@@ -0,0 +1,40 @@
|
||||
import { useShop } from "../shop/useShop";
|
||||
import "./ShopDrawer.css";
|
||||
|
||||
function CartToast() {
|
||||
const {
|
||||
cartToast,
|
||||
dismissToast,
|
||||
openCart,
|
||||
openProfile,
|
||||
} = useShop();
|
||||
|
||||
if (!cartToast) return null;
|
||||
|
||||
const runAction = () => {
|
||||
dismissToast();
|
||||
if (cartToast.actionPanel === "cart") {
|
||||
openCart();
|
||||
}
|
||||
if (cartToast.actionPanel === "profile") {
|
||||
openProfile();
|
||||
}
|
||||
};
|
||||
|
||||
return (
|
||||
<div className="cart-toast">
|
||||
<button className="cart-toast-close" type="button" onClick={dismissToast}>
|
||||
x
|
||||
</button>
|
||||
<strong>{cartToast.title}</strong>
|
||||
<p>{cartToast.message}</p>
|
||||
{cartToast.actionLabel && (
|
||||
<button type="button" onClick={runAction}>
|
||||
{cartToast.actionLabel}
|
||||
</button>
|
||||
)}
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
export default CartToast;
|
||||
Reference in new issue
Block a user