Skip to content

Commit

Permalink
chore: replace <a> with <Link> to resolve eslint @next/next/no-html-l…
Browse files Browse the repository at this point in the history
…ink-for-pages
  • Loading branch information
robp committed Nov 7, 2024
1 parent b1af618 commit 4afd7f6
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions components/site-header/site-header.tsx
Original file line number Diff line number Diff line change
@@ -1,18 +1,19 @@
import { draftMode } from 'next/headers';
import { draftMode, type UnsafeUnwrappedDraftMode } from 'next/headers';
import Link from 'next/link';

import { Navigation } from '#/components/navigation';

// TODO: Fix fragment unmasking to type navigationData, if possible.
export function SiteHeader(props: { navigationData: any }) {
const { isEnabled: isDraftMode } = draftMode();
const { isEnabled: isDraftMode } = draftMode() as unknown as UnsafeUnwrappedDraftMode;
return (
<>
{isDraftMode && (
<div className="mb-4 border-b-2 border-primary bg-accent px-6 py-5 text-base text-primary" role="alert">
You are in draft mode. As part of draft mode you can see unpublished content. To exit draft mode click{' '}
<a className={'underline'} href="/api/disable-draft">
<Link className={'underline'} href="/api/disable-draft">
here
</a>
</Link>
.
</div>
)}
Expand Down

0 comments on commit 4afd7f6

Please sign in to comment.