From 808b62645f869119828778a6ac4a13d1b0f749f5 Mon Sep 17 00:00:00 2001 From: Bastian Masanek Date: Wed, 5 Nov 2025 03:09:44 +0100 Subject: [PATCH] Refactor Cart UI to Enhance Responsiveness and User Experience - Replaced CartSheet and CartSidebar components with a new CartResponsive component that adapts to screen size, providing a unified cart experience. - Implemented responsive animations for the cart, allowing it to slide in from the right on desktop and from the bottom on mobile. - Updated styles and layout in tailwind.css to support new animation effects for the cart component. --- app/app.vue | 10 +- .../{CartSidebar.vue => CartResponsive.vue} | 14 +- app/components/Cart/CartSheet.vue | 66 ------- app/components/Cart/index.ts | 3 +- app/layouts/default.vue | 13 +- assets/css/tailwind.css | 164 ++++++++++++++++++ 6 files changed, 184 insertions(+), 86 deletions(-) rename app/components/Cart/{CartSidebar.vue => CartResponsive.vue} (80%) delete mode 100644 app/components/Cart/CartSheet.vue diff --git a/app/app.vue b/app/app.vue index e29ccb5..f66156c 100644 --- a/app/app.vue +++ b/app/app.vue @@ -9,9 +9,7 @@ // 15px, which shifted the entire page content 15px to the left. This prop prevents // that unwanted padding injection and layout shift. import { ConfigProvider } from 'reka-ui' - -// Import cart UI components -const { isMobile } = useCartUI() +import CartResponsive from '~/components/Cart/CartResponsive.vue' diff --git a/app/components/Cart/CartSidebar.vue b/app/components/Cart/CartResponsive.vue similarity index 80% rename from app/components/Cart/CartSidebar.vue rename to app/components/Cart/CartResponsive.vue index 2d28fea..cecc168 100644 --- a/app/components/Cart/CartSidebar.vue +++ b/app/components/Cart/CartResponsive.vue @@ -1,4 +1,5 @@ - - diff --git a/app/components/Cart/index.ts b/app/components/Cart/index.ts index f5bb864..05bbf8a 100644 --- a/app/components/Cart/index.ts +++ b/app/components/Cart/index.ts @@ -2,5 +2,4 @@ export { default as CartItem } from './CartItem.vue' export { default as CartSummary } from './CartSummary.vue' export { default as CartEmpty } from './CartEmpty.vue' export { default as CartFAB } from './CartFAB.vue' -export { default as CartSidebar } from './CartSidebar.vue' -export { default as CartSheet } from './CartSheet.vue' +export { default as CartResponsive } from './CartResponsive.vue' diff --git a/app/layouts/default.vue b/app/layouts/default.vue index 007cf53..e4f524f 100644 --- a/app/layouts/default.vue +++ b/app/layouts/default.vue @@ -2,12 +2,8 @@ import AppHeader from '~/components/navigation/AppHeader.vue' import BottomNav from '~/components/navigation/BottomNav.vue' import CartFAB from '~/components/Cart/CartFAB.vue' -import CartSidebar from '~/components/Cart/CartSidebar.vue' -import CartSheet from '~/components/Cart/CartSheet.vue' +import CartResponsive from '~/components/Cart/CartResponsive.vue' import { Toaster } from '~/components/ui/sonner' - -// Determine which cart UI to show based on screen size -const { isMobile } = useCartUI()