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);
|
||||
// })
|
||||
// }
|
||||
console.log('gallery image, skipping')
|
||||
return false;
|
||||
}
|
||||
if (prevRouterProps?.location.pathname === pathname) {
|
||||
|
@ -64,12 +64,12 @@ const GalleryImage = ({ data, location: { state } }) => {
|
||||
}, []);
|
||||
|
||||
useEffect(() => {
|
||||
requestAnimationFrame(() => {
|
||||
setTimeout(() => {
|
||||
window.scrollTo({
|
||||
top: 180,
|
||||
behavior: 'smooth'
|
||||
});
|
||||
});
|
||||
}, 50);
|
||||
}, [image.base]);
|
||||
|
||||
const nextIndex =
|
||||
|
@ -138,8 +138,8 @@ const MasonryGallery = ({
|
||||
const data = dataFn ? dataFn(image) : null;
|
||||
return (
|
||||
<Link
|
||||
className={classNames("border-8 border-white overflow-hidden relative")}
|
||||
id={image.base}
|
||||
className="border-8 border-white overflow-hidden relative"
|
||||
id={singleRow ? undefined : image.base}
|
||||
key={`${image.base}`}
|
||||
state={{
|
||||
...linkState,
|
||||
|
@ -264,6 +264,10 @@ const GalleryPage = ({
|
||||
"3xl": 8,
|
||||
}}
|
||||
images={recents}
|
||||
linkState={{
|
||||
sortKey: 'datePublished',
|
||||
filterKeyword,
|
||||
}}
|
||||
singleRow
|
||||
/>
|
||||
</div>
|
||||
|
Loading…
x
Reference in New Issue
Block a user