From 1e39b1101257d42f5e00ec8e082b50414e09aba7 Mon Sep 17 00:00:00 2001 From: Erik Vattekar Date: Wed, 29 Nov 2023 14:01:08 +0100 Subject: [PATCH] run Starting with Next.js 13, renders as , so attempting to use as a child is invalid. https://nextjs.org/docs/messages/invalid-new-link-with-extra-anchor --- components/search/searchResultLink.tsx | 2 +- components/stories/story.tsx | 151 ++++++++++++------------- pages/index.tsx | 42 +++---- 3 files changed, 99 insertions(+), 96 deletions(-) diff --git a/components/search/searchResultLink.tsx b/components/search/searchResultLink.tsx index e50bcf8c..ff4f3091 100644 --- a/components/search/searchResultLink.tsx +++ b/components/search/searchResultLink.tsx @@ -171,7 +171,7 @@ export const SearchResultLink = ({ - ) + ); } export default SearchResultLink diff --git a/components/stories/story.tsx b/components/stories/story.tsx index 23241ceb..4212c245 100644 --- a/components/stories/story.tsx +++ b/components/stories/story.tsx @@ -31,86 +31,85 @@ export function Story({ const Plotly = dynamic(() => import("./plotly")); return ( -
-
- - {!draft && isOwner && ( -
- - Endre - - setShowToken && setShowToken(true)}>Vis token - setShowDelete && setShowDelete(true)} - > - Slett - -
- )} - +
+
+ + {!draft && isOwner && ( + + )} + - -
-
-
- {views.map((view, id) => { - if (view.__typename === 'StoryViewHeader') { - return
- } + +
+
+
+ {views.map((view, id) => { + if (view.__typename === 'StoryViewHeader') { + return
+ } - if (view.__typename === 'StoryViewMarkdown') { - return ( - - {view.content} - - ) - } - if (view.__typename === 'StoryViewPlotly') { - return ( - - {({ inView, ref }) => { - return inView ? ( -
- -
- ) : ( -
- -
- ) - }} -
- ) - } - if (view.__typename === 'StoryViewVega') { - return ( - - {({ inView, ref }) => { - return inView ? ( -
- -
- ) : ( -
- -
- ) - }} -
- ) - } - })} -
+ if (view.__typename === 'StoryViewMarkdown') { + return ( + + {view.content} + + ) + } + if (view.__typename === 'StoryViewPlotly') { + return ( + + {({ inView, ref }) => { + return inView ? ( +
+ +
+ ) : ( +
+ +
+ ) + }} +
+ ) + } + if (view.__typename === 'StoryViewVega') { + return ( + + {({ inView, ref }) => { + return inView ? ( +
+ +
+ ) : ( +
+ +
+ ) + }} +
+ ) + } + })}
- ) +
+ ); } export default Story diff --git a/pages/index.tsx b/pages/index.tsx index 22203142..f6f8feeb 100644 --- a/pages/index.tsx +++ b/pages/index.tsx @@ -100,32 +100,36 @@ const LandingPage = () => { } /> - - -
-
- -
-

Fortellinger

+ + +
+
+
- -
+

Fortellinger

+
+ + - - -
- ) + ); } export const getServerSideProps: GetServerSideProps = async (context) => {