fix eslint warnings
This commit is contained in:
1 parent
501ce4d3d0
commit
2e517cc7f7
5 files changed
+60
-63
No files matched your search
+2
-4
@@ -40,10 +40,8 @@ const Index: NextPage<Props> = props => (
|
||||
)
|
||||
|
||||
export const getStaticProps: GetStaticProps<Props> = async () => {
|
||||
const items = await apiGet(createHomeCards)
|
||||
('https://hudozka.tmshv.com/home', async () => [])
|
||||
const menu = await apiGet(createMenu)
|
||||
('https://hudozka.tmshv.com/menu', () => [])
|
||||
const items = await apiGet(createHomeCards)('https://hudozka.tmshv.com/home', async () => [])
|
||||
const menu = await apiGet(createMenu)('https://hudozka.tmshv.com/menu', () => [])
|
||||
|
||||
const title = 'Шлиссельбургская ДХШ'
|
||||
const meta = (new MetaBuilder())
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
export const Author: React.FC = () => (
|
||||
<span>
|
||||
Разработка и поддержка сайта —
|
||||
<a href="http://tmshv.ru?utm_source=artshburg&utm_medium=developer&utm_campaign=tmshv_ru">
|
||||
<a href="http://tmshv.ru?utm_source=artshburg&utm_medium=developer&utm_campaign=tmshv_ru">
|
||||
www.tmshv.ru
|
||||
</a>
|
||||
</a>
|
||||
</span>
|
||||
)
|
||||
@@ -16,7 +16,8 @@ export const Transition: React.FC<ITransitionProps> = props => {
|
||||
}, [opacity])
|
||||
const transition = React.useMemo(
|
||||
() => `all ${props.duration}ms`,
|
||||
[props.duration])
|
||||
[props.duration]
|
||||
)
|
||||
|
||||
React.useEffect(() => {
|
||||
if (!props.show) {
|
||||
|
||||
@@ -1,10 +1,8 @@
|
||||
import * as React from 'react'
|
||||
|
||||
export const Share: React.FC = () => (
|
||||
<div className="likely">
|
||||
<div className="vkontakte">Поделиться</div>
|
||||
<div className="facebook">Поделиться</div>
|
||||
<div className="telegram">Отправить</div>
|
||||
<div className="twitter">Твитнуть</div>
|
||||
</div>
|
||||
<div className="likely">
|
||||
<div className="vkontakte">Поделиться</div>
|
||||
<div className="facebook">Поделиться</div>
|
||||
<div className="telegram">Отправить</div>
|
||||
<div className="twitter">Твитнуть</div>
|
||||
</div>
|
||||
)
|
||||
+48
-48
@@ -34,64 +34,64 @@ export function createEmbed(component: StrapiComponentEmbed): Token {
|
||||
|
||||
export async function createPageToken(component: StrapiComponent): Promise<Token> {
|
||||
switch (component.__component) {
|
||||
case 'hudozka.text': {
|
||||
return {
|
||||
token: 'html',
|
||||
data: md(component.text),
|
||||
}
|
||||
case 'hudozka.text': {
|
||||
return {
|
||||
token: 'html',
|
||||
data: md(component.text),
|
||||
}
|
||||
}
|
||||
|
||||
case 'hudozka.image': {
|
||||
const data = await createPicFromMedia(component.media, {
|
||||
alternativeText: component.caption,
|
||||
caption: component.caption,
|
||||
})
|
||||
case 'hudozka.image': {
|
||||
const data = await createPicFromMedia(component.media, {
|
||||
alternativeText: component.caption,
|
||||
caption: component.caption,
|
||||
})
|
||||
|
||||
return {
|
||||
token: 'image',
|
||||
wide: component.wide,
|
||||
data,
|
||||
}
|
||||
return {
|
||||
token: 'image',
|
||||
wide: component.wide,
|
||||
data,
|
||||
}
|
||||
}
|
||||
|
||||
case 'hudozka.document': {
|
||||
return {
|
||||
token: 'file',
|
||||
data: {
|
||||
url: component.media.url,
|
||||
slug: 'jopa',
|
||||
image_url: component.media.url,
|
||||
file_url: component.media.url,
|
||||
title: component.title,
|
||||
file_size: component.media.size * 1000,
|
||||
// file_size: component.media.size,
|
||||
file_format: component.media.mime,
|
||||
},
|
||||
}
|
||||
case 'hudozka.document': {
|
||||
return {
|
||||
token: 'file',
|
||||
data: {
|
||||
url: component.media.url,
|
||||
slug: 'jopa',
|
||||
image_url: component.media.url,
|
||||
file_url: component.media.url,
|
||||
title: component.title,
|
||||
file_size: component.media.size * 1000,
|
||||
// file_size: component.media.size,
|
||||
file_format: component.media.mime,
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
case 'hudozka.embed': {
|
||||
return createEmbed(component)
|
||||
case 'hudozka.embed': {
|
||||
return createEmbed(component)
|
||||
}
|
||||
|
||||
case 'hudozka.card-grid': {
|
||||
const items = await Promise.all(component.items
|
||||
.filter(Boolean)
|
||||
.map(createCardGrid)
|
||||
)
|
||||
return {
|
||||
token: 'grid',
|
||||
data: {
|
||||
items,
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
case 'hudozka.card-grid': {
|
||||
const items = await Promise.all(component.items
|
||||
.filter(Boolean)
|
||||
.map(createCardGrid)
|
||||
)
|
||||
return {
|
||||
token: 'grid',
|
||||
data: {
|
||||
items,
|
||||
},
|
||||
}
|
||||
default:
|
||||
return {
|
||||
token: 'text',
|
||||
data: ` ${JSON.stringify(component)}`,
|
||||
}
|
||||
|
||||
default:
|
||||
return {
|
||||
token: 'text',
|
||||
data: ` ${JSON.stringify(component)}`,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user