fix: revert changes
This commit is contained in:
parent
6dc26611c3
commit
f28204416d
@ -1,7 +1,9 @@
|
|||||||
import type { Metadata } from 'next';
|
import type { Metadata } from 'next';
|
||||||
import { Inter } from 'next/font/google';
|
import { Inter } from 'next/font/google';
|
||||||
|
|
||||||
|
import { textControlApi } from '@/shared/language/api/text-control.api';
|
||||||
import { Providers } from '@/shared/providers/providers';
|
import { Providers } from '@/shared/providers/providers';
|
||||||
|
import { makeStore } from '@/shared/store';
|
||||||
import { TextItem } from '@/shared/types/text.types';
|
import { TextItem } from '@/shared/types/text.types';
|
||||||
|
|
||||||
import { Footer } from '@/widgets/footer';
|
import { Footer } from '@/widgets/footer';
|
||||||
@ -22,10 +24,11 @@ export default async function RootLayout({
|
|||||||
}: Readonly<{
|
}: Readonly<{
|
||||||
children: React.ReactNode;
|
children: React.ReactNode;
|
||||||
}>) {
|
}>) {
|
||||||
const response = (await fetch(
|
const store = makeStore();
|
||||||
`${process.env.NEXT_PUBLIC_BASE_URL}/api/text`,
|
|
||||||
{ method: 'GET' },
|
const response = await store.dispatch(
|
||||||
).then((res) => res.json())) as TextItem[];
|
textControlApi.endpoints.fetchText.initiate(),
|
||||||
|
);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<html
|
<html
|
||||||
@ -35,7 +38,7 @@ export default async function RootLayout({
|
|||||||
style={{ scrollBehavior: 'smooth' }}
|
style={{ scrollBehavior: 'smooth' }}
|
||||||
>
|
>
|
||||||
<body className={`${inter.className} antialiased`}>
|
<body className={`${inter.className} antialiased`}>
|
||||||
<Providers textItems={response as TextItem[]}>
|
<Providers textItems={response.data as TextItem[]}>
|
||||||
<Header />
|
<Header />
|
||||||
{children}
|
{children}
|
||||||
<Footer />
|
<Footer />
|
||||||
|
|||||||
@ -12,7 +12,7 @@ export const YandexMap = ({ points }: YandexMapProps) => {
|
|||||||
return (
|
return (
|
||||||
<YMaps
|
<YMaps
|
||||||
query={{
|
query={{
|
||||||
apikey: process.env.YANDEX_MAP_API_KEY,
|
apikey: process.env.NEXT_PUBLIC_YANDEX_MAP_API_KEY,
|
||||||
lang: 'ru_RU',
|
lang: 'ru_RU',
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
|
|||||||
@ -25,6 +25,7 @@ export const MapSection = ({ stations }: MapSectionProps) => {
|
|||||||
return (
|
return (
|
||||||
<section id='stations' className='bg-gray-50 px-2 py-8 sm:py-16'>
|
<section id='stations' className='bg-gray-50 px-2 py-8 sm:py-16'>
|
||||||
<div className='container mx-auto'>
|
<div className='container mx-auto'>
|
||||||
|
<YandexMap points={points} />
|
||||||
<div className='mb-12 flex flex-col items-center justify-center text-center'>
|
<div className='mb-12 flex flex-col items-center justify-center text-center'>
|
||||||
<div className='mb-4 inline-flex items-center justify-center rounded-full bg-red-100 p-2'>
|
<div className='mb-4 inline-flex items-center justify-center rounded-full bg-red-100 p-2'>
|
||||||
<MapPin className='h-6 w-6 text-red-600' />
|
<MapPin className='h-6 w-6 text-red-600' />
|
||||||
@ -40,8 +41,7 @@ export const MapSection = ({ stations }: MapSectionProps) => {
|
|||||||
className='h-[500px] overflow-hidden rounded-xl border shadow-lg'
|
className='h-[500px] overflow-hidden rounded-xl border shadow-lg'
|
||||||
data-aos='fade-up'
|
data-aos='fade-up'
|
||||||
>
|
>
|
||||||
<GasStationMap stations={stations} />
|
{/* <GasStationMap stations={stations} /> */}
|
||||||
{/* <YandexMap points={points} /> */}
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</section>
|
</section>
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user