File tree Expand file tree Collapse file tree 2 files changed +8
-3
lines changed Expand file tree Collapse file tree 2 files changed +8
-3
lines changed Original file line number Diff line number Diff line change @@ -16,12 +16,12 @@ export const imageUrlBuilder = unconfiguredImageUrlBuilder()
16
16
. dpr ( window . devicePixelRatio ?? 1 )
17
17
. quality ( defaultQuality ) ;
18
18
19
- export const getAspectRatio = ( imageRef : string ) : number | undefined => {
19
+ export const getAspectRatio = ( imageRef : string ) : string | undefined => {
20
20
const dimensionsArr = imageRef . match ( / \d + x \d + / g) ;
21
21
if ( ! dimensionsArr ) {
22
22
return undefined ;
23
23
}
24
24
const dimensions = dimensionsArr . join ( ) . split ( "x" ) ;
25
25
const [ width , height ] = dimensions . map ( ( n : string ) => Number ( n ) ) ;
26
- return width / height ;
26
+ return ( width / height ) . toString ( ) ;
27
27
} ;
Original file line number Diff line number Diff line change @@ -211,7 +211,12 @@ const serializers = {
211
211
. url ( ) }
212
212
alt = { props . node . alt }
213
213
width = { 300 }
214
- sx = { { aspectRatio : getAspectRatio ( props . node . asset . _ref ) } }
214
+ borderRadius = "lg"
215
+ border = "solid 1px"
216
+ borderColor = "gray.300"
217
+ sx = { {
218
+ aspectRatio : getAspectRatio ( props . node . asset . _ref ) ,
219
+ } }
215
220
/>
216
221
) ;
217
222
} ,
You can’t perform that action at this time.
0 commit comments