From e4b026a1bdb0d84faf4594a83a5a9b9c79a61943 Mon Sep 17 00:00:00 2001 From: vaporvee Date: Tue, 29 Oct 2024 21:04:19 +0100 Subject: [PATCH] fixed dep issues --- package.json | 6 +++--- src/app/[slug]/page.tsx | 7 +++---- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/package.json b/package.json index d9b6eb9..8594cdf 100644 --- a/package.json +++ b/package.json @@ -17,11 +17,11 @@ "next": "15.0.1", "next-sanity": "^9.8.8", "next-themes": "^0.3.0", - "react": "19.0.0-rc-69d4b800-20241021", - "react-dom": "19.0.0-rc-69d4b800-20241021", + "react": "^18.3.1", + "react-dom": "^18.3.1", "react-error-boundary": "^4.1.2", "react-refractor": "^3.1.1", - "sanity": "^3.62.2", + "sanity": "^3.62.3", "sass": "^1.80.4", "sonner": "^1.5.0", "styled-components": "^6.1.13", diff --git a/src/app/[slug]/page.tsx b/src/app/[slug]/page.tsx index f7579a4..5d99697 100644 --- a/src/app/[slug]/page.tsx +++ b/src/app/[slug]/page.tsx @@ -8,7 +8,6 @@ import { Post, SanityImageAsset } from "@/sanity/sanity.types"; import urlBuilder from "@sanity/image-url"; import {getImageDimensions} from '@sanity/asset-utils' import { Refractor } from 'react-refractor' -import js from 'refractor/lang/javascript' const POST_QUERY = defineQuery(`*[_type == "post" && slug.current == $slug][0]`); const POSTS_QUERY = defineQuery(`*[_type == "post"]{slug}`) @@ -43,10 +42,10 @@ export default async function PostPage(props: { params: PageParams }) { const postImageUrl = post.mainImage ? urlFor(post.mainImage)?.width(550).height(310).url() : null; - function Code(props: {language: string, code: string, highlightedLines: number[]}) { + function Code(props: {language: string | undefined, code: string, highlightedLines: number[]}) { return ( @@ -94,7 +93,7 @@ export default async function PostPage(props: { params: PageParams }) {

{post.title}

Published: {new Date(post.publishedAt ?? "").toISOString().substring(0, 10)}

- {Code({language: post.myCodeField?.language ?? "", code: post.myCodeField?.code ?? "", highlightedLines: post.myCodeField?.highlightedLines ?? []})} + {Code({language: post.myCodeField?.language, code: post.myCodeField?.code ?? "", highlightedLines: post.myCodeField?.highlightedLines ?? []})} {Array.isArray(post.body) && }