Skip to content

Commit

Permalink
fix(web): Load image with 800px width when embedded in rich text (#16355
Browse files Browse the repository at this point in the history
)

Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
  • Loading branch information
RunarVestmann and kodiakhq[bot] authored Oct 10, 2024
1 parent 13ead6f commit b8b850d
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions apps/web/utils/richText.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ import { IntlConfig, IntlProvider } from 'react-intl'
import {
FaqList,
type FaqListProps,
Image,
type ImageProps,
renderConnectedComponent,
richText,
SectionWithImage,
Expand Down Expand Up @@ -279,6 +281,11 @@ const defaultRenderComponent = {
variant={slice.variant as 'accordion' | 'card'}
/>
),
Image: (slice: ImageProps) => {
const thumbnailUrl = slice?.url ? slice.url + '?w=50' : ''
const url = slice?.url ? slice.url + '?w=800' : ''
return <Image {...slice} thumbnail={thumbnailUrl} url={url} />
},
}

export const webRichText = (
Expand Down

0 comments on commit b8b850d

Please sign in to comment.