+ {next(node.children, embeds, fullRenderOptions)} +
+ ) + }, + [RTETypeEnum.a]: ( + node: RTERegularNode, + embeds: EmbedByUid, + next: RTENext, + fullRenderOptions: RenderOptions + ) => { + if (node.attrs.url) { + return ( + + {next(node.children, embeds, fullRenderOptions)} + + ) + } + return null + }, + [RTETypeEnum.reference]: ( + node: RTENode, + embeds: EmbedByUid, + next: RTENext, + fullRenderOptions: RenderOptions + ) => { + if ("attrs" in node) { + const type = node.attrs.type + if (type !== RTEItemTypeEnum.asset) { + const href = node.attrs?.locale + ? `/${node.attrs.locale}${node.attrs.href}` + : node.attrs.href + return ( + + {next(node.children, embeds, fullRenderOptions)} + + ) + } + + return null + } + }, +} diff --git a/components/Content/Blocks/TextCols/textcols.module.css b/components/Content/Blocks/TextCols/textcols.module.css new file mode 100644 index 000000000..b3e9e2824 --- /dev/null +++ b/components/Content/Blocks/TextCols/textcols.module.css @@ -0,0 +1,40 @@ +.columns { + display: flex; + flex-direction: column; + gap: var(--Spacing-x3); + padding: var(--Spacing-x3) var(--Spacing-x4); +} + +.column { + padding-bottom: var(--Spacing-x2); + border-bottom: 1px solid var(--Base-Border-Subtle); + gap: var(--Spacing-x1); + display: flex; + flex-direction: column; +} + +.p { + color: var(--UI-Text-High-contrast); + line-height: var(--Spacing-x3); + margin: 0; +} + +.a { + color: var(--Base-Text-High-contrast); +} + +.text > section { + gap: 0; +} + +@media (min-width: 768px) { + .columns { + flex-direction: row; + flex-wrap: wrap; + } + + .column { + flex: 0 0 calc(50% - var(--Spacing-x3)); + max-width: calc(50% - var(--Spacing-x3)); + } +} diff --git a/components/Content/Blocks/index.tsx b/components/Content/Blocks/index.tsx index 9c396ed11..77dabdfd1 100644 --- a/components/Content/Blocks/index.tsx +++ b/components/Content/Blocks/index.tsx @@ -3,6 +3,7 @@ import JsonToHtml from "@/components/JsonToHtml" import Shortcuts from "@/components/MyPages/Blocks/Shortcuts" import CardsGrid from "./CardsGrid" +import TextCols from "./TextCols" import type { BlocksProps } from "@/types/components/content/blocks" import { ContentBlocksTypenameEnum } from "@/types/components/content/enums" @@ -38,6 +39,8 @@ export function Blocks({ blocks }: BlocksProps) { firstItem={firstItem} /> ) + case ContentBlocksTypenameEnum.ContentPageBlocksTextCols: + return