Compare commits
2 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 5857404ac1 | |||
| 34a96f8aef |
@@ -1,4 +1,7 @@
|
|||||||
import { RichText } from "@payloadcms/richtext-lexical/react";
|
import {
|
||||||
|
RichText,
|
||||||
|
defaultJSXConverters,
|
||||||
|
} from "@payloadcms/richtext-lexical/react";
|
||||||
import type { JSXConverters } from "@payloadcms/richtext-lexical/react";
|
import type { JSXConverters } from "@payloadcms/richtext-lexical/react";
|
||||||
import { MemeCard } from "@/src/components/MemeCard";
|
import { MemeCard } from "@/src/components/MemeCard";
|
||||||
import { Mermaid } from "@/src/components/Mermaid";
|
import { Mermaid } from "@/src/components/Mermaid";
|
||||||
@@ -40,6 +43,7 @@ function renderInlineMarkdown(text: string): React.ReactNode {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const jsxConverters: JSXConverters = {
|
const jsxConverters: JSXConverters = {
|
||||||
|
...defaultJSXConverters,
|
||||||
blocks: {
|
blocks: {
|
||||||
memeCard: ({ node }: any) => (
|
memeCard: ({ node }: any) => (
|
||||||
<div className="my-8">
|
<div className="my-8">
|
||||||
@@ -179,12 +183,22 @@ const jsxConverters: JSXConverters = {
|
|||||||
),
|
),
|
||||||
iconList: ({ node }: any) => (
|
iconList: ({ node }: any) => (
|
||||||
<mdxComponents.IconList>
|
<mdxComponents.IconList>
|
||||||
{node.fields.items?.map((item: any, i: number) => (
|
{node.fields.items?.map((item: any, i: number) => {
|
||||||
// @ts-ignore
|
const isCheck = item.icon === "check" || !item.icon;
|
||||||
<mdxComponents.IconListItem key={i} icon={item.icon || "check"}>
|
const isCross = item.icon === "x" || item.icon === "cross";
|
||||||
{item.title || item.description}
|
const isBullet = item.icon === "circle" || item.icon === "bullet";
|
||||||
</mdxComponents.IconListItem>
|
return (
|
||||||
))}
|
// @ts-ignore
|
||||||
|
<mdxComponents.IconListItem
|
||||||
|
key={i}
|
||||||
|
check={isCheck}
|
||||||
|
cross={isCross}
|
||||||
|
bullet={isBullet}
|
||||||
|
>
|
||||||
|
{item.title || item.description}
|
||||||
|
</mdxComponents.IconListItem>
|
||||||
|
);
|
||||||
|
})}
|
||||||
</mdxComponents.IconList>
|
</mdxComponents.IconList>
|
||||||
),
|
),
|
||||||
statsGrid: ({ node }: any) => {
|
statsGrid: ({ node }: any) => {
|
||||||
|
|||||||
Reference in New Issue
Block a user