diff --git a/pages/[...slug].tsx b/pages/[...slug].tsx index d7c86774..4cf42c63 100644 --- a/pages/[...slug].tsx +++ b/pages/[...slug].tsx @@ -79,67 +79,67 @@ const Index: NextPage = props => {
{props.tokens.map((x, i) => { switch (x.token) { - case 'html': - return ( - - ) + case 'html': + return ( + + ) - case 'instagram': - return ( - - ) + case 'instagram': + return ( + + ) - case 'youtube': - return ( - - ) + case 'youtube': + return ( + + ) - case 'image': - return ( - - ) + case 'image': + return ( + + ) - case 'file': - return ( - - ) + case 'file': + return ( + + ) - case 'grid': - return ( - - ) + case 'grid': + return ( + + ) - default: - return ( -
-                                        {JSON.stringify(x)}
-                                    
- ) + default: + return ( +
+                                    {JSON.stringify(x)}
+                                
+ ) } })}
@@ -158,8 +158,7 @@ export const getStaticProps: GetStaticProps = async ctx => { } } - const menu = await apiGet(createMenu) - ('https://hudozka.tmshv.com/menu', () => []) + const menu = await apiGet(createMenu)('https://hudozka.tmshv.com/menu', () => []) const description = page.description ?? undefined const breadcrumbSize = page?.breadcrumb?.length ?? 0 @@ -186,8 +185,8 @@ export const getStaticProps: GetStaticProps = async ctx => { person: 'Тимашева Марина Геннадьевна', position: 'Директор', signature: '0ac4ea89753a4ba9893799442325fb41', - } - } + }, + }, } } diff --git a/src/components/App/index.tsx b/src/components/App/index.tsx index b335063a..e76e0b26 100644 --- a/src/components/App/index.tsx +++ b/src/components/App/index.tsx @@ -27,7 +27,7 @@ export const App: React.FC = ({ showAuthor = false, menu, ...props }) const hideBreadcrumbs = useMobile() const router = useRouter() const blockStyle = { - justifyContent: 'center' + justifyContent: 'center', } return ( diff --git a/src/components/FIleCard/index.tsx b/src/components/FIleCard/index.tsx index 391240af..921c635b 100644 --- a/src/components/FIleCard/index.tsx +++ b/src/components/FIleCard/index.tsx @@ -29,6 +29,7 @@ export const FileCard: React.FC = props => { }) }} src={props.image_url} + alt={''} width={100} height={100} objectFit={'contain'} diff --git a/src/components/Html/index.tsx b/src/components/Html/index.tsx index f7f552ce..198b2e34 100644 --- a/src/components/Html/index.tsx +++ b/src/components/Html/index.tsx @@ -11,6 +11,6 @@ export const Html: React.FC = ({ as = 'div', ...props }) => { className: props.className, dangerouslySetInnerHTML: { __html: props.html, - } + }, }) } diff --git a/src/components/Menu/MenuItem.tsx b/src/components/Menu/MenuItem.tsx index d44e5735..e77999d3 100644 --- a/src/components/Menu/MenuItem.tsx +++ b/src/components/Menu/MenuItem.tsx @@ -24,7 +24,7 @@ export const MenuItem: React.FC = props => { {props.children} diff --git a/src/components/Navigation/index.tsx b/src/components/Navigation/index.tsx index a9f724e1..8f718898 100644 --- a/src/components/Navigation/index.tsx +++ b/src/components/Navigation/index.tsx @@ -34,7 +34,7 @@ export const Navigation: React.FC = props => { open={open} onClick={onClick} style={{ - margin: 'var(--size-xs)' + margin: 'var(--size-xs)', }} /> @@ -59,18 +59,18 @@ export const Navigation: React.FC = props => { open={open} onClick={onClick} style={{ - margin: 'var(--size-xs)' + margin: 'var(--size-xs)', }} /> ) : ( - - )} + + )} ) } diff --git a/src/components/Spacer/index.tsx b/src/components/Spacer/index.tsx index d3ad0109..8c4dd611 100644 --- a/src/components/Spacer/index.tsx +++ b/src/components/Spacer/index.tsx @@ -7,5 +7,5 @@ export type SpacerProps = { export const Spacer: React.FC = ({ as = 'div' }) => createElement(as, { style: { flex: 1, - } -}) + }, +}) diff --git a/src/config.ts b/src/config.ts index e7bf6da3..c2106e32 100644 --- a/src/config.ts +++ b/src/config.ts @@ -27,13 +27,13 @@ const config = { { type: 'link', value: 'https://vk.com/shlisselburghudozka', - title: 'Вконтакте' + title: 'Вконтакте', }, { type: 'link', value: 'https://www.instagram.com/hudozka', - title: 'Инстаграм' - } + title: 'Инстаграм', + }, ], menu: [ { @@ -67,8 +67,8 @@ const config = { { name: 'Дистанционное образование', href: '/info/online-education', - } - ] + }, + ], } export default config diff --git a/src/lib/date.ts b/src/lib/date.ts index 786308a3..d7d7a8df 100644 --- a/src/lib/date.ts +++ b/src/lib/date.ts @@ -10,6 +10,6 @@ import { ru } from 'date-fns/locale' export const dateFormat = (date: string | Date) => { const value = typeof date === 'string' ? new Date(date) : date return format(value, "d MMMM yyyy", { - locale: ru + locale: ru, }) } diff --git a/src/lib/string.ts b/src/lib/string.ts index d55301bb..d1d083f7 100644 --- a/src/lib/string.ts +++ b/src/lib/string.ts @@ -1,3 +1,3 @@ export function titleCase(str: string) { - return str.charAt(0).toUpperCase() + str.slice(1) + return str.charAt(0).toUpperCase() + str.slice(1) } diff --git a/src/next-lib.ts b/src/next-lib.ts index 398b6525..2de33eaa 100644 --- a/src/next-lib.ts +++ b/src/next-lib.ts @@ -15,7 +15,7 @@ export interface IResponseItems { export function wrapInitialProps(fn: (ctx: NextPageContext) => void) { return async (ctx: NextPageContext) => { if (process.env.NODE_ENV === 'production' && process.browser) { - return window['__NEXT_DATA__'].props.pageProps; + return window['__NEXT_DATA__'].props.pageProps } return fn(ctx) diff --git a/src/remote/factory.ts b/src/remote/factory.ts index 2ddd00eb..cd22ca50 100644 --- a/src/remote/factory.ts +++ b/src/remote/factory.ts @@ -1,8 +1,8 @@ -import { IMenu, IPage, ITag, PageCardDto, Pic, Token } from "@/types"; -import { asItem } from "./lib"; -import { StrapiComponentEmbed, StrapiComponent, StrapiHome, StrapiPage, StrapiPageCard, StrapiTag, StrapiMedia, StrapiMenu } from "./types"; +import { IMenu, IPage, ITag, PageCardDto, Pic, Token } from "@/types" +import { asItem } from "./lib" +import { StrapiComponentEmbed, StrapiComponent, StrapiHome, StrapiPage, StrapiPageCard, StrapiTag, StrapiMedia, StrapiMenu } from "./types" import { typograf, markdownToHtml } from 'src/lib/text' -import { encodeImageToBlurhash } from "./image"; +import { encodeImageToBlurhash } from "./image" const md = (text: string) => typograf(markdownToHtml(text)) @@ -22,13 +22,13 @@ export function createEmbed(component: StrapiComponentEmbed): Token { token: 'youtube', data: { url: component.src, - } + }, } } return { token: 'html', - data: `` + data: ``, } } @@ -66,7 +66,7 @@ export async function createPageToken(component: StrapiComponent): Promise