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