manually manage filter and sort storage

This commit is contained in:
2022-07-10 16:11:07 -07:00
parent 8e62eca18a
commit 8ac3dd27dd
5 changed files with 69 additions and 55 deletions

View File

@@ -21,26 +21,6 @@ const MasonryGallery = ({
const { breakpoint } = useBreakpoint(breakpoints, "sm");
const scrollIntoView = React.useCallback(() => {
if (!window.location.hash) {
return;
}
const el = document.getElementById(window.location.hash.split("#")[1]);
if (!el) {
return;
}
el.scrollIntoView({
block: "center",
});
}, []);
React.useEffect(() => {
// hacky but it works for now
setTimeout(() => {
scrollIntoView();
}, 100);
}, [scrollIntoView]);
const aspectRatios = React.useMemo(
() => R.map(getAspectRatio, images),
[images]