Skip to content

Commit 8168a73

Browse files
committed
fix(next-drupal): use link component again, draft mode convention
1 parent 3e0fb3d commit 8168a73

File tree

6 files changed

+10
-6
lines changed

6 files changed

+10
-6
lines changed

starters/basic-starter/app/[...slug]/page.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,8 @@ export default async function NodePage(props: NodePageProps) {
117117

118118
const { slug } = params
119119

120-
const isDraftMode = (await draftMode()).isEnabled
120+
const draft = await draftMode()
121+
const isDraftMode = draft.isEnabled
121122

122123
let node
123124
try {

starters/basic-starter/components/misc/DraftAlert/index.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@ import { draftMode } from "next/headers"
33
import { DraftAlertClient } from "./Client"
44

55
export async function DraftAlert() {
6-
const isDraftEnabled = (await draftMode()).isEnabled
6+
const draft = await draftMode()
7+
const isDraftEnabled = draft.isEnabled
78

89
return (
910
<Suspense fallback={null}>

starters/graphql-starter/app/[...slug]/page.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,8 @@ export async function generateStaticParams(): Promise<NodePageParams[]> {
119119
}
120120

121121
export default async function Page({ params: { slug } }: NodePageProps) {
122-
const isDraftMode = (await draftMode()).isEnabled
122+
const draft = await draftMode()
123+
const isDraftMode = draft.isEnabled
123124

124125
let node
125126
try {

starters/graphql-starter/components/misc/DraftAlert/index.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@ import { draftMode } from "next/headers"
33
import { DraftAlertClient } from "./Client"
44

55
export async function DraftAlert() {
6-
const isDraftEnabled = (await draftMode()).isEnabled
6+
const draft = await draftMode()
7+
const isDraftEnabled = draft.isEnabled
78

89
return (
910
<Suspense fallback={null}>

starters/pages-starter/components/drupal/ArticleTeaser.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import Image from "next/image"
22
import { absoluteUrl, formatDate } from "@/lib/utils"
33
import type { DrupalNode } from "next-drupal"
4-
import Link from "next/link"
4+
import { Link } from "@/components/navigation/Link"
55

66
interface ArticleTeaserProps {
77
node: DrupalNode

starters/pages-starter/components/navigation/HeaderNav.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import Link from "next/link"
1+
import { Link } from "@/components/navigation/Link"
22

33
export function HeaderNav() {
44
return (

0 commit comments

Comments
 (0)