From 915403b6c4f8e42e5c7dfbca83c32d6734b52c9d Mon Sep 17 00:00:00 2001 From: Chloe Date: Sun, 7 Jul 2024 11:22:44 +0700 Subject: [PATCH] rich text display fix list display Signed-off-by: Chloe --- components/page/rich-text-display.tsx | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/components/page/rich-text-display.tsx b/components/page/rich-text-display.tsx index e7c2dcb5a..a66b2e407 100644 --- a/components/page/rich-text-display.tsx +++ b/components/page/rich-text-display.tsx @@ -1,3 +1,5 @@ +import clsx from 'clsx'; + type Text = { type: 'text'; value: string; @@ -9,7 +11,7 @@ type Content = | Text | { type: 'list'; - listType: 'bullet' | 'ordered'; + listType: 'bullet' | 'ordered' | 'unordered'; children: Array<{ type: 'listItem'; children: Text[] }>; } | { type: 'listItem'; children: Text[] }; @@ -27,9 +29,14 @@ const RichTextBlock = ({ block }: { block: Content }) => { return block.children.map((child, index) => ); } - if (block.type === 'list' && block.listType === 'ordered') { + if (block.type === 'list') { return ( -
    +
      {block.children.map((child, index) => (