Skip to content

Commit

Permalink
feat: allow to define space between card and image
Browse files Browse the repository at this point in the history
  • Loading branch information
gmolki committed Nov 14, 2024
1 parent 8f18168 commit ac84fe9
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/components/layout/CardWithSideImage/cmp.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ export const CardWithSideImage = ({
cardBackgroundColor = 'bg-none',
reverseColumnsWhenStacked = false,
cardOccupation = 5,
spaceBetween = '1.5rem',
}: CardWithSideImageProps) => {
const imagePercentageOccupation = 10 - cardOccupation

Expand Down Expand Up @@ -42,7 +43,7 @@ export const CardWithSideImage = ({
)

return (
<Row xs={1} md={10} gap={'1.5rem'}>
<Row xs={1} md={10} gap={spaceBetween}>
{imagePosition === 'left' ? [imageCol, cardCol] : [cardCol, imageCol]}
</Row>
)
Expand Down
2 changes: 2 additions & 0 deletions src/components/layout/CardWithSideImage/types.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { ReactNode } from 'react'
import { RowProps } from '../Grid'

export type AlignProps =
| 'normal'
Expand Down Expand Up @@ -51,6 +52,7 @@ export type CardWithSideImageProps = {
cardBackgroundColor?: string
reverseColumnsWhenStacked?: boolean
cardOccupation?: 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9
spaceBetween?: RowProps['gap']
}

export type StyledImageColProps = {
Expand Down

0 comments on commit ac84fe9

Please sign in to comment.