add file sign and some refactoring
This commit is contained in:
1 parent
58bcd8b857
commit
3a1b4354db
14 files changed
+830
-118
No files matched your search
+13
-32
@@ -8,14 +8,14 @@ import { Meta } from 'src/components/Meta'
|
||||
import { MetaBuilder } from 'src/lib/meta'
|
||||
import { apiGet } from '@/next-lib'
|
||||
import { GetStaticProps, NextPage } from 'next'
|
||||
import { IBreadcumbsPart, IMeta, ITag, FileTokenData, Token } from '@/types'
|
||||
import { size, ext } from 'src/lib/file'
|
||||
import { IBreadcumbsPart, IMeta, ITag, Sign, Token } from '@/types'
|
||||
import { Html } from 'src/components/Html'
|
||||
import { Youtube } from '@/components/Youtube'
|
||||
import { createPage, createPageUrls } from '@/remote/factory'
|
||||
import { paramsToSlug } from '@/remote/lib'
|
||||
import { PageGrid } from '@/components/PageGrid'
|
||||
import { useRouter } from 'next/router'
|
||||
import { FileCard } from '@/components/FIleCard'
|
||||
|
||||
async function getUrls() {
|
||||
let urls = []
|
||||
@@ -36,35 +36,6 @@ async function getUrls() {
|
||||
return urls
|
||||
}
|
||||
|
||||
const File: React.SFC<FileTokenData> = props => {
|
||||
const fileSize = size(props.file_size)
|
||||
const format = ext(props.file_format)
|
||||
|
||||
return (
|
||||
<div className={'document-row'}>
|
||||
<a href={props['url']} className="invisible">
|
||||
<div className="document-row__image">
|
||||
<Image
|
||||
src={props['image_url']}
|
||||
width={200}
|
||||
height={200}
|
||||
/>
|
||||
</div>
|
||||
</a>
|
||||
|
||||
<div className="document-row__file">
|
||||
<a href={props['url']}>{props['title']}</a>
|
||||
</div>
|
||||
|
||||
<div className="document-row__file-info">
|
||||
<a href={props.file_url} target="_blank">
|
||||
{format} ({fileSize})
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
|
||||
type Props = {
|
||||
title: string
|
||||
tags: ITag[]
|
||||
@@ -83,6 +54,12 @@ const Index: NextPage<Props> = props => {
|
||||
</div>
|
||||
)
|
||||
}
|
||||
const sign: Sign = {
|
||||
date: '20.01.2021г.',
|
||||
person: 'Тимашева Марина Геннадьевна',
|
||||
position: 'Директор',
|
||||
key: '0ac4ea89753a4ba9893799442325fb41',
|
||||
}
|
||||
|
||||
return (
|
||||
<App
|
||||
@@ -154,7 +131,11 @@ const Index: NextPage<Props> = props => {
|
||||
|
||||
case 'file':
|
||||
return (
|
||||
<File key={i} {...x.data} />
|
||||
<FileCard
|
||||
key={i}
|
||||
sign={sign}
|
||||
{...x.data}
|
||||
/>
|
||||
)
|
||||
|
||||
case 'grid':
|
||||
|
||||
Reference in new issue
Block a user