| ... | ... | @@ -180,7 +180,7 @@ export const ExpandedImageDialog = memo(function ExpandedImageDialog({ |
| 180 | 180 | variant="media" |
| 181 | 181 | showCloseButton={false} |
| 182 | 182 | bottomStickOnMobile={false} |
| 183 | | className="row-start-1 max-h-[92vh] w-[92vw] max-w-[92vw] items-center overflow-visible [--media-width:92vw] [--media-height:min(86vh,calc(100vh-160px))] sm:[--media-width:calc(92vw-96px)]" |
| 183 | className="row-start-1 h-full max-h-[92vh] w-[92vw] max-w-[92vw] items-center justify-center overflow-visible [--media-width:92vw] [--media-height:min(86vh,calc(100vh-160px))] sm:[--media-width:calc(92vw-96px)]" |
| 184 | 184 | onKeyDown={onKeyDown} |
| 185 | 185 | initialFocus={closeButtonRef} |
| 186 | 186 | finalFocus={() => returnFocusTarget} |
| ... | ... | @@ -189,12 +189,24 @@ export const ExpandedImageDialog = memo(function ExpandedImageDialog({ |
| 189 | 189 | }} |
| 190 | 190 | > |
| 191 | 191 | <DialogTitle className="sr-only">Expanded {mediaLabel} preview</DialogTitle> |
| 192 | {/* The stage keeps a fixed size, so the close button stays put whatever the media or caption. */} |
| 193 | <Button |
| 194 | type="button" |
| 195 | ref={closeButtonRef} |
| 196 | size="icon-sm" |
| 197 | variant="media-close" |
| 198 | className="absolute right-0 top-0 z-20" |
| 199 | onClick={onClose} |
| 200 | aria-label={`Close ${mediaLabel} preview`} |
| 201 | > |
| 202 | <XIcon /> |
| 203 | </Button> |
| 192 | 204 | {preview.images.length > 1 && ( |
| 193 | 205 | <Button |
| 194 | 206 | type="button" |
| 195 | 207 | size="icon" |
| 196 | 208 | variant="media-navigation" |
| 197 | | className="left-0 top-auto -bottom-12 translate-y-0 sm:top-1/2 sm:bottom-auto sm:-translate-y-1/2" |
| 209 | className="left-0 top-auto bottom-0 translate-y-0 sm:top-1/2 sm:bottom-auto sm:-translate-y-1/2" |
| 198 | 210 | aria-label="Previous media" |
| 199 | 211 | onClick={() => navigateImage(-1)} |
| 200 | 212 | > |
| ... | ... | @@ -202,18 +214,7 @@ export const ExpandedImageDialog = memo(function ExpandedImageDialog({ |
| 202 | 214 | </Button> |
| 203 | 215 | )} |
| 204 | 216 | <MediaActions source={actionsSource}> |
| 205 | | <div className="relative isolate z-10 max-h-[92vh] max-w-[var(--media-width)]"> |
| 206 | | <Button |
| 207 | | type="button" |
| 208 | | ref={closeButtonRef} |
| 209 | | size="icon-xs" |
| 210 | | variant="media-close" |
| 211 | | className="absolute right-0 -top-10 z-20" |
| 212 | | onClick={onClose} |
| 213 | | aria-label={`Close ${mediaLabel} preview`} |
| 214 | | > |
| 215 | | <XIcon /> |
| 216 | | </Button> |
| 217 | <div className="relative isolate z-10 flex max-h-full max-w-[var(--media-width)] flex-col items-center"> |
| 217 | 218 | {item.type === "video" ? ( |
| 218 | 219 | <ExpandedVideo key={index} item={item} /> |
| 219 | 220 | ) : showingAccessibilityDetails ? ( |
| ... | ... | @@ -241,7 +242,7 @@ export const ExpandedImageDialog = memo(function ExpandedImageDialog({ |
| 241 | 242 | onError={() => setFailedImageSrc(item.src)} |
| 242 | 243 | /> |
| 243 | 244 | )} |
| 244 | | <div className="mt-2 flex max-w-[var(--media-width)] items-center justify-center gap-1.5 text-xs text-white/80"> |
| 245 | <div className="mt-2 flex max-w-[var(--media-width)] items-center justify-center gap-1.5 text-xs text-white/80 max-sm:px-10"> |
| 245 | 246 | <span className="truncate" aria-live="polite" aria-atomic="true"> |
| 246 | 247 | {item.name} |
| 247 | 248 | {preview.images.length > 1 ? ` (${index + 1}/${preview.images.length})` : ""} |
| ... | ... | @@ -280,7 +281,7 @@ export const ExpandedImageDialog = memo(function ExpandedImageDialog({ |
| 280 | 281 | type="button" |
| 281 | 282 | size="icon" |
| 282 | 283 | variant="media-navigation" |
| 283 | | className="right-0 top-auto -bottom-12 translate-y-0 sm:top-1/2 sm:bottom-auto sm:-translate-y-1/2" |
| 284 | className="right-0 top-auto bottom-0 translate-y-0 sm:top-1/2 sm:bottom-auto sm:-translate-y-1/2" |
| 284 | 285 | aria-label="Next media" |
| 285 | 286 | onClick={() => navigateImage(1)} |
| 286 | 287 | > |