- {hasTitle && (showTitleAsH1
- ?
{renderPhotoLink}
- : renderPhotoLink)}
-
+
+
+ {hasTitle && (showTitleAsH1
+ ?
{renderPhotoLink}
+ : renderPhotoLink)}
{photo.caption &&
{
+
+ const linkProps:
+ Omit
, 'children'> |
+ undefined = photo
+ ? {
+ className,
+ href: pathForPhoto({ photo, ...categories }),
+ onClick: () => {
if (nextPhotoAnimation) {
setNextPhotoAnimation?.(nextPhotoAnimation);
}
- }}
- className={className}
- scroll={scroll}
- >
- {children ?? titleForPhoto(photo)}
-
+ },
+ scroll,
+ prefetch,
+ }
+ : undefined;
+
+ const children = photo
+ ? (_children ?? titleForPhoto(photo))
+ : _children;
+
+ return (
+ photo && linkProps
+ ? loaderType === 'spinner'
+ ?
+ {({ isLoading }) => <>
+ {children}
+ {isLoading && <>
+
+ >}
+ >}
+
+ :
+ {children}
+
:
- {children ?? (photo ? titleForPhoto(photo) : undefined)}
+ {children}
);
};
diff --git a/src/photo/PhotoPrevNext.tsx b/src/photo/PhotoPrevNext.tsx
index 861c4d8c..4ac73b50 100644
--- a/src/photo/PhotoPrevNext.tsx
+++ b/src/photo/PhotoPrevNext.tsx
@@ -85,21 +85,21 @@ export default function PhotoPrevNext({
className,
)}>
-
+
PREV
@@ -108,14 +108,12 @@ export default function PhotoPrevNext({
-
+
NEXT