From 533a45eb99db61a88f3257855fc1facbf1b88a84 Mon Sep 17 00:00:00 2001 From: Mitchell Christ Date: Sun, 24 Nov 2024 13:59:17 -0800 Subject: [PATCH] use nuqs, add slug to blog.category --- package-lock.json | 35 +++++++++++++++++-- package.json | 3 +- src/app/(frontend)/layout.tsx | 20 ++++++----- src/sanity/schemas/documents/blog.category.ts | 9 +++++ src/types/Sanity.d.ts | 1 + .../modules/blog/BlogFrontpage/Paginated.tsx | 6 ++-- src/ui/modules/blog/BlogList/Filter.tsx | 12 +++---- src/ui/modules/blog/BlogList/FilterList.tsx | 6 +++- src/ui/modules/blog/BlogList/List.tsx | 14 +++----- src/ui/modules/blog/store.tsx | 21 +++++------ 10 files changed, 81 insertions(+), 46 deletions(-) diff --git a/package-lock.json b/package-lock.json index f0228f4a..3736bf8c 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "sanitypress", - "version": "5.1.10", + "version": "5.1.11", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "sanitypress", - "version": "5.1.10", + "version": "5.1.11", "license": "ISC", "dependencies": { "@next/third-parties": "^15.0.3", @@ -23,6 +23,7 @@ "next": "^15.0.3", "next-sanity": "^9.8.16", "next-sanity-image": "^6.1.1", + "nuqs": "^2.2.3", "octokit": "^4.0.2", "react": "^18", "react-device-detect": "^2.2.3", @@ -10943,6 +10944,11 @@ "readable-stream": "2 || 3" } }, + "node_modules/mitt": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/mitt/-/mitt-3.0.1.tgz", + "integrity": "sha512-vKivATfr97l2/QBCYAkXYDbrIWPM2IIKEl7YPhjCvKlG3kE2gm+uBo6nEXK3M5/Ffh/FLpKExzOQ3JJoJGFKBw==" + }, "node_modules/mkdirp": { "version": "3.0.1", "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-3.0.1.tgz", @@ -11234,6 +11240,31 @@ "url": "https://github.com/fb55/nth-check?sponsor=1" } }, + "node_modules/nuqs": { + "version": "2.2.3", + "resolved": "https://registry.npmjs.org/nuqs/-/nuqs-2.2.3.tgz", + "integrity": "sha512-nMCcUW06KSqEXA0xp+LiRqDpIE59BVYbjZLe0HUisJAlswfihHYSsAjYTzV0lcE1thfh8uh+LqUHGdQ8qq8rfA==", + "dependencies": { + "mitt": "^3.0.1" + }, + "peerDependencies": { + "@remix-run/react": ">=2", + "next": ">=14.2.0", + "react": ">=18.2.0 || ^19.0.0-0", + "react-router-dom": ">=6" + }, + "peerDependenciesMeta": { + "@remix-run/react": { + "optional": true + }, + "next": { + "optional": true + }, + "react-router-dom": { + "optional": true + } + } + }, "node_modules/object-assign": { "version": "4.1.1", "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", diff --git a/package.json b/package.json index 7cf6098d..69093473 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "sanitypress", - "version": "5.1.11", + "version": "5.1.12", "description": "A Next.js + Sanity.io Starter Template", "author": "nuotsu (https://nuotsu.dev)", "license": "ISC", @@ -27,6 +27,7 @@ "next": "^15.0.3", "next-sanity": "^9.8.16", "next-sanity-image": "^6.1.1", + "nuqs": "^2.2.3", "octokit": "^4.0.2", "react": "^18", "react-device-detect": "^2.2.3", diff --git a/src/app/(frontend)/layout.tsx b/src/app/(frontend)/layout.tsx index b101042a..7b101731 100644 --- a/src/app/(frontend)/layout.tsx +++ b/src/app/(frontend)/layout.tsx @@ -1,4 +1,5 @@ // import { GoogleTagManager } from '@next/third-parties/google' +import { NuqsAdapter } from 'nuqs/adapters/next/app' import SkipToContent from '@/ui/SkipToContent' import Announcement from '@/ui/Announcement' import Header from '@/ui/header' @@ -18,15 +19,18 @@ export default async function RootLayout({ {/* */} - - -
-
- {children} -
-