diff --git a/src/app/story/[storylineId]/[plotIndex]/page.tsx b/src/app/story/[storylineId]/[plotIndex]/page.tsx index 3a48291e..127d0f5e 100644 --- a/src/app/story/[storylineId]/[plotIndex]/page.tsx +++ b/src/app/story/[storylineId]/[plotIndex]/page.tsx @@ -130,6 +130,7 @@ export default async function PlotDetailPage({ params }: { params: Params }) { storylineTitle={sl.title} chapters={deduplicateByPlotIndex(allPlots)} initialPlotIndex={pidx} + contentType={sl.content_type} />
@@ -153,7 +154,7 @@ export default async function PlotDetailPage({ params }: { params: Params }) { {/* Plot content */} {p.content ? ( - + ) : (

Content unavailable (CID: {p.content_cid}) diff --git a/src/app/story/[storylineId]/page.tsx b/src/app/story/[storylineId]/page.tsx index f223445b..633c96c7 100644 --- a/src/app/story/[storylineId]/page.tsx +++ b/src/app/story/[storylineId]/page.tsx @@ -202,12 +202,14 @@ export default async function StoryPage({ params }: { params: Params }) { <> } /> @@ -448,7 +450,7 @@ function StoryHeader({ ); } -function GenesisSection({ plot, readingMode }: { plot: Plot; readingMode?: React.ReactNode }) { +function GenesisSection({ plot, contentType, readingMode }: { plot: Plot; contentType?: string; readingMode?: React.ReactNode }) { return (

@@ -466,7 +468,7 @@ function GenesisSection({ plot, readingMode }: { plot: Plot; readingMode?: React {readingMode && {readingMode}}
{plot.content ? ( - + ) : (

Content unavailable (CID: {plot.content_cid}) diff --git a/src/components/ReadingMode.tsx b/src/components/ReadingMode.tsx index be7cfcff..e4b2e5ea 100644 --- a/src/components/ReadingMode.tsx +++ b/src/components/ReadingMode.tsx @@ -15,6 +15,7 @@ interface ReadingModeProps { storylineTitle: string; chapters: Chapter[]; initialChapterIndex: number; + contentType?: string; onClose: () => void; } @@ -54,6 +55,7 @@ export function ReadingMode({ storylineTitle, chapters, initialChapterIndex, + contentType, onClose, }: ReadingModeProps) { const [currentIdx, setCurrentIdx] = useState(initialChapterIndex); @@ -259,7 +261,7 @@ export function ReadingMode({

{chapter?.content ? ( - + ) : (

Content unavailable

)} @@ -281,7 +283,7 @@ export function ReadingMode({
{outgoingChapter.content ? ( - + ) : (

Content unavailable

)} diff --git a/src/components/ReadingModeWrapper.tsx b/src/components/ReadingModeWrapper.tsx index f115d479..e604015a 100644 --- a/src/components/ReadingModeWrapper.tsx +++ b/src/components/ReadingModeWrapper.tsx @@ -18,11 +18,13 @@ export function ReadingModeWrapper({ storylineTitle, chapters, initialPlotIndex, + contentType, }: { storylineId: number; storylineTitle: string; chapters: Chapter[]; initialPlotIndex: number; + contentType?: string; }) { const [active, setActive] = useState(false); @@ -39,6 +41,7 @@ export function ReadingModeWrapper({ storylineTitle={storylineTitle} chapters={chapters} initialChapterIndex={initialIdx >= 0 ? initialIdx : 0} + contentType={contentType} onClose={() => setActive(false)} /> )} diff --git a/src/components/StoryContent.tsx b/src/components/StoryContent.tsx index 2b2e7dea..297a98f1 100644 --- a/src/components/StoryContent.tsx +++ b/src/components/StoryContent.tsx @@ -35,7 +35,38 @@ const sanitizeSchema = { }, }; -export function StoryContent({ content }: { content: string }) { +export function StoryContent({ content, contentType }: { content: string; contentType?: string }) { + if (contentType === "cartoon") { + return ( +
+ ( + // eslint-disable-next-line @next/next/no-img-element + {alt + ), + p: ({ children }) => ( +
{children}
+ ), + hr: () =>
, + strong: ({ children }) => ( +

{children}

+ ), + }} + > + {content} + +
+ ); + } + return (