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()
1616 . dpr ( window . devicePixelRatio ?? 1 )
1717 . quality ( defaultQuality ) ;
1818
19- export const getAspectRatio = ( imageRef : string ) : number | undefined => {
19+ export const getAspectRatio = ( imageRef : string ) : string | undefined => {
2020 const dimensionsArr = imageRef . match ( / \d + x \d + / g) ;
2121 if ( ! dimensionsArr ) {
2222 return undefined ;
2323 }
2424 const dimensions = dimensionsArr . join ( ) . split ( "x" ) ;
2525 const [ width , height ] = dimensions . map ( ( n : string ) => Number ( n ) ) ;
26- return width / height ;
26+ return ( width / height ) . toString ( ) ;
2727} ;
Original file line number Diff line number Diff line change @@ -211,7 +211,12 @@ const serializers = {
211211 . url ( ) }
212212 alt = { props . node . alt }
213213 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+ } }
215220 />
216221 ) ;
217222 } ,
You can’t perform that action at this time.
0 commit comments