Skip to content

Commit 6810540

Browse files
committed
fix: display item categories in their color codes in the cart drawer
1 parent 1e7132e commit 6810540

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/components/shop/CartDrawer.jsx

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import { LazyLoadImage } from "react-lazy-load-image-component";
88
import { Link, useNavigate } from "react-router-dom";
99
import { useDeleteSwag } from "../../hooks/Mutations/shop/useCartSwagg";
1010
import formatPrice from "../../utilities/formatPrice";
11+
import { categoryColors } from "../../utilities/utils";
1112

1213
function CartDrawer({ open, setOpen }) {
1314
const navigate = useNavigate();
@@ -148,7 +149,12 @@ function CartDrawer({ open, setOpen }) {
148149
<div className="flex flex-row justify-between items-center mb-4">
149150
<div className="flex flex-col space-y-2 justify-start">
150151
<div className="flex justify-between">
151-
<p className="flex justify-between items-center gap-1 font-medium bg-[#FEF3F2] text-[#B42318] text-sm rounded-full px-2 py-1">
152+
<p
153+
style={categoryColors(
154+
cartProduct.category
155+
)}
156+
className="flex justify-between items-center gap-1 font-medium bg-[#FEF3F2] text-[#B42318] text-sm rounded-full px-2 py-1"
157+
>
152158
<CiShoppingTag />
153159
{cartProduct.category}
154160
</p>

0 commit comments

Comments
 (0)