From ba6af14748ffda6fe71c253e29001579c5705af3 Mon Sep 17 00:00:00 2001 From: Simon Emanuelsson Date: Wed, 7 Feb 2024 11:57:36 +0100 Subject: [PATCH 1/7] feat: json rich text editor, blocks, asides, general structure --- components/JsonToHtml/Components/Strikethrough/index.tsx | 9 +++++++++ .../Components/Strikethrough/strike.module.css | 3 +++ 2 files changed, 12 insertions(+) create mode 100644 components/JsonToHtml/Components/Strikethrough/index.tsx create mode 100644 components/JsonToHtml/Components/Strikethrough/strike.module.css diff --git a/components/JsonToHtml/Components/Strikethrough/index.tsx b/components/JsonToHtml/Components/Strikethrough/index.tsx new file mode 100644 index 000000000..3d5fbb57c --- /dev/null +++ b/components/JsonToHtml/Components/Strikethrough/index.tsx @@ -0,0 +1,9 @@ +import styles from "./strike.module.css" + +export default function Strikethrough({ children }: React.PropsWithChildren) { + return ( + + {children} + + ) +} diff --git a/components/JsonToHtml/Components/Strikethrough/strike.module.css b/components/JsonToHtml/Components/Strikethrough/strike.module.css new file mode 100644 index 000000000..99f9b3476 --- /dev/null +++ b/components/JsonToHtml/Components/Strikethrough/strike.module.css @@ -0,0 +1,3 @@ +.strikethrough { + text-decoration: line-through; +} \ No newline at end of file From 9ed73457f8a11c2cabbd2f02af0acec876fa6670 Mon Sep 17 00:00:00 2001 From: Christel Westerberg Date: Mon, 12 Feb 2024 10:07:04 +0100 Subject: [PATCH 2/7] feat: add list block component --- components/Current/Blocks.tsx | 2 +- components/Current/Blocks/List.tsx | 7 -- components/Current/Blocks/List/index.tsx | 93 +++++++++++++++++++ .../Current/Blocks/List/list.module.css | 65 +++++++++++++ types/requests/blocks/list.ts | 79 ++++++++++------ 5 files changed, 211 insertions(+), 35 deletions(-) delete mode 100644 components/Current/Blocks/List.tsx create mode 100644 components/Current/Blocks/List/index.tsx create mode 100644 components/Current/Blocks/List/list.module.css diff --git a/components/Current/Blocks.tsx b/components/Current/Blocks.tsx index dc90c952f..04e138e43 100644 --- a/components/Current/Blocks.tsx +++ b/components/Current/Blocks.tsx @@ -16,7 +16,7 @@ export default function Blocks({ blocks }: BlocksProps) { const type = block.__typename switch (type) { case BlocksTypenameEnum.CurrentBlocksPageBlocksList: - return + return case BlocksTypenameEnum.CurrentBlocksPageBlocksPuffs: return case BlocksTypenameEnum.CurrentBlocksPageBlocksText: diff --git a/components/Current/Blocks/List.tsx b/components/Current/Blocks/List.tsx deleted file mode 100644 index 4cdb5ac56..000000000 --- a/components/Current/Blocks/List.tsx +++ /dev/null @@ -1,7 +0,0 @@ -export default function List() { - return ( - <> - - - ) -} diff --git a/components/Current/Blocks/List/index.tsx b/components/Current/Blocks/List/index.tsx new file mode 100644 index 000000000..7a236bc4d --- /dev/null +++ b/components/Current/Blocks/List/index.tsx @@ -0,0 +1,93 @@ +import { BlockListItemsEnum } from "@/types/requests/blocks/list" +import type { ListProps, ListItem } from "@/types/requests/blocks/list" + +import styles from "./list.module.css" +import Link from "next/link" + +export default function List({ listBlock }: ListProps) { + return ( +
+ {listBlock.list.title ? ( +

{listBlock.list.title}

+ ) : null} +
    + {listBlock.list.list_items.map((item, i) => ( + + ))} +
+
+ ) +} + +function ListItem({ listItem }: { listItem: ListItem }) { + const typeName = listItem.__typename + + switch (typeName) { + case BlockListItemsEnum.CurrentBlocksPageBlocksListBlockListItemsListItem: + return ( +
  • + {listItem.list_item.subtitle ? ( + <> + {listItem.list_item.title} +
    + {listItem.list_item.subtitle} + + ) : ( + listItem.list_item.title + )} +
  • + ) + case BlockListItemsEnum.CurrentBlocksPageBlocksListBlockListItemsListItemExternalLink: + return ( +
  • + + {listItem.list_item_external_link.link.title} + +
    + {listItem.list_item_external_link.subtitle} +
  • + ) + case BlockListItemsEnum.CurrentBlocksPageBlocksListBlockListItemsListItemInternalLink: + const links = listItem.list_item_internal_link.pageConnection.edges + return links.map((link, i) => ( +
  • + + {listItem.list_item_internal_link.link_text} + +
    + {listItem.list_item_internal_link.subtitle} +
  • + )) + + default: + return null + } +} diff --git a/components/Current/Blocks/List/list.module.css b/components/Current/Blocks/List/list.module.css new file mode 100644 index 000000000..be9aebcaf --- /dev/null +++ b/components/Current/Blocks/List/list.module.css @@ -0,0 +1,65 @@ +.title { + font-family: Helvetica, Arial, sans-serif; + font-weight: 400; + line-height: normal; + margin-top: 2rem; + margin-bottom: 1rem; + text-decoration: none; + text-transform: none; +} + +.ul { + margin-bottom: 15px; +} + +.listItem { + margin-bottom: 8px; + padding-left: 1.3em; +} + +.checkmark { + padding-left: 1.6em; +} + +.checkmark::before, .disc::before { + position:relative; + top: 4px; + display: inline-block; + height: 0px; + width: 0px; +} + +.checkmark::before { + content: url('/Static/img/bullet-list-tick-birch-v2.svg'); + transform: scale(.9); + left: -1.2em; +} + +.disc::before { + content: "•"; + color: rgb(157, 160, 161); + font-size: 26px; + left: -0.7em; +} + +.link { + border-bottom: 1px dotted #00838e; + color: #00838e; + text-decoration: none; + background-color: transparent; +} + +.link:active, .link:hover { + text-decoration: underline; + outline: 0; +} + +.link:hover { + border-bottom: none; +} + +@media screen and (min-width: 950px) { +.title { + font-size: 1.375rem; + } +} \ No newline at end of file diff --git a/types/requests/blocks/list.ts b/types/requests/blocks/list.ts index 05f74a200..c9d05cdd1 100644 --- a/types/requests/blocks/list.ts +++ b/types/requests/blocks/list.ts @@ -1,6 +1,7 @@ import type { Edges } from "../utils/edges" import type { ExternalLink } from "../utils/externalLink" import type { PageLink } from "../utils/pageLink" +import { Typename } from "../utils/typename" enum ListItemStyleEnum { checkmark = "checkmark", @@ -9,38 +10,62 @@ enum ListItemStyleEnum { type ListItemStyle = keyof typeof ListItemStyleEnum -type ExternalLinkListItem = { - list_item_external_link: { - link: { - href: string +export enum BlockListItemsEnum { + CurrentBlocksPageBlocksListBlockListItemsListItem = "CurrentBlocksPageBlocksListBlockListItemsListItem", + CurrentBlocksPageBlocksListBlockListItemsListItemExternalLink = "CurrentBlocksPageBlocksListBlockListItemsListItemExternalLink", + CurrentBlocksPageBlocksListBlockListItemsListItemInternalLink = "CurrentBlocksPageBlocksListBlockListItemsListItemInternalLink", +} + +type ExternalLinkListItem = Typename< + { + list_item_external_link: { + link: { + href: string + title: string + } + list_item_style: ListItemStyle + subtitle?: string + } + }, + BlockListItemsEnum.CurrentBlocksPageBlocksListBlockListItemsListItemExternalLink +> + +type InternalLinkListItem = Typename< + { + list_item_internal_link: { + link_text?: string + list_item_style: ListItemStyle + subtitle?: string + pageConnection: Edges + } + }, + BlockListItemsEnum.CurrentBlocksPageBlocksListBlockListItemsListItemInternalLink +> + +type RegularListItem = Typename< + { + list_item: { + list_item_style: ListItemStyle + subtitle?: string title: string } - list_item_style: ListItemStyle - subtitle?: string - } -} + }, + BlockListItemsEnum.CurrentBlocksPageBlocksListBlockListItemsListItem +> -type InternalLinkListItem = { - list_item_internal_link: { - link_text?: string - list_item_style: ListItemStyle - subtitle?: string - pageConnection: Edges - } -} - -type RegularListItem = { - list_item: { - list_item_style: ListItemStyle - subtitle?: string - title: string - } -} - -type ListItem = ExternalLinkListItem | InternalLinkListItem | RegularListItem +export type ListItem = + | ExternalLinkListItem + | InternalLinkListItem + | RegularListItem export type List = { list: { - list_items: ListItem + title?: string + list_items: ListItem[] } } + + +export type ListProps = { + listBlock: List +} From 1ba967224059052256d8c2d97ec960619dd36bd4 Mon Sep 17 00:00:00 2001 From: Christel Westerberg Date: Mon, 12 Feb 2024 13:20:32 +0100 Subject: [PATCH 3/7] fix: get locale from page connection --- components/Current/Blocks/List/index.tsx | 9 +++++---- lib/graphql/Fragments/PageLinks.graphql | 4 +++- types/requests/blocks/list.ts | 4 ++-- types/requests/embeds.ts | 7 ++----- types/requests/puff.ts | 4 ++-- types/requests/utils/pageLink.ts | 2 ++ .../requests/utils/{externalLink.ts => tempPageLink.ts} | 6 ++++-- 7 files changed, 20 insertions(+), 16 deletions(-) rename types/requests/utils/{externalLink.ts => tempPageLink.ts} (52%) diff --git a/components/Current/Blocks/List/index.tsx b/components/Current/Blocks/List/index.tsx index 7a236bc4d..af6629992 100644 --- a/components/Current/Blocks/List/index.tsx +++ b/components/Current/Blocks/List/index.tsx @@ -67,8 +67,9 @@ function ListItem({ listItem }: { listItem: ListItem }) { ) case BlockListItemsEnum.CurrentBlocksPageBlocksListBlockListItemsListItemInternalLink: - const links = listItem.list_item_internal_link.pageConnection.edges - return links.map((link, i) => ( + const link = listItem.list_item_internal_link.pageConnection.edges[0] + const linkUrlWithLocale= `/${link.node.system.locale}${link.node.url}` + return (
  • - + {listItem.list_item_internal_link.link_text}
    {listItem.list_item_internal_link.subtitle}
  • - )) + ) default: return null diff --git a/lib/graphql/Fragments/PageLinks.graphql b/lib/graphql/Fragments/PageLinks.graphql index aef03e93f..84d1bd89e 100644 --- a/lib/graphql/Fragments/PageLinks.graphql +++ b/lib/graphql/Fragments/PageLinks.graphql @@ -1,6 +1,7 @@ fragment CurrentBlocksPageLink on CurrentBlocksPage { system { uid + locale } title url @@ -9,7 +10,8 @@ fragment CurrentBlocksPageLink on CurrentBlocksPage { fragment TempPageLink on TempPage { system { uid + locale } title url -} +} \ No newline at end of file diff --git a/types/requests/blocks/list.ts b/types/requests/blocks/list.ts index c9d05cdd1..abc327c16 100644 --- a/types/requests/blocks/list.ts +++ b/types/requests/blocks/list.ts @@ -1,5 +1,5 @@ import type { Edges } from "../utils/edges" -import type { ExternalLink } from "../utils/externalLink" +import type { TempPageLink } from "../utils/tempPageLink" import type { PageLink } from "../utils/pageLink" import { Typename } from "../utils/typename" @@ -36,7 +36,7 @@ type InternalLinkListItem = Typename< link_text?: string list_item_style: ListItemStyle subtitle?: string - pageConnection: Edges + pageConnection: Edges } }, BlockListItemsEnum.CurrentBlocksPageBlocksListBlockListItemsListItemInternalLink diff --git a/types/requests/embeds.ts b/types/requests/embeds.ts index fab2414d8..140dab873 100644 --- a/types/requests/embeds.ts +++ b/types/requests/embeds.ts @@ -1,8 +1,5 @@ import type { SysAsset } from "./utils/asset" -import type { ExternalLinkType } from "./utils/externalLink" +import type { TempPageLinkType } from "./utils/tempPageLink" import type { PageLinkType } from "./utils/pageLink" -export type Embeds = - | ExternalLinkType - | PageLinkType - | SysAsset +export type Embeds = TempPageLinkType | PageLinkType | SysAsset diff --git a/types/requests/puff.ts b/types/requests/puff.ts index 820d09577..85cc77c6a 100644 --- a/types/requests/puff.ts +++ b/types/requests/puff.ts @@ -1,7 +1,7 @@ import type { Image } from "../image" import type { Edges } from "./utils/edges" import type { Embeds } from "./embeds" -import type { ExternalLink } from "./utils/externalLink" +import type { TempPageLink } from "./utils/tempPageLink" import type { PageLink } from "./utils/pageLink" import type { RTEDocument } from "../rte/node" @@ -13,7 +13,7 @@ export type Puff = { title: string } link_text?: string - pageConnection: Edges + pageConnection: Edges system: { uid: string } diff --git a/types/requests/utils/pageLink.ts b/types/requests/utils/pageLink.ts index 8555fe17d..810c40ae1 100644 --- a/types/requests/utils/pageLink.ts +++ b/types/requests/utils/pageLink.ts @@ -1,9 +1,11 @@ +import { Lang } from "@/types/lang" import type { EmbedEnum } from "./embeds" import type { Typename } from "./typename" export type PageLink = { system: { uid: string + locale: Lang } title: string url: string diff --git a/types/requests/utils/externalLink.ts b/types/requests/utils/tempPageLink.ts similarity index 52% rename from types/requests/utils/externalLink.ts rename to types/requests/utils/tempPageLink.ts index 71a10bc17..0230fa8be 100644 --- a/types/requests/utils/externalLink.ts +++ b/types/requests/utils/tempPageLink.ts @@ -1,12 +1,14 @@ +import { Lang } from "@/types/lang" import type { EmbedEnum } from "./embeds" import type { Typename } from "./typename" -export type ExternalLink = { +export type TempPageLink = { system: { uid: string + locale: Lang } title: string url: string } -export type ExternalLinkType = Typename +export type TempPageLinkType = Typename From 71eb7387cf32fe2c9fcc37c427364a2d5a959326 Mon Sep 17 00:00:00 2001 From: Christel Westerberg Date: Mon, 12 Feb 2024 13:23:09 +0100 Subject: [PATCH 4/7] fix: clean up typings --- components/Current/Blocks.tsx | 2 +- components/Current/Blocks/List/index.tsx | 8 +++----- types/requests/blocks/list.ts | 4 +--- 3 files changed, 5 insertions(+), 9 deletions(-) diff --git a/components/Current/Blocks.tsx b/components/Current/Blocks.tsx index 04e138e43..dc90c952f 100644 --- a/components/Current/Blocks.tsx +++ b/components/Current/Blocks.tsx @@ -16,7 +16,7 @@ export default function Blocks({ blocks }: BlocksProps) { const type = block.__typename switch (type) { case BlocksTypenameEnum.CurrentBlocksPageBlocksList: - return + return case BlocksTypenameEnum.CurrentBlocksPageBlocksPuffs: return case BlocksTypenameEnum.CurrentBlocksPageBlocksText: diff --git a/components/Current/Blocks/List/index.tsx b/components/Current/Blocks/List/index.tsx index af6629992..269108895 100644 --- a/components/Current/Blocks/List/index.tsx +++ b/components/Current/Blocks/List/index.tsx @@ -4,14 +4,12 @@ import type { ListProps, ListItem } from "@/types/requests/blocks/list" import styles from "./list.module.css" import Link from "next/link" -export default function List({ listBlock }: ListProps) { +export default function List({ list }: ListProps) { return (
    - {listBlock.list.title ? ( -

    {listBlock.list.title}

    - ) : null} + {list.title ?

    {list.title}

    : null}
      - {listBlock.list.list_items.map((item, i) => ( + {list.list_items.map((item, i) => ( ))}
    diff --git a/types/requests/blocks/list.ts b/types/requests/blocks/list.ts index abc327c16..bd8c1de1b 100644 --- a/types/requests/blocks/list.ts +++ b/types/requests/blocks/list.ts @@ -66,6 +66,4 @@ export type List = { } -export type ListProps = { - listBlock: List -} +export type ListProps = List From c580117762f02c896e2821edf199dd7563f422dc Mon Sep 17 00:00:00 2001 From: Christel Westerberg Date: Mon, 12 Feb 2024 13:25:57 +0100 Subject: [PATCH 5/7] fix: remove strikethrough --- components/JsonToHtml/Components/Strikethrough/index.tsx | 9 --------- .../Components/Strikethrough/strike.module.css | 3 --- 2 files changed, 12 deletions(-) delete mode 100644 components/JsonToHtml/Components/Strikethrough/index.tsx delete mode 100644 components/JsonToHtml/Components/Strikethrough/strike.module.css diff --git a/components/JsonToHtml/Components/Strikethrough/index.tsx b/components/JsonToHtml/Components/Strikethrough/index.tsx deleted file mode 100644 index 3d5fbb57c..000000000 --- a/components/JsonToHtml/Components/Strikethrough/index.tsx +++ /dev/null @@ -1,9 +0,0 @@ -import styles from "./strike.module.css" - -export default function Strikethrough({ children }: React.PropsWithChildren) { - return ( - - {children} - - ) -} diff --git a/components/JsonToHtml/Components/Strikethrough/strike.module.css b/components/JsonToHtml/Components/Strikethrough/strike.module.css deleted file mode 100644 index 99f9b3476..000000000 --- a/components/JsonToHtml/Components/Strikethrough/strike.module.css +++ /dev/null @@ -1,3 +0,0 @@ -.strikethrough { - text-decoration: line-through; -} \ No newline at end of file From 9757f5dda9827e18b77e7e942517b04cc0bae3da Mon Sep 17 00:00:00 2001 From: Christel Westerberg Date: Mon, 12 Feb 2024 13:39:43 +0100 Subject: [PATCH 6/7] feat: add cva --- components/Current/Blocks/List/ListItem.tsx | 81 +++++++++++++++++++++ components/Current/Blocks/List/index.tsx | 79 +------------------- package-lock.json | 20 +++++ package.json | 1 + 4 files changed, 104 insertions(+), 77 deletions(-) create mode 100644 components/Current/Blocks/List/ListItem.tsx diff --git a/components/Current/Blocks/List/ListItem.tsx b/components/Current/Blocks/List/ListItem.tsx new file mode 100644 index 000000000..601c50ec5 --- /dev/null +++ b/components/Current/Blocks/List/ListItem.tsx @@ -0,0 +1,81 @@ +import Link from "next/link" +import { cva } from "class-variance-authority" +import { BlockListItemsEnum } from "@/types/requests/blocks/list" +import type { ListItem } from "@/types/requests/blocks/list" +import styles from "./list.module.css" + +const config = { + variants: { + type: { + default: styles.disc, + checkmark: styles.checkmark, + }, + }, + defaultVariants: { + type: "default", + }, +} as const + +const listItemStyle = cva(styles.listItem, config) + +export default function ListItem({ listItem }: { listItem: ListItem }) { + const typeName = listItem.__typename + + switch (typeName) { + case BlockListItemsEnum.CurrentBlocksPageBlocksListBlockListItemsListItem: + return ( +
  • + {listItem.list_item.subtitle ? ( + <> + {listItem.list_item.title} +
    + {listItem.list_item.subtitle} + + ) : ( + listItem.list_item.title + )} +
  • + ) + case BlockListItemsEnum.CurrentBlocksPageBlocksListBlockListItemsListItemExternalLink: + return ( +
  • + + {listItem.list_item_external_link.link.title} + +
    + {listItem.list_item_external_link.subtitle} +
  • + ) + case BlockListItemsEnum.CurrentBlocksPageBlocksListBlockListItemsListItemInternalLink: + const link = listItem.list_item_internal_link.pageConnection.edges[0] + const linkUrlWithLocale = `/${link.node.system.locale}${link.node.url}` + return ( +
  • + + {listItem.list_item_internal_link.link_text} + +
    + {listItem.list_item_internal_link.subtitle} +
  • + ) + + default: + return null + } +} diff --git a/components/Current/Blocks/List/index.tsx b/components/Current/Blocks/List/index.tsx index 269108895..11e6589ec 100644 --- a/components/Current/Blocks/List/index.tsx +++ b/components/Current/Blocks/List/index.tsx @@ -1,8 +1,7 @@ -import { BlockListItemsEnum } from "@/types/requests/blocks/list" -import type { ListProps, ListItem } from "@/types/requests/blocks/list" +import type { ListProps } from "@/types/requests/blocks/list" import styles from "./list.module.css" -import Link from "next/link" +import ListItem from "./ListItem" export default function List({ list }: ListProps) { return ( @@ -16,77 +15,3 @@ export default function List({ list }: ListProps) {
    ) } - -function ListItem({ listItem }: { listItem: ListItem }) { - const typeName = listItem.__typename - - switch (typeName) { - case BlockListItemsEnum.CurrentBlocksPageBlocksListBlockListItemsListItem: - return ( -
  • - {listItem.list_item.subtitle ? ( - <> - {listItem.list_item.title} -
    - {listItem.list_item.subtitle} - - ) : ( - listItem.list_item.title - )} -
  • - ) - case BlockListItemsEnum.CurrentBlocksPageBlocksListBlockListItemsListItemExternalLink: - return ( -
  • - - {listItem.list_item_external_link.link.title} - -
    - {listItem.list_item_external_link.subtitle} -
  • - ) - case BlockListItemsEnum.CurrentBlocksPageBlocksListBlockListItemsListItemInternalLink: - const link = listItem.list_item_internal_link.pageConnection.edges[0] - const linkUrlWithLocale= `/${link.node.system.locale}${link.node.url}` - return ( -
  • - - {listItem.list_item_internal_link.link_text} - -
    - {listItem.list_item_internal_link.subtitle} -
  • - ) - - default: - return null - } -} diff --git a/package-lock.json b/package-lock.json index 1cb8e28aa..d8c221c9c 100644 --- a/package-lock.json +++ b/package-lock.json @@ -8,6 +8,7 @@ "name": "web", "version": "0.1.0", "dependencies": { + "class-variance-authority": "^0.7.0", "graphql": "16.8.1", "graphql-request": "6.1.0", "graphql-tag": "2.12.6", @@ -873,11 +874,30 @@ "url": "https://github.com/chalk/chalk?sponsor=1" } }, + "node_modules/class-variance-authority": { + "version": "0.7.0", + "resolved": "https://registry.npmjs.org/class-variance-authority/-/class-variance-authority-0.7.0.tgz", + "integrity": "sha512-jFI8IQw4hczaL4ALINxqLEXQbWcNjoSkloa4IaufXCJr6QawJyw7tuRysRsrE8w2p/4gGaxKIt/hX3qz/IbD1A==", + "dependencies": { + "clsx": "2.0.0" + }, + "funding": { + "url": "https://joebell.co.uk" + } + }, "node_modules/client-only": { "version": "0.0.1", "resolved": "https://registry.npmjs.org/client-only/-/client-only-0.0.1.tgz", "integrity": "sha512-IV3Ou0jSMzZrd3pZ48nLkT9DA7Ag1pnPzaiQhpW7c3RbcqqzvzzVu+L8gfqMp/8IM2MQtSiqaCxrrcfu8I8rMA==" }, + "node_modules/clsx": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/clsx/-/clsx-2.0.0.tgz", + "integrity": "sha512-rQ1+kcj+ttHG0MKVGBUXwayCCF1oh39BF5COIpRzuCEv8Mwjv0XucrI2ExNTOn9IlLifGClWQcU9BrZORvtw6Q==", + "engines": { + "node": ">=6" + } + }, "node_modules/color-convert": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", diff --git a/package.json b/package.json index 0fa8479f3..70753f7c0 100644 --- a/package.json +++ b/package.json @@ -9,6 +9,7 @@ "lint": "next lint && tsc" }, "dependencies": { + "class-variance-authority": "^0.7.0", "graphql": "16.8.1", "graphql-request": "6.1.0", "graphql-tag": "2.12.6", From 32cf13613c71472e8f2595cc8f397cdba2388c3c Mon Sep 17 00:00:00 2001 From: Christel Westerberg Date: Mon, 12 Feb 2024 13:51:06 +0100 Subject: [PATCH 7/7] fix: conditionally render subtitles --- components/Current/Blocks/List/ListItem.tsx | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/components/Current/Blocks/List/ListItem.tsx b/components/Current/Blocks/List/ListItem.tsx index 601c50ec5..975f7dbc4 100644 --- a/components/Current/Blocks/List/ListItem.tsx +++ b/components/Current/Blocks/List/ListItem.tsx @@ -53,8 +53,12 @@ export default function ListItem({ listItem }: { listItem: ListItem }) { > {listItem.list_item_external_link.link.title} -
    - {listItem.list_item_external_link.subtitle} + {listItem.list_item_external_link.subtitle && ( + +
    + {listItem.list_item_external_link.subtitle} +
    + )} ) case BlockListItemsEnum.CurrentBlocksPageBlocksListBlockListItemsListItemInternalLink: @@ -70,8 +74,12 @@ export default function ListItem({ listItem }: { listItem: ListItem }) { {listItem.list_item_internal_link.link_text} -
    - {listItem.list_item_internal_link.subtitle} + {listItem.list_item_internal_link.subtitle && ( + +
    + {listItem.list_item_internal_link.subtitle} +
    + )} )