-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
*Обновление QoL в рамках авторизации через смс код (добавил фокус на custom компонент / возможность навигации / arial label для слабо видящих-глухонемых[скрин ридеры] ) * Работа над товарами по категориям (подготовка инфраструктуры ожидание согласование дизайна страницы товаров по категориям)
- Loading branch information
Showing
36 changed files
with
753 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
"use server"; | ||
import { headers } from 'next/headers' | ||
import { isMobileDevice } from "@/shared/tools/responsive"; | ||
import { CatalogPage } from '@/_pages/CatalogPage'; | ||
|
||
const Page = async ({ params }: { params: any }) => { | ||
const mobile = isMobileDevice(headers().get('user-agent')||""); | ||
return <CatalogPage params={{ ...params, mobile }} />; | ||
}; | ||
|
||
export default Page; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
import { UrlApiWithDomain, UrlRevalidate } from "@/shared/api/url"; | ||
import type { Metadata } from "next"; | ||
import { unstable_setRequestLocale } from "next-intl/server"; | ||
|
||
export const metadata: Metadata = { | ||
title: "dev.SCK-1.kz", | ||
description: "Сайт в разработке dev.SCK-1.kz", | ||
}; | ||
|
||
|
||
export async function generateStaticParams() { | ||
const fetchCity = await ( | ||
await fetch(UrlApiWithDomain.getCity, { | ||
...UrlRevalidate.getCity, | ||
headers: { | ||
"Content-Type": "application/json", | ||
Accept: "application/json", | ||
}, | ||
}) | ||
).json(); | ||
const city = fetchCity.map((i: any) => ({ city: i.additional_data.EN })); | ||
return city; | ||
} | ||
|
||
export default async function RootLayout({ | ||
children, | ||
params: { locale, city }, | ||
}: { | ||
children: React.ReactNode; | ||
params: { locale: string; city: string }; | ||
}) { | ||
unstable_setRequestLocale(locale); | ||
return ( | ||
<html lang={locale}> | ||
<body>{children}</body> | ||
</html> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
"use server"; | ||
import { headers } from 'next/headers' | ||
import { isMobileDevice } from "@/shared/tools/responsive"; | ||
import { LoginPage } from '@/_pages/LoginPage'; | ||
|
||
const Page = async ({ params }: { params: any }) => { | ||
const mobile = isMobileDevice(headers().get('user-agent')||""); | ||
return <LoginPage params={{ ...params, mobile }} />; | ||
}; | ||
|
||
export default Page; |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export { } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export { } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
export * from './api' | ||
export * from './config' | ||
export * from './model' | ||
export * from './ui' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export { } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,78 @@ | ||
"use server"; | ||
|
||
import { ProvidersClient } from "@/_app/providers/providersClient"; | ||
import { ProvidersServer } from "@/_app/providers/providersServer"; | ||
import { FooterMobileSCK } from "@/features/FooterMobileSCK"; | ||
import { FooterSCK } from "@/features/FooterSCK"; | ||
import { UrlApi, UrlApiWithDomain, UrlRevalidate } from "@/shared/api/url"; | ||
import { Catalog } from "@/widgets/Catalog"; | ||
|
||
import { HeaderSCK } from "@/widgets/HeaderSCK"; | ||
import { Flex } from "antd"; | ||
|
||
export default async function CatalogPage({params}: {params: any}) { | ||
const fetchCity = await ( | ||
await fetch(UrlApiWithDomain.getCity, { | ||
...UrlRevalidate.getCity, | ||
headers: { | ||
"Content-Type": "application/json", | ||
Accept: "application/json", | ||
}, | ||
}) | ||
).json(); | ||
|
||
const fetchCategory = await ( | ||
await fetch(UrlApiWithDomain.getCategory, { | ||
...UrlRevalidate.getCategory, | ||
headers: { | ||
"Content-Type": "application/json", | ||
Accept: "application/json", | ||
}, | ||
}) | ||
).json(); | ||
|
||
const UrlProductCatalog = `${UrlApi.getProducts}filter_by_cat/${params.slug}`; | ||
const UrlProductCatalogWithDomain = `${UrlApiWithDomain.getProducts}filter_by_cat/${params.slug}`; | ||
|
||
console.log(UrlProductCatalog); | ||
console.log(UrlProductCatalogWithDomain); | ||
|
||
const fetchProductCatalog = await ( | ||
await fetch(UrlProductCatalogWithDomain, { | ||
...UrlRevalidate.getProducts, | ||
headers: { | ||
"Content-Type": "application/json", | ||
Accept: "application/json", | ||
}, | ||
}) | ||
).json(); | ||
|
||
|
||
const fallback = { | ||
[UrlApi.getCity]: fetchCity, | ||
[UrlApi.getCategory]: fetchCategory, | ||
[UrlProductCatalog]: fetchProductCatalog | ||
}; | ||
|
||
return ( | ||
<> | ||
<ProvidersServer> | ||
<ProvidersClient | ||
fallback={fallback} | ||
params={params} | ||
> | ||
<Flex vertical={true}> | ||
<HeaderSCK params={params} carousel /> | ||
<section> | ||
<Catalog params={params} /> | ||
</section> | ||
<footer style={{position:"relative",width:"100%",bottom:"0"}}> | ||
<FooterMobileSCK params={params} /> | ||
<FooterSCK params={params} /> | ||
</footer> | ||
</Flex> | ||
</ProvidersClient> | ||
</ProvidersServer> | ||
</> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
import CatalogPage from './CatalogPage.tsx' | ||
|
||
export { CatalogPage } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export * from './ui' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,90 @@ | ||
"use server"; | ||
|
||
import { ProvidersClient } from "@/_app/providers/providersClient"; | ||
import { ProvidersServer } from "@/_app/providers/providersServer"; | ||
import { FooterMobileSCK } from "@/features/FooterMobileSCK"; | ||
import { FooterSCK } from "@/features/FooterSCK"; | ||
import { UrlApi, UrlApiWithDomain, UrlRevalidate } from "@/shared/api/url"; | ||
import { Populates } from "@/shared/types/populates"; | ||
|
||
import { HeaderSCK } from "@/widgets/HeaderSCK"; | ||
import { Login } from "@/widgets/Login"; | ||
import { Sale } from "@/widgets/Sale"; | ||
import { Flex } from "antd"; | ||
export default async function LoginPage({ params }: { params: any }) { | ||
const fetchCity = await ( | ||
await fetch(UrlApiWithDomain.getCity, { | ||
...UrlRevalidate.getCity, | ||
headers: { | ||
"Content-Type": "application/json", | ||
Accept: "application/json", | ||
}, | ||
}) | ||
).json(); | ||
|
||
const fetchCategory = await ( | ||
await fetch(UrlApiWithDomain.getCategory, { | ||
...UrlRevalidate.getCategory, | ||
headers: { | ||
"Content-Type": "application/json", | ||
Accept: "application/json", | ||
}, | ||
}) | ||
).json(); | ||
|
||
const fetchPopulates = await ( | ||
await fetch(UrlApiWithDomain.getPopulates, { | ||
...UrlRevalidate.getPopulates, | ||
headers: { | ||
"Content-Type": "application/json", | ||
Accept: "application/json", | ||
}, | ||
}) | ||
).json(); | ||
|
||
const PopularProductsByIds = `by_ids/${fetchPopulates | ||
.flatMap((i: Populates) => i.products) | ||
.join(",")}`; | ||
const UrlApiPopularProductsByIds = UrlApi.getProducts + PopularProductsByIds; | ||
const UrlApiWithDomainPopularProductsByIds = | ||
UrlApiWithDomain.getProducts + PopularProductsByIds; | ||
const fetchPopularProductsByIds = await ( | ||
await fetch(UrlApiWithDomainPopularProductsByIds, { | ||
...UrlRevalidate.getProducts, | ||
headers: { | ||
"Content-Type": "application/json", | ||
Accept: "application/json", | ||
}, | ||
}) | ||
).json(); | ||
|
||
const fallback = { | ||
[UrlApi.getCity]: fetchCity, | ||
[UrlApi.getCategory]: fetchCategory, | ||
[UrlApi.getPopulates]: fetchPopulates, | ||
[UrlApiPopularProductsByIds]: fetchPopularProductsByIds, | ||
}; | ||
|
||
return ( | ||
<> | ||
<ProvidersServer> | ||
<ProvidersClient | ||
fallback={fallback} | ||
// fallback={{}} | ||
params={params} | ||
> | ||
<Flex vertical={true} gap={"15px"}> | ||
<HeaderSCK params={params}/> | ||
<section> | ||
<Login params={params} /> | ||
</section> | ||
<footer style={{position:"relative",width:"100%",bottom:"0"}}> | ||
<FooterMobileSCK params={params} /> | ||
<FooterSCK params={params} /> | ||
</footer> | ||
</Flex> | ||
</ProvidersClient> | ||
</ProvidersServer> | ||
</> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
import LoginPage from './LoginPage.tsx' | ||
|
||
export { LoginPage } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export { } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export { } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
export * from './api' | ||
export * from './config' | ||
export * from './model' | ||
export * from './ui' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export { } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
|
||
import { CarouselShopSCK } from "@/entities/CarouselShopSCK"; | ||
import { ProductCard } from "@/entities/ProductCard"; | ||
import { useGetCityParams } from "@/shared/hook/useGetCityParams"; | ||
import useSelectCurrentCity from "@/shared/hook/useSelectCurrentCity"; | ||
import { Products } from "@/shared/types/products"; | ||
import { Flex } from "antd"; | ||
|
||
|
||
export default function ProductShowcase({ | ||
params, | ||
products, | ||
}: { | ||
params: any; | ||
products: Products[]; | ||
}) { | ||
const currentCityEN = useGetCityParams(); | ||
const currentCityRU = useSelectCurrentCity("en", currentCityEN)?.name_city!; | ||
// Нам нечего демонстрировать | ||
if (products.length === 0) { | ||
return null; | ||
} | ||
|
||
const filteredProductsCurrentCity = products.filter((i: Products) => { | ||
return i?.price?.hasOwnProperty(currentCityRU); | ||
}); | ||
const {deviceType} = JSON.parse(params.mobile.value); | ||
return ( | ||
<Flex | ||
gap={"15px"} | ||
style={{ | ||
width: "80%", | ||
backgroundColor: "#fffffff6", | ||
}} | ||
> | ||
{filteredProductsCurrentCity.map((i: Products) => ( | ||
<ProductCard key={i.id} product={i} currentCityRU={currentCityRU} params={params}/> | ||
))} | ||
</Flex> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
import ProductShowcase from './ProductShowcase.tsx' | ||
|
||
export { ProductShowcase } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export { } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export { } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
export * from './api' | ||
export * from './config' | ||
export * from './model' | ||
export * from './ui' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export { } |
Oops, something went wrong.