add Picture component for displaying images in articles with h/v/s layout support
This commit is contained in:
1 parent
1bd80aa0b2
commit
a55d474336
7 files changed
+75
-75
No files matched your search
+9
-11
@@ -1,5 +1,4 @@
|
||||
import Head from 'next/head'
|
||||
import Image from 'next/image'
|
||||
import { App } from 'src/components/App'
|
||||
import { tail } from 'lodash'
|
||||
import { Page } from 'src/components/Page'
|
||||
@@ -16,6 +15,7 @@ import { paramsToSlug } from '@/remote/lib'
|
||||
import { PageGrid } from '@/components/PageGrid'
|
||||
import { useRouter } from 'next/router'
|
||||
import { FileCard } from '@/components/FIleCard'
|
||||
import { Picture } from '@/components/Picture'
|
||||
|
||||
async function getUrls() {
|
||||
let urls = []
|
||||
@@ -114,16 +114,14 @@ const Index: NextPage<Props> = props => {
|
||||
|
||||
case 'image':
|
||||
return (
|
||||
<figure key={i} className="kazimir__image">
|
||||
<Image
|
||||
src={x.data.src}
|
||||
alt={x.data.alt}
|
||||
width={x.data.width}
|
||||
height={x.data.height}
|
||||
layout={'responsive'}
|
||||
/>
|
||||
<figcaption>{x.data.caption}</figcaption>
|
||||
</figure>
|
||||
<Picture
|
||||
key={i}
|
||||
src={x.data.src}
|
||||
alt={x.data.alt}
|
||||
width={x.data.width}
|
||||
height={x.data.height}
|
||||
caption={x.data.caption}
|
||||
/>
|
||||
)
|
||||
|
||||
case 'file':
|
||||
|
||||
@@ -4,7 +4,6 @@ import 'src/style/style.css'
|
||||
import 'src/style/content.css'
|
||||
import 'src/style/article.css'
|
||||
import 'src/style/marker/marker-table.css'
|
||||
import 'src/style/kazimir/image.css'
|
||||
import 'src/style/kazimir/video.css'
|
||||
|
||||
import App from 'next/app'
|
||||
|
||||
Reference in new issue
Block a user