bug fix
This commit is contained in:
@@ -1,13 +1,9 @@
|
|||||||
import { getPosts } from '@/shared/config/api/testApi';
|
|
||||||
import Welcome from '@/widgets/welcome';
|
import Welcome from '@/widgets/welcome';
|
||||||
|
|
||||||
export default async function BoxesPage() {
|
export default async function BoxesPage() {
|
||||||
const res = await getPosts({ _limit: 1 });
|
return (
|
||||||
console.log('SSR res', res.data);
|
<div className="flex justify-center items-center h-screen">
|
||||||
|
<Welcome />
|
||||||
return (
|
</div>
|
||||||
<div className='flex justify-center items-center h-screen'>
|
);
|
||||||
<Welcome />
|
|
||||||
</div>
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,13 +1,9 @@
|
|||||||
import { getPosts } from '@/shared/config/api/testApi';
|
|
||||||
import Welcome from '@/widgets/welcome';
|
import Welcome from '@/widgets/welcome';
|
||||||
|
|
||||||
export default async function QrCode() {
|
export default async function QrCode() {
|
||||||
const res = await getPosts({ _limit: 1 });
|
return (
|
||||||
console.log('SSR res', res.data);
|
<div className="flex justify-center items-center h-screen">
|
||||||
|
<Welcome />
|
||||||
return (
|
</div>
|
||||||
<div className='flex justify-center items-center h-screen'>
|
);
|
||||||
<Welcome />
|
|
||||||
</div>
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,17 +1,15 @@
|
|||||||
import type { Metadata } from 'next';
|
|
||||||
import '../globals.css';
|
|
||||||
import { golosText } from '@/shared/config/fonts';
|
import { golosText } from '@/shared/config/fonts';
|
||||||
|
import { routing } from '@/shared/config/i18n/routing';
|
||||||
|
import QueryProvider from '@/shared/config/react-query/QueryProvider';
|
||||||
import { ThemeProvider } from '@/shared/config/theme-provider';
|
import { ThemeProvider } from '@/shared/config/theme-provider';
|
||||||
import { PRODUCT_INFO } from '@/shared/constants/data';
|
import { PRODUCT_INFO } from '@/shared/constants/data';
|
||||||
|
import type { Metadata } from 'next';
|
||||||
import { hasLocale, Locale, NextIntlClientProvider } from 'next-intl';
|
import { hasLocale, Locale, NextIntlClientProvider } from 'next-intl';
|
||||||
import { routing } from '@/shared/config/i18n/routing';
|
|
||||||
import { notFound } from 'next/navigation';
|
|
||||||
import Footer from '@/widgets/footer/ui';
|
|
||||||
import Navbar from '@/widgets/navbar/ui';
|
|
||||||
import { ReactNode } from 'react';
|
|
||||||
import { setRequestLocale } from 'next-intl/server';
|
import { setRequestLocale } from 'next-intl/server';
|
||||||
import QueryProvider from '@/shared/config/react-query/QueryProvider';
|
import { notFound } from 'next/navigation';
|
||||||
import Script from 'next/script';
|
import Script from 'next/script';
|
||||||
|
import { ReactNode } from 'react';
|
||||||
|
import '../globals.css';
|
||||||
|
|
||||||
export const metadata: Metadata = {
|
export const metadata: Metadata = {
|
||||||
title: PRODUCT_INFO.name,
|
title: PRODUCT_INFO.name,
|
||||||
|
|||||||
@@ -15,8 +15,7 @@ httpClient.interceptors.request.use(
|
|||||||
let language = LanguageRoutes.UZ;
|
let language = LanguageRoutes.UZ;
|
||||||
try {
|
try {
|
||||||
language = (await getLocale()) as LanguageRoutes;
|
language = (await getLocale()) as LanguageRoutes;
|
||||||
} catch (e) {
|
} catch {
|
||||||
console.log('error', e);
|
|
||||||
language = getLocaleCS() || LanguageRoutes.UZ;
|
language = getLocaleCS() || LanguageRoutes.UZ;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -33,7 +33,7 @@ const useCloser = (
|
|||||||
document.removeEventListener('mousedown', handleClickOutside);
|
document.removeEventListener('mousedown', handleClickOutside);
|
||||||
document.removeEventListener('scroll', handleScroll);
|
document.removeEventListener('scroll', handleScroll);
|
||||||
};
|
};
|
||||||
}, [ref, closeFunction]);
|
}, [ref, closeFunction, scrollClose]);
|
||||||
};
|
};
|
||||||
|
|
||||||
export default useCloser;
|
export default useCloser;
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import { LanguageRoutes } from '../config/i18n/types';
|
|
||||||
import { getLocale } from 'next-intl/server';
|
import { getLocale } from 'next-intl/server';
|
||||||
|
import { LanguageRoutes } from '../config/i18n/types';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Format price. With label.
|
* Format price. With label.
|
||||||
@@ -10,9 +10,9 @@ import { getLocale } from 'next-intl/server';
|
|||||||
const formatPrice = async (amount: number | string, withLabel?: boolean) => {
|
const formatPrice = async (amount: number | string, withLabel?: boolean) => {
|
||||||
const locale = (await getLocale()) as LanguageRoutes;
|
const locale = (await getLocale()) as LanguageRoutes;
|
||||||
const label = withLabel
|
const label = withLabel
|
||||||
? locale == LanguageRoutes.RU
|
? locale === LanguageRoutes.RU
|
||||||
? ' сум'
|
? ' сум'
|
||||||
: locale == LanguageRoutes.KI
|
: locale === LanguageRoutes.KI
|
||||||
? ' сўм'
|
? ' сўм'
|
||||||
: ' so‘m'
|
: ' so‘m'
|
||||||
: '';
|
: '';
|
||||||
@@ -22,7 +22,7 @@ const formatPrice = async (amount: number | string, withLabel?: boolean) => {
|
|||||||
|
|
||||||
const formattedDollars = dollars.replace(/\B(?=(\d{3})+(?!\d))/g, ' ');
|
const formattedDollars = dollars.replace(/\B(?=(\d{3})+(?!\d))/g, ' ');
|
||||||
|
|
||||||
if (String(amount).length == 0) {
|
if (String(amount).length === 0) {
|
||||||
return formattedDollars + '.' + cents + label;
|
return formattedDollars + '.' + cents + label;
|
||||||
} else {
|
} else {
|
||||||
return formattedDollars + label;
|
return formattedDollars + label;
|
||||||
|
|||||||
@@ -8,25 +8,6 @@ import Image from 'next/image';
|
|||||||
import { useParams } from 'next/navigation';
|
import { useParams } from 'next/navigation';
|
||||||
|
|
||||||
const Boxes = () => {
|
const Boxes = () => {
|
||||||
const products = [
|
|
||||||
{
|
|
||||||
name: 'Quloqchin',
|
|
||||||
nameRu: 'Наушники',
|
|
||||||
trackId: 'TRK-001',
|
|
||||||
quantity: 2,
|
|
||||||
price: '120 000 UZS',
|
|
||||||
weight: 0.4,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: 'Zaryadka',
|
|
||||||
nameRu: 'Зарядка',
|
|
||||||
trackId: 'TRK-002',
|
|
||||||
quantity: 1,
|
|
||||||
price: '60 000 UZS',
|
|
||||||
weight: 0.2,
|
|
||||||
},
|
|
||||||
];
|
|
||||||
|
|
||||||
const { id } = useParams();
|
const { id } = useParams();
|
||||||
|
|
||||||
const { data } = useQuery({
|
const { data } = useQuery({
|
||||||
@@ -37,8 +18,6 @@ const Boxes = () => {
|
|||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
console.log(data);
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="flex flex-col gap-10 container w-full justify-start items-center h-screen">
|
<div className="flex flex-col gap-10 container w-full justify-start items-center h-screen">
|
||||||
<div className="bg-gray-100/50 shadow-xl p-4 py-6 rounded-lg w-[50%] max-lg:w-[90%] flex flex-col gap-6">
|
<div className="bg-gray-100/50 shadow-xl p-4 py-6 rounded-lg w-[50%] max-lg:w-[90%] flex flex-col gap-6">
|
||||||
|
|||||||
@@ -1,7 +1,8 @@
|
|||||||
import { PRODUCT_INFO } from '@/shared/constants/data';
|
import { PRODUCT_INFO } from '@/shared/constants/data';
|
||||||
import { InstagramIcon, YoutubeIcon } from 'lucide-react';
|
|
||||||
import { sections } from '../lib/data';
|
|
||||||
import { ModeToggle } from '@/shared/ui/theme-toggle';
|
import { ModeToggle } from '@/shared/ui/theme-toggle';
|
||||||
|
import { InstagramIcon, YoutubeIcon } from 'lucide-react';
|
||||||
|
import Image from 'next/image';
|
||||||
|
import { sections } from '../lib/data';
|
||||||
|
|
||||||
const Footer = () => {
|
const Footer = () => {
|
||||||
return (
|
return (
|
||||||
@@ -12,11 +13,12 @@ const Footer = () => {
|
|||||||
{/* Logo */}
|
{/* Logo */}
|
||||||
<div className="flex items-center gap-2 lg:justify-start">
|
<div className="flex items-center gap-2 lg:justify-start">
|
||||||
<a href="https://shadcnblocks.com">
|
<a href="https://shadcnblocks.com">
|
||||||
<img
|
<Image
|
||||||
src={PRODUCT_INFO.logo}
|
src={PRODUCT_INFO.logo}
|
||||||
alt={PRODUCT_INFO.name}
|
alt={PRODUCT_INFO.name}
|
||||||
title={PRODUCT_INFO.name}
|
title={PRODUCT_INFO.name}
|
||||||
className="h-8"
|
className="h-8"
|
||||||
|
fill
|
||||||
/>
|
/>
|
||||||
</a>
|
</a>
|
||||||
<h2 className="text-xl font-semibold">{PRODUCT_INFO.name}</h2>
|
<h2 className="text-xl font-semibold">{PRODUCT_INFO.name}</h2>
|
||||||
|
|||||||
@@ -1,17 +1,16 @@
|
|||||||
'use client';
|
'use client';
|
||||||
|
|
||||||
import * as React from 'react';
|
import { LanguageRoutes } from '@/shared/config/i18n/types';
|
||||||
import { GlobeIcon } from 'lucide-react';
|
import { Button } from '@/shared/ui/button';
|
||||||
import {
|
import {
|
||||||
DropdownMenu,
|
DropdownMenu,
|
||||||
DropdownMenuContent,
|
DropdownMenuContent,
|
||||||
DropdownMenuItem,
|
DropdownMenuItem,
|
||||||
DropdownMenuTrigger,
|
DropdownMenuTrigger,
|
||||||
} from '@/shared/ui/dropdown-menu';
|
} from '@/shared/ui/dropdown-menu';
|
||||||
import { Button } from '@/shared/ui/button';
|
import { GlobeIcon } from 'lucide-react';
|
||||||
import { languages } from '../lib/data';
|
|
||||||
import { useParams, usePathname, useRouter } from 'next/navigation';
|
import { useParams, usePathname, useRouter } from 'next/navigation';
|
||||||
import { LanguageRoutes } from '@/shared/config/i18n/types';
|
import { languages } from '../lib/data';
|
||||||
|
|
||||||
export function ChangeLang() {
|
export function ChangeLang() {
|
||||||
const { locale } = useParams();
|
const { locale } = useParams();
|
||||||
@@ -30,7 +29,7 @@ export function ChangeLang() {
|
|||||||
<DropdownMenuTrigger asChild>
|
<DropdownMenuTrigger asChild>
|
||||||
<Button variant="outline">
|
<Button variant="outline">
|
||||||
<GlobeIcon />
|
<GlobeIcon />
|
||||||
<span>{languages.find((e) => e.key == locale)?.name}</span>
|
<span>{languages.find((e) => e.key === locale)?.name}</span>
|
||||||
</Button>
|
</Button>
|
||||||
</DropdownMenuTrigger>
|
</DropdownMenuTrigger>
|
||||||
<DropdownMenuContent align="end">
|
<DropdownMenuContent align="end">
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
import { PRODUCT_INFO } from '@/shared/constants/data';
|
||||||
import { Accordion } from '@/shared/ui/accordion';
|
import { Accordion } from '@/shared/ui/accordion';
|
||||||
import { Button } from '@/shared/ui/button';
|
import { Button } from '@/shared/ui/button';
|
||||||
import {
|
import {
|
||||||
@@ -12,12 +13,12 @@ import {
|
|||||||
SheetTrigger,
|
SheetTrigger,
|
||||||
} from '@/shared/ui/sheet';
|
} from '@/shared/ui/sheet';
|
||||||
import { Menu } from 'lucide-react';
|
import { Menu } from 'lucide-react';
|
||||||
|
import Image from 'next/image';
|
||||||
|
import Link from 'next/link';
|
||||||
import { menu } from '../lib/data';
|
import { menu } from '../lib/data';
|
||||||
import { PRODUCT_INFO } from '@/shared/constants/data';
|
import { ChangeLang } from './ChangeLang';
|
||||||
import RenderMenuItem from './RenderItem';
|
import RenderMenuItem from './RenderItem';
|
||||||
import RenderMobileMenuItem from './RenderMobileMenuItem';
|
import RenderMobileMenuItem from './RenderMobileMenuItem';
|
||||||
import { ChangeLang } from './ChangeLang';
|
|
||||||
import Link from 'next/link';
|
|
||||||
|
|
||||||
const Navbar = () => {
|
const Navbar = () => {
|
||||||
const auth = {
|
const auth = {
|
||||||
@@ -33,7 +34,9 @@ const Navbar = () => {
|
|||||||
<div className="flex items-center gap-6">
|
<div className="flex items-center gap-6">
|
||||||
{/* Logo */}
|
{/* Logo */}
|
||||||
<Link href={'/'} className="flex items-center gap-2">
|
<Link href={'/'} className="flex items-center gap-2">
|
||||||
<img
|
<Image
|
||||||
|
width={500}
|
||||||
|
height={500}
|
||||||
src={PRODUCT_INFO.logo}
|
src={PRODUCT_INFO.logo}
|
||||||
className="max-h-8"
|
className="max-h-8"
|
||||||
alt={PRODUCT_INFO.name}
|
alt={PRODUCT_INFO.name}
|
||||||
@@ -66,7 +69,9 @@ const Navbar = () => {
|
|||||||
<div className="flex items-center justify-between">
|
<div className="flex items-center justify-between">
|
||||||
{/* Logo */}
|
{/* Logo */}
|
||||||
<Link href={'/'} className="flex items-center gap-2">
|
<Link href={'/'} className="flex items-center gap-2">
|
||||||
<img
|
<Image
|
||||||
|
width={500}
|
||||||
|
height={500}
|
||||||
src={PRODUCT_INFO.logo}
|
src={PRODUCT_INFO.logo}
|
||||||
className="max-h-8"
|
className="max-h-8"
|
||||||
alt={PRODUCT_INFO.name}
|
alt={PRODUCT_INFO.name}
|
||||||
@@ -85,7 +90,9 @@ const Navbar = () => {
|
|||||||
<SheetHeader>
|
<SheetHeader>
|
||||||
<SheetTitle>
|
<SheetTitle>
|
||||||
<Link href={'/'} className="flex items-center gap-2">
|
<Link href={'/'} className="flex items-center gap-2">
|
||||||
<img
|
<Image
|
||||||
|
width={500}
|
||||||
|
height={500}
|
||||||
src={PRODUCT_INFO.logo}
|
src={PRODUCT_INFO.logo}
|
||||||
className="max-h-8"
|
className="max-h-8"
|
||||||
alt={PRODUCT_INFO.name}
|
alt={PRODUCT_INFO.name}
|
||||||
|
|||||||
@@ -1,16 +1,12 @@
|
|||||||
'use client';
|
'use client';
|
||||||
|
|
||||||
import { getPosts } from '@/shared/config/api/testApi';
|
import LOGO from '@/assets/logo.jpeg';
|
||||||
import { useQuery } from '@tanstack/react-query';
|
|
||||||
import Image from 'next/image';
|
import Image from 'next/image';
|
||||||
import LOGO from "@/assets/logo.jpeg"
|
|
||||||
import Link from 'next/link';
|
|
||||||
import React from 'react';
|
|
||||||
|
|
||||||
const Welcome = () => {
|
const Welcome = () => {
|
||||||
return (
|
return (
|
||||||
<div className="custom-container h-full max-h-[600px] rounded-2xl flex items-center justify-center">
|
<div className="custom-container h-full max-h-[600px] rounded-2xl flex items-center justify-center">
|
||||||
<Image src={LOGO} alt='logo' />
|
<Image src={LOGO} alt="logo" />
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user