fix gallery image autoscroll, hide hashes on recently published section (and plumb linkstate)
This commit is contained in:
parent
c574a31ba2
commit
5df63bf44a
@ -37,7 +37,6 @@ export const shouldUpdateScroll = ({
|
|||||||
// window.scrollTo(0, 180);
|
// window.scrollTo(0, 180);
|
||||||
// })
|
// })
|
||||||
// }
|
// }
|
||||||
console.log('gallery image, skipping')
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if (prevRouterProps?.location.pathname === pathname) {
|
if (prevRouterProps?.location.pathname === pathname) {
|
||||||
|
@ -64,12 +64,12 @@ const GalleryImage = ({ data, location: { state } }) => {
|
|||||||
}, []);
|
}, []);
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
requestAnimationFrame(() => {
|
setTimeout(() => {
|
||||||
window.scrollTo({
|
window.scrollTo({
|
||||||
top: 180,
|
top: 180,
|
||||||
behavior: 'smooth'
|
behavior: 'smooth'
|
||||||
});
|
});
|
||||||
});
|
}, 50);
|
||||||
}, [image.base]);
|
}, [image.base]);
|
||||||
|
|
||||||
const nextIndex =
|
const nextIndex =
|
||||||
|
@ -138,8 +138,8 @@ const MasonryGallery = ({
|
|||||||
const data = dataFn ? dataFn(image) : null;
|
const data = dataFn ? dataFn(image) : null;
|
||||||
return (
|
return (
|
||||||
<Link
|
<Link
|
||||||
className={classNames("border-8 border-white overflow-hidden relative")}
|
className="border-8 border-white overflow-hidden relative"
|
||||||
id={image.base}
|
id={singleRow ? undefined : image.base}
|
||||||
key={`${image.base}`}
|
key={`${image.base}`}
|
||||||
state={{
|
state={{
|
||||||
...linkState,
|
...linkState,
|
||||||
|
@ -264,6 +264,10 @@ const GalleryPage = ({
|
|||||||
"3xl": 8,
|
"3xl": 8,
|
||||||
}}
|
}}
|
||||||
images={recents}
|
images={recents}
|
||||||
|
linkState={{
|
||||||
|
sortKey: 'datePublished',
|
||||||
|
filterKeyword,
|
||||||
|
}}
|
||||||
singleRow
|
singleRow
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user