fix: fix text display
This commit is contained in:
parent
ec2cd2cf56
commit
6dc26611c3
@ -1,9 +1,7 @@
|
||||
import type { Metadata } from 'next';
|
||||
import { Inter } from 'next/font/google';
|
||||
|
||||
import { textControlApi } from '@/shared/language/api/text-control.api';
|
||||
import { Providers } from '@/shared/providers/providers';
|
||||
import { makeStore } from '@/shared/store';
|
||||
import { TextItem } from '@/shared/types/text.types';
|
||||
|
||||
import { Footer } from '@/widgets/footer';
|
||||
@ -24,11 +22,10 @@ export default async function RootLayout({
|
||||
}: Readonly<{
|
||||
children: React.ReactNode;
|
||||
}>) {
|
||||
const store = makeStore();
|
||||
|
||||
const response = await store.dispatch(
|
||||
textControlApi.endpoints.fetchText.initiate(),
|
||||
);
|
||||
const response = (await fetch(
|
||||
`${process.env.NEXT_PUBLIC_BASE_URL}/api/text`,
|
||||
{ method: 'GET' },
|
||||
).then((res) => res.json())) as TextItem[];
|
||||
|
||||
return (
|
||||
<html
|
||||
@ -38,7 +35,7 @@ export default async function RootLayout({
|
||||
style={{ scrollBehavior: 'smooth' }}
|
||||
>
|
||||
<body className={`${inter.className} antialiased`}>
|
||||
<Providers textItems={response.data as TextItem[]}>
|
||||
<Providers textItems={response as TextItem[]}>
|
||||
<Header />
|
||||
{children}
|
||||
<Footer />
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user