don't store sort in URL, and use splat route to catch 404s when user goes directly to page

This commit is contained in:
Chuck Dries 2022-07-10 15:34:26 -07:00
parent 01d2452b12
commit 8e62eca18a
No known key found for this signature in database
GPG Key ID: A00B7AEAE1DC5BE6

View File

@ -5,9 +5,10 @@ import { navigate } from "gatsby";
import { Helmet } from "react-helmet";
import { Picker, Item } from "@adobe/react-spectrum";
import MasonryGallery from "../components/MasonryGallery";
import KeywordsPicker from "../components/KeywordsPicker";
import MasonryGallery from "../../components/MasonryGallery";
import KeywordsPicker from "../../components/KeywordsPicker";
import { useQueryParamString } from "react-use-query-param-string";
import { useState } from "react";
const SORT_KEYS = {
hue: ["fields", "imageMeta", "vibrantHue"],
@ -18,8 +19,8 @@ const SORT_KEYS = {
const GalleryPage = ({ data }) => {
const [keyword, _setKeyword] = useQueryParamString("filter", null);
const [sortKey, _setSortKey] = useQueryParamString("sort", "rating");
const [showDebug, _setShowDebug] = useQueryParamString("debug", false);
const [sortKey, _setSortKey] = useState("rating");
const setKeyword = React.useCallback(
(keyword) => {