fix eslint errors

This commit is contained in:
tmshv committed 2022-09-06 14:34:50 +03:00
1 parent a732ec0640
commit 86a02a945b
12 files changed
+89 -89

No files matched your search

+1 -1
View File
@@ -27,7 +27,7 @@ export const App: React.FC<IAppProps> = ({ showAuthor = false, menu, ...props })
const hideBreadcrumbs = useMobile()
const router = useRouter()
const blockStyle = {
justifyContent: 'center'
justifyContent: 'center',
}
return (
+1
View File
@@ -29,6 +29,7 @@ export const FileCard: React.FC<FileCardProps> = props => {
})
}}
src={props.image_url}
alt={''}
width={100}
height={100}
objectFit={'contain'}
+1 -1
View File
@@ -11,6 +11,6 @@ export const Html: React.FC<HtmlProps> = ({ as = 'div', ...props }) => {
className: props.className,
dangerouslySetInnerHTML: {
__html: props.html,
}
},
})
}
+1 -1
View File
@@ -24,7 +24,7 @@ export const MenuItem: React.FC<MenuItemProps> = props => {
<ActiveLink
href={href}
activeStyle={{
fontWeight: 'bold'
fontWeight: 'bold',
}}
>
{props.children}
+9 -9
View File
@@ -34,7 +34,7 @@ export const Navigation: React.FC<INavigationProps> = props => {
open={open}
onClick={onClick}
style={{
margin: 'var(--size-xs)'
margin: 'var(--size-xs)',
}}
/>
</Block>
@@ -59,18 +59,18 @@ export const Navigation: React.FC<INavigationProps> = props => {
open={open}
onClick={onClick}
style={{
margin: 'var(--size-xs)'
margin: 'var(--size-xs)',
}}
/>
</Block>
) : (
<nav style={props.style}>
<Menu
layout={'desktop'}
items={menu}
/>
</nav>
)}
<nav style={props.style}>
<Menu
layout={'desktop'}
items={menu}
/>
</nav>
)}
</>
)
}
+2 -2
View File
@@ -7,5 +7,5 @@ export type SpacerProps = {
export const Spacer: React.FC<SpacerProps> = ({ as = 'div' }) => createElement(as, {
style: {
flex: 1,
}
})
},
})
+5 -5
View File
@@ -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
+1 -1
View File
@@ -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,
})
}
+1 -1
View File
@@ -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)
}
+1 -1
View File
@@ -15,7 +15,7 @@ export interface IResponseItems<T> {
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)
+8 -8
View File
@@ -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: `<iframe src="${component.src}" width="100%" height="480" frameborder="0"></iframe>`
data: `<iframe src="${component.src}" width="100%" height="480" frameborder="0"></iframe>`,
}
}
@@ -66,7 +66,7 @@ export async function createPageToken(component: StrapiComponent): Promise<Token
file_size: component.media.size * 1000,
// file_size: component.media.size,
file_format: component.media.mime,
}
},
}
}
@@ -83,7 +83,7 @@ export async function createPageToken(component: StrapiComponent): Promise<Token
token: 'grid',
data: {
items,
}
},
}
}