close [#141]
This commit is contained in:
parent
84d71fca64
commit
4a15ed7687
|
@ -22,7 +22,7 @@ export const RenderArticleBlock = ({
|
|||
}) => {
|
||||
switch (block.type) {
|
||||
case 'image':
|
||||
return <ArticleImageBlockWrapper image={block} />
|
||||
return <ArticleImageBlockWrapper image={block} order={block.order} />
|
||||
case 'text':
|
||||
switch (block.tagName) {
|
||||
case 'h1':
|
||||
|
|
|
@ -5,11 +5,12 @@ import { lsdUtils } from '@/utils/lsd.utils'
|
|||
|
||||
type Props = {
|
||||
image: LPE.Image.Document
|
||||
order: number
|
||||
}
|
||||
|
||||
export const ArticleImageBlockWrapper = ({ image }: Props) => {
|
||||
export const ArticleImageBlockWrapper = ({ image, order }: Props) => {
|
||||
return (
|
||||
<Container>
|
||||
<Container id={`i-${order}`}>
|
||||
<ResponsiveImage data={image} />
|
||||
<figcaption>{image.alt}</figcaption>
|
||||
</Container>
|
||||
|
@ -19,6 +20,7 @@ export const ArticleImageBlockWrapper = ({ image }: Props) => {
|
|||
const Container = styled.figure`
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
|
||||
figcaption {
|
||||
padding-top: 8px;
|
||||
${lsdUtils.typography('body3')}
|
||||
|
|
|
@ -19,7 +19,7 @@ const ImageBlock = (props: Props) => {
|
|||
|
||||
return (
|
||||
<Container>
|
||||
<Link href={`/article/${document?.slug}#p-${order}`}>
|
||||
<Link href={`/article/${document?.slug}#i-${order}`}>
|
||||
<ResponsiveImage data={data} />
|
||||
</Link>
|
||||
<ContentBlockHeader
|
||||
|
|
Loading…
Reference in New Issue