This commit is contained in:
Samandar Turgunboyev
2025-10-14 16:11:32 +05:00
parent 1f1aae0ab7
commit dc478c57bb
11 changed files with 47 additions and 75 deletions

View File

@@ -1,12 +1,8 @@
import { getPosts } from '@/shared/config/api/testApi';
import Welcome from '@/widgets/welcome';
export default async function BoxesPage() {
const res = await getPosts({ _limit: 1 });
console.log('SSR res', res.data);
return (
<div className='flex justify-center items-center h-screen'>
<div className="flex justify-center items-center h-screen">
<Welcome />
</div>
);

View File

@@ -1,12 +1,8 @@
import { getPosts } from '@/shared/config/api/testApi';
import Welcome from '@/widgets/welcome';
export default async function QrCode() {
const res = await getPosts({ _limit: 1 });
console.log('SSR res', res.data);
return (
<div className='flex justify-center items-center h-screen'>
<div className="flex justify-center items-center h-screen">
<Welcome />
</div>
);

View File

@@ -1,17 +1,15 @@
import type { Metadata } from 'next';
import '../globals.css';
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 { PRODUCT_INFO } from '@/shared/constants/data';
import type { Metadata } from 'next';
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 QueryProvider from '@/shared/config/react-query/QueryProvider';
import { notFound } from 'next/navigation';
import Script from 'next/script';
import { ReactNode } from 'react';
import '../globals.css';
export const metadata: Metadata = {
title: PRODUCT_INFO.name,

View File

@@ -15,8 +15,7 @@ httpClient.interceptors.request.use(
let language = LanguageRoutes.UZ;
try {
language = (await getLocale()) as LanguageRoutes;
} catch (e) {
console.log('error', e);
} catch {
language = getLocaleCS() || LanguageRoutes.UZ;
}

View File

@@ -33,7 +33,7 @@ const useCloser = (
document.removeEventListener('mousedown', handleClickOutside);
document.removeEventListener('scroll', handleScroll);
};
}, [ref, closeFunction]);
}, [ref, closeFunction, scrollClose]);
};
export default useCloser;

View File

@@ -1,5 +1,5 @@
import { LanguageRoutes } from '../config/i18n/types';
import { getLocale } from 'next-intl/server';
import { LanguageRoutes } from '../config/i18n/types';
/**
* Format price. With label.
@@ -10,9 +10,9 @@ import { getLocale } from 'next-intl/server';
const formatPrice = async (amount: number | string, withLabel?: boolean) => {
const locale = (await getLocale()) as LanguageRoutes;
const label = withLabel
? locale == LanguageRoutes.RU
? locale === LanguageRoutes.RU
? ' сум'
: locale == LanguageRoutes.KI
: locale === LanguageRoutes.KI
? ' сўм'
: ' som'
: '';
@@ -22,7 +22,7 @@ const formatPrice = async (amount: number | string, withLabel?: boolean) => {
const formattedDollars = dollars.replace(/\B(?=(\d{3})+(?!\d))/g, ' ');
if (String(amount).length == 0) {
if (String(amount).length === 0) {
return formattedDollars + '.' + cents + label;
} else {
return formattedDollars + label;

View File

@@ -8,25 +8,6 @@ import Image from 'next/image';
import { useParams } from 'next/navigation';
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 { data } = useQuery({
@@ -37,8 +18,6 @@ const Boxes = () => {
},
});
console.log(data);
return (
<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">

View File

@@ -1,7 +1,8 @@
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 { InstagramIcon, YoutubeIcon } from 'lucide-react';
import Image from 'next/image';
import { sections } from '../lib/data';
const Footer = () => {
return (
@@ -12,11 +13,12 @@ const Footer = () => {
{/* Logo */}
<div className="flex items-center gap-2 lg:justify-start">
<a href="https://shadcnblocks.com">
<img
<Image
src={PRODUCT_INFO.logo}
alt={PRODUCT_INFO.name}
title={PRODUCT_INFO.name}
className="h-8"
fill
/>
</a>
<h2 className="text-xl font-semibold">{PRODUCT_INFO.name}</h2>

View File

@@ -1,17 +1,16 @@
'use client';
import * as React from 'react';
import { GlobeIcon } from 'lucide-react';
import { LanguageRoutes } from '@/shared/config/i18n/types';
import { Button } from '@/shared/ui/button';
import {
DropdownMenu,
DropdownMenuContent,
DropdownMenuItem,
DropdownMenuTrigger,
} from '@/shared/ui/dropdown-menu';
import { Button } from '@/shared/ui/button';
import { languages } from '../lib/data';
import { GlobeIcon } from 'lucide-react';
import { useParams, usePathname, useRouter } from 'next/navigation';
import { LanguageRoutes } from '@/shared/config/i18n/types';
import { languages } from '../lib/data';
export function ChangeLang() {
const { locale } = useParams();
@@ -30,7 +29,7 @@ export function ChangeLang() {
<DropdownMenuTrigger asChild>
<Button variant="outline">
<GlobeIcon />
<span>{languages.find((e) => e.key == locale)?.name}</span>
<span>{languages.find((e) => e.key === locale)?.name}</span>
</Button>
</DropdownMenuTrigger>
<DropdownMenuContent align="end">

View File

@@ -1,3 +1,4 @@
import { PRODUCT_INFO } from '@/shared/constants/data';
import { Accordion } from '@/shared/ui/accordion';
import { Button } from '@/shared/ui/button';
import {
@@ -12,12 +13,12 @@ import {
SheetTrigger,
} from '@/shared/ui/sheet';
import { Menu } from 'lucide-react';
import Image from 'next/image';
import Link from 'next/link';
import { menu } from '../lib/data';
import { PRODUCT_INFO } from '@/shared/constants/data';
import { ChangeLang } from './ChangeLang';
import RenderMenuItem from './RenderItem';
import RenderMobileMenuItem from './RenderMobileMenuItem';
import { ChangeLang } from './ChangeLang';
import Link from 'next/link';
const Navbar = () => {
const auth = {
@@ -33,7 +34,9 @@ const Navbar = () => {
<div className="flex items-center gap-6">
{/* Logo */}
<Link href={'/'} className="flex items-center gap-2">
<img
<Image
width={500}
height={500}
src={PRODUCT_INFO.logo}
className="max-h-8"
alt={PRODUCT_INFO.name}
@@ -66,7 +69,9 @@ const Navbar = () => {
<div className="flex items-center justify-between">
{/* Logo */}
<Link href={'/'} className="flex items-center gap-2">
<img
<Image
width={500}
height={500}
src={PRODUCT_INFO.logo}
className="max-h-8"
alt={PRODUCT_INFO.name}
@@ -85,7 +90,9 @@ const Navbar = () => {
<SheetHeader>
<SheetTitle>
<Link href={'/'} className="flex items-center gap-2">
<img
<Image
width={500}
height={500}
src={PRODUCT_INFO.logo}
className="max-h-8"
alt={PRODUCT_INFO.name}

View File

@@ -1,16 +1,12 @@
'use client';
import { getPosts } from '@/shared/config/api/testApi';
import { useQuery } from '@tanstack/react-query';
import LOGO from '@/assets/logo.jpeg';
import Image from 'next/image';
import LOGO from "@/assets/logo.jpeg"
import Link from 'next/link';
import React from 'react';
const Welcome = () => {
return (
<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>
);
};