File tree Expand file tree Collapse file tree 1 file changed +18
-14
lines changed
src/components/dataDisplay/postEmbed Expand file tree Collapse file tree 1 file changed +18
-14
lines changed Original file line number Diff line number Diff line change @@ -18,7 +18,7 @@ export default function ImageEmbed(props: Props) {
18
18
19
19
const generateImageLayout = (
20
20
count : number ,
21
- images : AppBskyEmbedImages . ViewImage [ ]
21
+ images : AppBskyEmbedImages . ViewImage [ ] ,
22
22
) => {
23
23
// adjust image grid layout based on number of images
24
24
switch ( count ) {
@@ -129,19 +129,23 @@ export default function ImageEmbed(props: Props) {
129
129
default :
130
130
return (
131
131
< div className = "relative" >
132
- < Image
133
- src = { images [ 0 ] . thumb }
134
- alt = { images [ 0 ] . alt }
135
- width = { images [ 0 ] . aspectRatio ?. width ?? 900 }
136
- height = { images [ 0 ] . aspectRatio ?. height ?? 900 }
137
- priority
138
- className = "rounded-md max-h-96 w-full object-cover cursor-pointer hover:brightness-90"
139
- onClick = { ( e ) => {
140
- e . stopPropagation ( ) ;
141
- setShowImage ( 0 ) ;
142
- } }
143
- />
144
- { images [ 0 ] . alt && < AltTag text = { images [ 0 ] . alt } /> }
132
+ { images [ 0 ] && (
133
+ < >
134
+ < Image
135
+ src = { images [ 0 ] . thumb }
136
+ alt = { images [ 0 ] . alt }
137
+ width = { images [ 0 ] . aspectRatio ?. width ?? 900 }
138
+ height = { images [ 0 ] . aspectRatio ?. height ?? 900 }
139
+ priority
140
+ className = "rounded-md max-h-96 w-full object-cover cursor-pointer hover:brightness-90"
141
+ onClick = { ( e ) => {
142
+ e . stopPropagation ( ) ;
143
+ setShowImage ( 0 ) ;
144
+ } }
145
+ />
146
+ { images [ 0 ] . alt && < AltTag text = { images [ 0 ] . alt } /> }
147
+ </ >
148
+ ) }
145
149
</ div >
146
150
) ;
147
151
}
You can’t perform that action at this time.
0 commit comments