show cart summary section

This commit is contained in:
hamid zarghami
2025-12-15 15:26:56 +03:30
parent b42e39dd04
commit 1f8a10a7c3
3 changed files with 8 additions and 4 deletions
@@ -8,7 +8,6 @@ import { useGetFoods } from '@/app/[name]/(Main)/hooks/useMenuData';
import type { Food } from '@/app/[name]/(Main)/types/Types'; import type { Food } from '@/app/[name]/(Main)/types/Types';
import { useCart } from '../hook/useCart'; import { useCart } from '../hook/useCart';
import { useTranslation } from 'react-i18next'; import { useTranslation } from 'react-i18next';
import { Add, Minus } from 'iconsax-react';
import { useGetProfile } from '@/app/[name]/(Profile)/profile/hooks/userProfileData'; import { useGetProfile } from '@/app/[name]/(Profile)/profile/hooks/userProfileData';
interface CartSummaryProps { interface CartSummaryProps {
@@ -13,6 +13,7 @@ import { useGetCartItems } from '@/app/[name]/(Dialogs)/cart/hooks/useCartData';
import { useGetProfile } from '@/app/[name]/(Profile)/profile/hooks/userProfileData'; import { useGetProfile } from '@/app/[name]/(Profile)/profile/hooks/userProfileData';
import { useCallback, useMemo } from 'react'; import { useCallback, useMemo } from 'react';
import { useGetShipmentMethod } from '../../hooks/useOrderData'; import { useGetShipmentMethod } from '../../hooks/useOrderData';
import CartItemsList from '@/app/[name]/(Dialogs)/cart/components/CartItemsList';
type SummarySectionProps = { type SummarySectionProps = {
cartModal: boolean; cartModal: boolean;
@@ -125,8 +126,11 @@ export const SummarySection = ({ cartModal, onToggleCartModal, deliveryType }: S
title={t("CartModal.Title")} title={t("CartModal.Title")}
visible={cartModal} visible={cartModal}
onClick={onToggleCartModal} onClick={onToggleCartModal}
titlePadding='ps-5 pe-5'
> >
<div></div> <div className='overflow-y-auto noscrollbar px-4 mt-4' dir='rtl'>
<CartItemsList />
</div>
</AnimatedBottomSheet> </AnimatedBottomSheet>
</> </>
); );
@@ -12,9 +12,10 @@ type Props = {
showTitle?: boolean, showTitle?: boolean,
blurOpacity?: string | number | null, blurOpacity?: string | number | null,
overrideClassName?: string, overrideClassName?: string,
titlePadding?: string,
} & BlurredOverlayContainerProps } & BlurredOverlayContainerProps
const AnimatedBottomSheet = ({ blurOpacity = 64, overrideClassName = '', showTitle = true, showCloseButton = true, ...props }: Props) => { const AnimatedBottomSheet = ({ blurOpacity = 64, overrideClassName = '', showTitle = true, showCloseButton = true, titlePadding = 'ps-[31px] pe-[33px]', ...props }: Props) => {
const closeRef: React.Ref<HTMLDivElement> | undefined = useRef(null); const closeRef: React.Ref<HTMLDivElement> | undefined = useRef(null);
const variants: Variants = { const variants: Variants = {
@@ -59,7 +60,7 @@ const AnimatedBottomSheet = ({ blurOpacity = 64, overrideClassName = '', showTit
animate={props.visible ? 'visible' : 'hidden'} animate={props.visible ? 'visible' : 'hidden'}
variants={variants} variants={variants}
> >
<div className="ps-[31px] pe-[33px] flex justify-between"> <div className={clsx(titlePadding, 'flex justify-between')}>
{showTitle && {showTitle &&
<div className='text-lg font-medium text-foreground leading-8 mt-2.5'> <div className='text-lg font-medium text-foreground leading-8 mt-2.5'>
{props.title} {props.title}