update ui
This commit is contained in:
@@ -2,6 +2,7 @@
|
||||
/* eslint-disable */
|
||||
import LogosProduct from '@/assets/product.png';
|
||||
import { BASE_URL } from '@/shared/config/api/URLs';
|
||||
import { useRouter } from '@/shared/config/i18n/navigation';
|
||||
import { useCartId } from '@/shared/hooks/cartId';
|
||||
import formatDate from '@/shared/lib/formatDate';
|
||||
import formatPrice from '@/shared/lib/formatPrice';
|
||||
@@ -41,6 +42,7 @@ import { uz } from 'date-fns/locale';
|
||||
import {
|
||||
Calendar as CalIcon,
|
||||
CheckCircle2,
|
||||
ChevronLeft,
|
||||
Clock,
|
||||
Loader2,
|
||||
LocateFixed,
|
||||
@@ -80,6 +82,7 @@ const OrderPage = () => {
|
||||
long: '69.240562',
|
||||
},
|
||||
});
|
||||
const router = useRouter();
|
||||
const [cart, setCart] = useState<number | string | null>(null);
|
||||
const { cart_id } = useCartId();
|
||||
const [orderSuccess, setOrderSuccess] = useState(false);
|
||||
@@ -342,6 +345,15 @@ const OrderPage = () => {
|
||||
<div className="custom-container mb-5">
|
||||
<div>
|
||||
<div className="mb-6">
|
||||
<Button
|
||||
variant="outline"
|
||||
onClick={() => router.back()}
|
||||
className="mb-4 w-fit px-2"
|
||||
size={'icon'}
|
||||
>
|
||||
<ChevronLeft size={32} />
|
||||
<p>{t('Orqaga')}</p>
|
||||
</Button>
|
||||
<h1 className="text-3xl font-bold text-gray-800 mb-2">
|
||||
{t('Buyurtmani rasmiylashtirish')}
|
||||
</h1>
|
||||
|
||||
@@ -326,9 +326,6 @@ export function ProductCard({
|
||||
}, 500);
|
||||
}}
|
||||
/>
|
||||
<span className="text-xs text-slate-500">
|
||||
{measurementDisplay}
|
||||
</span>
|
||||
</div>
|
||||
|
||||
<Button size="icon" variant="ghost" onClick={increase}>
|
||||
|
||||
@@ -48,7 +48,7 @@ const NavbarMobile = () => {
|
||||
|
||||
useEffect(() => {
|
||||
if (cartItems) {
|
||||
const total = cartItems.reduce((sum, item) => sum + item.quantity, 0);
|
||||
const total = cartItems.length;
|
||||
setCartQuenty(total > 9 ? 9 : total);
|
||||
}
|
||||
}, [cartItems]);
|
||||
|
||||
@@ -99,7 +99,6 @@ export const SearchResult = ({ query }: SearchResultProps) => {
|
||||
|
||||
{list
|
||||
.filter((item) => item.state === 'A')
|
||||
.slice(0, 5)
|
||||
.map((product) => {
|
||||
const image =
|
||||
product.images.length > 0
|
||||
|
||||
@@ -104,7 +104,7 @@ const Navbar = () => {
|
||||
|
||||
useEffect(() => {
|
||||
if (cartItems) {
|
||||
const total = cartItems.reduce((sum, item) => sum + item.quantity, 0);
|
||||
const total = cartItems.length;
|
||||
setCartQuenty(total > 9 ? 9 : total);
|
||||
} else if (cart_id === null) {
|
||||
setCartQuenty(0);
|
||||
|
||||
Reference in New Issue
Block a user