Skip to content
This repository was archived by the owner on Jan 26, 2026. It is now read-only.

Commit 8c0abe6

Browse files
Merge branch 'Weaverse:main' into main
2 parents 88b0e37 + b15ccd4 commit 8c0abe6

32 files changed

+1556
-298
lines changed

app/components/cart/cart.tsx

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -181,12 +181,15 @@ function CartDiscounts({
181181
<UpdateDiscountForm discountCodes={codes}>
182182
<div className="flex items-center gap-3">
183183
<input
184-
className="grow rounded-none border border-line bg-white px-4 py-5 leading-tight!"
184+
className="h-[54px] grow rounded-none border border-line bg-white px-4 py-5 leading-tight!"
185185
type="text"
186186
name="discountCode"
187187
placeholder="Discount code"
188188
/>
189-
<Button variant="outline" className="!px-6 !py-5 leading-tight!">
189+
<Button
190+
variant="outline"
191+
className="!px-6 !py-5 h-[54px] leading-tight!"
192+
>
190193
Apply
191194
</Button>
192195
</div>
@@ -270,13 +273,13 @@ function CartCheckoutActions({
270273
<Link
271274
variant="outline"
272275
to="/cart"
273-
className="flex w-full justify-center"
276+
className="flex h-[54px] w-full items-center justify-center"
274277
>
275278
View cart
276279
</Link>
277280
)}
278281
<a href={checkoutUrl} target="_self">
279-
<Button className="!px-6 !py-5 w-full">CHECKOUT</Button>
282+
<Button className="!px-6 !py-5 h-[54px] w-full">CHECKOUT</Button>
280283
</a>
281284
</div>
282285
);
@@ -371,7 +374,11 @@ function CartLineItem({
371374
>
372375
{/* Thumbnail */}
373376
<div
374-
className={clsx(layout === "drawer" ? "shrink-0" : "h-[360px] w-full")}
377+
className={clsx(
378+
layout === "drawer"
379+
? "shrink-0"
380+
: "aspect-square w-full md:h-[360px] md:w-fit",
381+
)}
375382
>
376383
{image && (
377384
<Image

app/components/layout/cart-drawer.tsx

Lines changed: 36 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,28 @@ export function CartDrawer() {
1414
const rootData = useRouteLoaderData<RootLoader>("root");
1515
const { publish } = useAnalytics();
1616
const [open, setOpen] = useState(false);
17-
toggleCartDrawer = setOpen;
17+
const [isAnimating, setIsAnimating] = useState(false);
18+
19+
const toggleCart = (newOpen: boolean) => {
20+
if (newOpen) {
21+
setOpen(true);
22+
setIsAnimating(false);
23+
} else {
24+
// Bắt đầu animation đóng
25+
setIsAnimating(true);
26+
// Delay để animation hoàn thành trước khi đóng
27+
setTimeout(() => {
28+
setOpen(false);
29+
setIsAnimating(false);
30+
}, 300);
31+
}
32+
};
33+
34+
toggleCartDrawer = toggleCart;
35+
36+
const handleOpenChange = (newOpen: boolean) => {
37+
toggleCart(newOpen);
38+
};
1839

1940
return (
2041
<Suspense
@@ -29,7 +50,7 @@ export function CartDrawer() {
2950
>
3051
<Await resolve={rootData?.cart}>
3152
{(cart) => (
32-
<Dialog.Root open={open} onOpenChange={setOpen}>
53+
<Dialog.Root open={open} onOpenChange={handleOpenChange}>
3354
<Dialog.Trigger
3455
onClick={() => publish("custom_sidecart_viewed", { cart })}
3556
className="relative flex h-8 w-8 items-center justify-center focus:ring-border"
@@ -38,28 +59,31 @@ export function CartDrawer() {
3859
{cart?.totalQuantity > 0 && (
3960
<div
4061
className={clsx(
41-
// "cart-count",
42-
"-right-1.5 absolute top-0",
43-
"flex h-4.5 min-w-4.5 items-center justify-center rounded-full px-1 text-center",
44-
"text-center font-normal text-[12px] leading-none",
45-
"transition-colors duration-300",
46-
// "group-hover/header:bg-(--color-header-text)",
47-
// "group-hover/header:text-(--color-header-bg)"
62+
"-right-2 -top-1 absolute",
63+
"flex h-5 min-w-5 items-center justify-center",
64+
"font-medium text-[11px] leading-none",
65+
"px-1 py-0.5",
4866
)}
4967
>
50-
<span className="-mr-px">{cart?.totalQuantity}</span>
68+
<span>{cart?.totalQuantity}</span>
5169
</div>
5270
)}
5371
</Dialog.Trigger>
5472
<Dialog.Portal>
5573
<Dialog.Overlay
56-
className="fixed inset-0 z-10 bg-black/50 data-[state=open]:animate-fade-in"
57-
style={{ "--fade-in-duration": "100ms" } as React.CSSProperties}
74+
className={clsx(
75+
"fixed inset-0 z-10 bg-black/50 transition-opacity duration-300",
76+
open && !isAnimating ? "opacity-100" : "opacity-0"
77+
)}
5878
/>
5979
<Dialog.Content
6080
className={clsx([
6181
"fixed inset-y-0 right-0 z-10 w-screen max-w-[430px] bg-background py-4",
82+
"transition-transform duration-300 ease-in-out",
6283
"data-[state=open]:animate-enter-from-right",
84+
open && !isAnimating
85+
? "translate-x-0"
86+
: "translate-x-full",
6387
])}
6488
aria-describedby={undefined}
6589
>

app/components/layout/desktop-menu.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ export function DesktopMenu() {
6060
<span
6161
className={cn(
6262
"ff-heading relative cursor-pointer",
63-
"after:absolute after:bottom-[-2px] after:left-0 after:h-[2px] after:w-full after:bg-current",
63+
"after:absolute after:bottom-[-0.5px] after:left-0 after:h-[2px] after:w-full after:bg-[#6A4E4E]",
6464
"after:opacity-0 hover:after:opacity-100 group-data-[state=open]:after:opacity-100",
6565
"after:transition-opacity after:duration-[360ms] after:ease-[cubic-bezier(0.22,1,0.36,1)]",
6666
)}
@@ -72,7 +72,7 @@ export function DesktopMenu() {
7272
<span
7373
className={cn(
7474
"ff-heading relative cursor-pointer",
75-
"after:absolute after:bottom-[-2px] after:left-0 after:h-[2px] after:w-full after:bg-current",
75+
"after:absolute after:bottom-[-0.5px] after:left-0 after:h-[2px] after:w-full after:bg-[#6A4E4E]",
7676
"after:opacity-0 hover:after:opacity-100 group-data-[state=open]:after:opacity-100",
7777
"after:transition-opacity after:duration-[360ms] after:ease-[cubic-bezier(0.22,1,0.36,1)]",
7878
)}
@@ -86,7 +86,7 @@ export function DesktopMenu() {
8686
<Menubar.Content
8787
className={cn([
8888
"px-3 md:px-4 lg:px-6",
89-
"mt-1.5 border-line-subtle border-t bg-(--color-header-bg-hover) shadow-lg lg:mt-3",
89+
"mt-1.5 border-line-subtle border-t bg-(--color-header-bg-hover) lg:mt-3",
9090
isDropdown ? "max-w-[300px] py-6" : "w-screen py-8",
9191
])}
9292
>

0 commit comments

Comments
 (0)