mirror of
https://github.com/acid-info/logos-press-engine.git
synced 2025-02-23 22:58:08 +00:00
enhance image size for feature post
This commit is contained in:
parent
62826ec552
commit
a0016a8e50
@ -15,7 +15,19 @@ const FeaturedPost = ({ post }: Props) => {
|
|||||||
<PostWrapper>
|
<PostWrapper>
|
||||||
<Post
|
<Post
|
||||||
data={post}
|
data={post}
|
||||||
appearance={{ imageProps: { fill: true, height: '480px' } }}
|
appearance={{
|
||||||
|
imageProps: {
|
||||||
|
fill: true,
|
||||||
|
height: '480px',
|
||||||
|
nextImageProps: post.coverImage
|
||||||
|
? {
|
||||||
|
quality: 100,
|
||||||
|
width: post.coverImage?.width * 2,
|
||||||
|
height: post.coverImage?.height * 2,
|
||||||
|
}
|
||||||
|
: {},
|
||||||
|
},
|
||||||
|
}}
|
||||||
/>
|
/>
|
||||||
</PostWrapper>
|
</PostWrapper>
|
||||||
</PostLink>
|
</PostLink>
|
||||||
|
@ -1,13 +1,11 @@
|
|||||||
import React, { useState } from 'react'
|
import React, { useState } from 'react'
|
||||||
import Image, { ImageProps } from 'next/image'
|
import Image, { ImageProps } from 'next/image'
|
||||||
import { ImageBlockEnhanced, UnbodyImageBlock } from '@/lib/unbody/unbody.types'
|
import { ImageBlockEnhanced, UnbodyImageBlock } from '@/lib/unbody/unbody.types'
|
||||||
import Imgix from 'react-imgix'
|
|
||||||
import styled from '@emotion/styled'
|
import styled from '@emotion/styled'
|
||||||
import { Blurhash } from 'react-blurhash'
|
|
||||||
|
|
||||||
export type ResponsiveImageProps = {
|
export type ResponsiveImageProps = {
|
||||||
height?: number | string
|
height?: number | string
|
||||||
nextImageProps?: ImageProps
|
nextImageProps?: Partial<ImageProps>
|
||||||
fill?: boolean
|
fill?: boolean
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -48,7 +46,12 @@ export const ResponsiveImage = ({
|
|||||||
background: 'red',
|
background: 'red',
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<img src={lazyUrl} />
|
<Image
|
||||||
|
src={lazyUrl}
|
||||||
|
alt={data.alt}
|
||||||
|
width={data.width}
|
||||||
|
height={data.height}
|
||||||
|
/>
|
||||||
<Image {...imageProps} />
|
<Image {...imageProps} />
|
||||||
</Container>
|
</Container>
|
||||||
)
|
)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user