Skip to content

Commit

Permalink
🎨 added small tweaks
Browse files Browse the repository at this point in the history
  • Loading branch information
BorghildSelle committed May 13, 2024
1 parent 48ce6c0 commit dcb717b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion web/components/src/Fact/Content.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ export const Content = ({
...rest
}: ContentProps) => {
const contentClassNames = `
${!hasColumns && !hasImage ? 'px-layout-lg' : ''}
${!hasColumns && !hasImage ? 'px-layout-lg max-w-viewport mx-auto' : ''}
${hasColumns && !hasImage ? 'px-layout-sm' : ''}
${
hasImage
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import { toPlainText } from '@portabletext/react'
import Img from 'next/image'
import { FactBox } from '@components'
import type { FactImagePosition } from '@components'
import type { PortableTextBlock } from '@portabletext/types'
import type { BackgroundColours, ImageWithAlt } from '../../../../../types/types'
import { urlFor } from '../../../../../common/helpers'
import Blocks from '../../Blocks'
import { Typography } from '@core/Typography'
import Image from '../../../SanityImage'

type FactboxProps = {
title: string
Expand Down Expand Up @@ -51,7 +51,7 @@ export const Fact = (block: BlockProps) => {
>
{imageSrc && (
<FactBox.Image imagePosition={imagePosition}>
<Img src={imageSrc} alt={image.alt ? image.alt : 'FactBox'} style={{ objectFit: 'cover' }} fill />
<Image image={image} fill />
</FactBox.Image>
)}

Expand All @@ -67,7 +67,7 @@ export const Fact = (block: BlockProps) => {
{title}
</Typography>
)}
<FactBox.Text hasColumns={hasColumns}>
<FactBox.Text>
<Blocks
value={content}
className={`prose ${hasColumns ? 'max-w-none lg:columns-2 lg:[column-gap:theme(spacing.24)]' : ''}`}
Expand Down

0 comments on commit dcb717b

Please sign in to comment.