3861e4b8ec
This PR accomplishes 2 things: 1. You can now add images to the rich text post of the example and see those images show up in the app. This is a good jumping off point for people who are learning how to customize the rich text renderers by adding custom components to the mapper. 2. Updating the README pictures to have a more up-to-date UI in the screenshots. ## Feature - [x] Documentation added ## Documentation / Examples - [x] Make sure the linting passes by running `yarn lint`
11 lines
266 B
JavaScript
11 lines
266 B
JavaScript
import Image from 'next/image'
|
|
|
|
export default function RichTextAsset({ id, assets }) {
|
|
const asset = assets?.find((asset) => asset.sys.id === id)
|
|
|
|
if (asset?.url) {
|
|
return <Image src={asset.url} layout="fill" alt={asset.description} />
|
|
}
|
|
|
|
return null
|
|
}
|