File tree Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -24,6 +24,7 @@ export type CardListItem = {
24
24
link ?: string
25
25
id ?: string
26
26
image ?: ImageProps [ "src" ]
27
+ imageWidth ?: number
27
28
alt ?: string
28
29
}
29
30
@@ -51,6 +52,7 @@ const Card = ({
51
52
caption,
52
53
link,
53
54
image,
55
+ imageWidth = 20 , // Set 20px as default image width, can be overrided if needed
54
56
alt,
55
57
...props
56
58
} : CardProps ) => {
@@ -62,7 +64,7 @@ const Card = ({
62
64
63
65
return (
64
66
< CardContainer { ...props } >
65
- { image && < Image src = { image } alt = { alt ?? "" } width = { 24 } /> }
67
+ { image && < Image src = { image } alt = { alt ?? "" } width = { imageWidth } /> }
66
68
< Flex flex = "1 1 75%" direction = "column" >
67
69
{ isLink ? (
68
70
< LinkOverlay
@@ -97,11 +99,13 @@ const Card = ({
97
99
98
100
export type CardListProps = BoxProps & {
99
101
items : CardProps [ ]
102
+ imageWidth ?: number
100
103
clickHandler ?: ( idx : string | number ) => void
101
104
}
102
105
103
106
const CardList = ( {
104
107
items,
108
+ imageWidth,
105
109
clickHandler = ( ) => null ,
106
110
...props
107
111
} : CardListProps ) => (
@@ -112,7 +116,7 @@ const CardList = ({
112
116
113
117
return isLink ? (
114
118
< LinkBox key = { id || idx } >
115
- < Card { ...listItem } />
119
+ < Card { ...listItem } imageWidth = { imageWidth } />
116
120
</ LinkBox >
117
121
) : (
118
122
< Card
You can’t perform that action at this time.
0 commit comments