From b403667c8d526b5330c5cd95d315b1f5edfb228e Mon Sep 17 00:00:00 2001 From: Brian Perry Date: Mon, 10 Feb 2025 14:10:54 -0600 Subject: [PATCH 1/2] fix: minor umami compatibility updates --- examples/example-umami/components/formatted-text.tsx | 2 +- examples/example-umami/lib/drupal.ts | 5 ++++- examples/example-umami/next-env.d.ts | 2 +- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/examples/example-umami/components/formatted-text.tsx b/examples/example-umami/components/formatted-text.tsx index a3330b7af..94a039391 100644 --- a/examples/example-umami/components/formatted-text.tsx +++ b/examples/example-umami/components/formatted-text.tsx @@ -1,5 +1,5 @@ import { HTMLReactParserOptions, domToReact } from "html-react-parser" -import { Element } from "domhandler/lib/node" +import { Element } from "domhandler" import parse from "html-react-parser" import Image from "next/image" import Link from "next/link" diff --git a/examples/example-umami/lib/drupal.ts b/examples/example-umami/lib/drupal.ts index 1bfe99fcf..c28055dce 100644 --- a/examples/example-umami/lib/drupal.ts +++ b/examples/example-umami/lib/drupal.ts @@ -1,3 +1,6 @@ import { DrupalClient } from "next-drupal" -export const drupal = new DrupalClient(process.env.NEXT_PUBLIC_DRUPAL_BASE_URL) +export const drupal = new DrupalClient( + process.env.NEXT_PUBLIC_DRUPAL_BASE_URL, + { useDefaultEndpoints: true } +) diff --git a/examples/example-umami/next-env.d.ts b/examples/example-umami/next-env.d.ts index 4f11a03dc..a4a7b3f5c 100644 --- a/examples/example-umami/next-env.d.ts +++ b/examples/example-umami/next-env.d.ts @@ -2,4 +2,4 @@ /// // NOTE: This file should not be edited -// see https://nextjs.org/docs/basic-features/typescript for more information. +// see https://nextjs.org/docs/pages/building-your-application/configuring/typescript for more information. From ec0bd64d6d0597c772c2cd5af3d8f513477c6f37 Mon Sep 17 00:00:00 2001 From: Brian Perry Date: Mon, 10 Feb 2025 17:07:15 -0600 Subject: [PATCH 2/2] fix: next compatibility fixes for umami example * update domhandler import * run link codemod --- .../components/block--banner.tsx | 5 ++- .../example-umami/components/breadcrumbs.tsx | 4 +-- examples/example-umami/components/footer.tsx | 14 +++++--- .../example-umami/components/form--search.tsx | 8 ++--- .../components/formatted-text.tsx | 4 +-- examples/example-umami/components/header.tsx | 8 ++--- .../components/locale-switcher.tsx | 19 +++++------ .../example-umami/components/menu-footer.tsx | 10 +++--- .../example-umami/components/menu-link.tsx | 6 ++-- .../example-umami/components/menu-main.tsx | 22 ++++++------- .../example-umami/components/menu-user.tsx | 4 +-- .../components/node--article--card-alt.tsx | 32 ++++++++++--------- .../components/node--article--card.tsx | 32 ++++++++++--------- .../components/node--article.tsx | 11 ++++--- .../components/node--recipe--card.tsx | 32 ++++++++++--------- .../components/node--recipe--teaser.tsx | 32 ++++++++++--------- .../example-umami/components/node--recipe.tsx | 22 ++++++++----- examples/example-umami/pages/account.tsx | 10 +++--- examples/example-umami/pages/search.tsx | 18 ++++++----- 19 files changed, 157 insertions(+), 136 deletions(-) diff --git a/examples/example-umami/components/block--banner.tsx b/examples/example-umami/components/block--banner.tsx index 7fff1da95..2558da61c 100644 --- a/examples/example-umami/components/block--banner.tsx +++ b/examples/example-umami/components/block--banner.tsx @@ -22,10 +22,9 @@ export function BlockBanner({ block }: BlockBannerProps) { - - {block.field_content_link.title} - + {block.field_content_link.title} )} diff --git a/examples/example-umami/components/breadcrumbs.tsx b/examples/example-umami/components/breadcrumbs.tsx index cb331c8e1..a9b0dc200 100644 --- a/examples/example-umami/components/breadcrumbs.tsx +++ b/examples/example-umami/components/breadcrumbs.tsx @@ -25,8 +25,8 @@ export function Breadcrumbs({ items, ...props }: BreadcrumbsProps) { {items.map((item, index) => (
  • {item.url ? ( - - {item.title} + + {item.title} ) : ( item.title diff --git a/examples/example-umami/components/footer.tsx b/examples/example-umami/components/footer.tsx index 1dd462a30..96fd316e9 100644 --- a/examples/example-umami/components/footer.tsx +++ b/examples/example-umami/components/footer.tsx @@ -34,8 +34,13 @@ export function Footer({ menus, blocks }: FooterProps) {
    {blocks.recipeCollections.map((tag) => ( - - {tag.name} + + {tag.name} ))}
    @@ -70,10 +75,9 @@ export function Footer({ menus, blocks }: FooterProps) { "" )} passHref + className="text-sm underline transition-colors hover:bg-black" > - - {blocks.footerPromo.field_content_link.title} - + {blocks.footerPromo.field_content_link.title} )} diff --git a/examples/example-umami/components/form--search.tsx b/examples/example-umami/components/form--search.tsx index 59e1ebdb1..c0edbe963 100644 --- a/examples/example-umami/components/form--search.tsx +++ b/examples/example-umami/components/form--search.tsx @@ -20,11 +20,9 @@ export function FormSearch({ className, ...props }: FormSearchProps) { return ( <> - - - {t("search")} - - + + {t("search")} +