api ulandi
This commit is contained in:
@@ -1,14 +1,25 @@
|
||||
import { category_api } from '@/shared/config/api/category/api';
|
||||
import { Link } from '@/shared/config/i18n/navigation';
|
||||
import { PRODUCT_INFO } from '@/shared/constants/data';
|
||||
import formatPhone from '@/shared/lib/formatPhone';
|
||||
import { categoryList } from '@/widgets/welcome/lib/data';
|
||||
import { useQuery } from '@tanstack/react-query';
|
||||
import { Facebook, Instagram, Mail, Phone, Send, Twitter } from 'lucide-react';
|
||||
import { useTranslations } from 'next-intl';
|
||||
import Image from 'next/image';
|
||||
import { Fragment } from 'react';
|
||||
|
||||
const Footer = () => {
|
||||
const t = useTranslations();
|
||||
const { data: category } = useQuery({
|
||||
queryKey: ['category_list'],
|
||||
queryFn: () => category_api.getCategory({ page: 1, page_size: 12 }),
|
||||
select(data) {
|
||||
return data.data.results;
|
||||
},
|
||||
});
|
||||
|
||||
return (
|
||||
<section className="max-lg:py-9 max-lg:bg-white max-lg:border-none py-12 z-50 w-full bg-[#57A595] border-t border-slate-200">
|
||||
<section className="max-lg:py-9 max-lg:bg-white max-lg:border-none max-lg:hidden py-12 z-50 w-full bg-[#57A595] border-t border-slate-200">
|
||||
<div className="custom-container max-lg:hidden">
|
||||
<div className="flex w-full gap-10 flex-col items-center justify-between text-center lg:flex-row lg:items-start lg:text-left">
|
||||
<div className="flex w-fit flex-col items-center justify-between gap-4 lg:items-start mb-8 lg:mb-0">
|
||||
@@ -27,49 +38,52 @@ const Footer = () => {
|
||||
{PRODUCT_INFO.name}
|
||||
</h2>
|
||||
</div>
|
||||
<p className="text-white max-w-xs leading-relaxed text-sm">
|
||||
Lorem ipsum dolor sit amet consectetur, adipisicing elit. Est,
|
||||
totam?
|
||||
<p className="text-white font-semibold text-md">
|
||||
{t(
|
||||
"Gastronomiya va kulinariya san'ati haqidagi yetakchi onlayn magazin",
|
||||
)}
|
||||
</p>
|
||||
</div>
|
||||
<div className="grid w-full grid-cols-1 md:grid-cols-3 gap-8 lg:gap-16">
|
||||
<div>
|
||||
<h3 className="mb-2 font-bold text-lg text-muted">
|
||||
Kategoriyalar
|
||||
{t('Kategoriyalar')}
|
||||
</h3>
|
||||
<ul className="space-y-2 text-sm">
|
||||
{categoryList.slice(0, 3).map((link) => (
|
||||
{category?.slice(0, 6)?.map((link) => (
|
||||
<Fragment key={link.name}>
|
||||
{link.subCategories.slice(0, 2).map((e, linkIdx) => (
|
||||
<li
|
||||
key={linkIdx}
|
||||
className="text-white hover:text-gray-300 transition-colors cursor-pointer"
|
||||
>
|
||||
<Link href={`/category/${link.name}/${e.name}`}>
|
||||
{e.name}
|
||||
</Link>
|
||||
</li>
|
||||
))}
|
||||
<li
|
||||
key={link.id}
|
||||
className="text-white hover:text-gray-300 transition-colors cursor-pointer"
|
||||
>
|
||||
<Link href={`/category/${link.id}/`}>{link.name}</Link>
|
||||
</li>
|
||||
</Fragment>
|
||||
))}
|
||||
</ul>
|
||||
</div>
|
||||
<div>
|
||||
<h3 className="mb-2 font-bold text-base text-muted">Sahifalar</h3>
|
||||
<h3 className="mb-2 font-bold text-base text-muted">
|
||||
{t('Sahifalar')}
|
||||
</h3>
|
||||
<ul className="space-y-2 text-sm">
|
||||
<li className="text-muted hover:text-gray-300 transition-colors cursor-pointer">
|
||||
<Link href={'/about'}>Biz haqimizda</Link>
|
||||
<Link href={'/about'}>{t('Biz haqimizda')}</Link>
|
||||
</li>
|
||||
<li className="text-muted hover:text-gray-300 transition-colors cursor-pointer">
|
||||
<Link href={'/privacy-policy'}>Maxfiylik siyosati</Link>
|
||||
<Link href={'/privacy-policy'}>
|
||||
{t('Maxfiylik siyosati')}
|
||||
</Link>
|
||||
</li>
|
||||
<li className="text-muted hover:text-gray-300 transition-colors cursor-pointer">
|
||||
<Link href={'/faq'}>Savol va javoblar</Link>
|
||||
<Link href={'/faq'}>{t('Savol-javob')}</Link>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
<div>
|
||||
<h3 className="mb-2 font-bold text-base text-muted">Aloqa</h3>
|
||||
<h3 className="mb-2 font-bold text-base text-muted">
|
||||
{t("Biz bilan bog'laning")}
|
||||
</h3>
|
||||
<ul className="space-y-2 text-sm">
|
||||
<li className="text-muted hover:text-gray-300 transition-colors cursor-pointer">
|
||||
<a href={'#'} className="flex items-center gap-2">
|
||||
|
||||
Reference in New Issue
Block a user