Skip to content

Commit

Permalink
Updated libraries and reverted image gallery urls
Browse files Browse the repository at this point in the history
  • Loading branch information
pookmish committed Dec 11, 2024
1 parent 7d1d6c0 commit bb3aa7a
Show file tree
Hide file tree
Showing 5 changed files with 240 additions and 233 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,12 @@ export const dynamic = "force-static"
export const maxDuration = 60

type Props = {
params: Promise<{uuid: string}>
params: Promise<{uuid: string[]}>
}

const Page = async (props: Props) => {
const params = await props.params
const [paragraphId, mediaUuid] = decodeURIComponent(params.uuid).split(":")
const [paragraphId, mediaUuid] = params.uuid

const paragraphQuery = await graphqlClient().Paragraph({uuid: paragraphId})
if (paragraphQuery.paragraph?.__typename !== "ParagraphStanfordGallery") notFound()
Expand Down Expand Up @@ -64,7 +64,7 @@ const Page = async (props: Props) => {
<li className="mr-auto">
<Link
className="text-white no-underline hocus:text-white hocus:underline"
href={`/gallery/${paragraph.id}:${paragraph.suGalleryImages?.[prevImageIndex].id}`}
href={`/gallery/${paragraph.id}/${paragraph.suGalleryImages?.[prevImageIndex].id}`}
replace={true}
scroll={false}
>
Expand All @@ -76,7 +76,7 @@ const Page = async (props: Props) => {
<li className="ml-auto">
<Link
className="text-white no-underline hocus:text-white hocus:underline"
href={`/gallery/${paragraph.id}:${paragraph.suGalleryImages?.[nextImageIndex].id}`}
href={`/gallery/${paragraph.id}/${paragraph.suGalleryImages?.[nextImageIndex].id}`}
replace={true}
scroll={false}
>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,12 @@ export const metadata = {
}

type Props = {
params: Promise<{uuid: string}>
params: Promise<{uuid: string[]}>
}

const Page = async (props: Props) => {
const params = await props.params
const [paragraphId, mediaUuid] = decodeURIComponent(params.uuid).split(":")
const [paragraphId, mediaUuid] = params.uuid

const paragraphQuery = await graphqlClient().Paragraph({uuid: paragraphId})
if (paragraphQuery.paragraph?.__typename !== "ParagraphStanfordGallery") notFound()
Expand Down
18 changes: 9 additions & 9 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,13 @@
},
"dependencies": {
"@heroicons/react": "^2.2.0",
"@mui/base": "5.0.0-beta.64",
"@next/third-parties": "15.0.4",
"@mui/base": "5.0.0-beta.66",
"@next/third-parties": "15.1.0",
"@tailwindcss/container-queries": "^0.1.1",
"@types/node": "22.10.1",
"@types/node": "22.10.2",
"@types/react": "19.0.1",
"@types/react-dom": "19.0.1",
"algoliasearch": "^5.16.0",
"@types/react-dom": "19.0.2",
"algoliasearch": "^5.17.0",
"autoprefixer": "^10.4.20",
"clsx": "^2.1.1",
"decanter": "^7.3.0",
Expand All @@ -31,15 +31,15 @@
"graphql-tag": "^2.12.6",
"html-entities": "^2.5.2",
"html-react-parser": "^5.2.0",
"next": "15.0.4",
"next": "15.1.0",
"plaiceholder": "^3.0.0",
"postcss": "^8.4.49",
"qs": "^6.13.1",
"react": "19.0.0",
"react-dom": "19.0.0",
"react-focus-lock": "^2.13.2",
"react-instantsearch": "^7.13.9",
"react-instantsearch-nextjs": "^0.3.19",
"react-instantsearch-nextjs": "^0.3.20",
"react-slick": "^0.30.2",
"react-super-responsive-table": "^6.0.0",
"react-tiny-oembed": "^1.1.0",
Expand All @@ -57,7 +57,7 @@
"@graphql-codegen/import-types-preset": "^3.0.0",
"@graphql-codegen/typescript-graphql-request": "^6.2.0",
"@graphql-codegen/typescript-operations": "^4.4.0",
"@next/bundle-analyzer": "15.0.4",
"@next/bundle-analyzer": "15.1.0",
"@storybook/addon-essentials": "^8.4.7",
"@storybook/addon-interactions": "^8.4.7",
"@storybook/addon-links": "^8.4.7",
Expand All @@ -70,7 +70,7 @@
"concurrently": "^9.1.0",
"encoding": "^0.1.13",
"eslint": "^9.16.0",
"eslint-config-next": "15.0.4",
"eslint-config-next": "15.1.0",
"eslint-config-prettier": "^9.1.0",
"eslint-plugin-prettier": "^5.2.1",
"eslint-plugin-storybook": "^0.11.1",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ const GalleryImage = ({
<figure>
<div className="relative aspect-[4/3] w-full">
<Link
href={`/gallery/${galleryId}:${image.id}`}
href={`/gallery/${galleryId}/${image.id}`}
className="relative block h-full w-full"
rel="nofollow"
scroll={false}
Expand Down
Loading

0 comments on commit bb3aa7a

Please sign in to comment.