Skip to content

Commit bcecabb

Browse files
paulpaul
authored andcommitted
Add banner to show user that we are in draft mode with button that triggers the exit-preview route.
1 parent 8c78bfa commit bcecabb

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

next/components/draft-mode-banner.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
'use client';
22

3-
import { useRouter } from 'next/navigation';
3+
import { usePathname, useRouter } from 'next/navigation';
44
import { useState } from 'react';
55

66
export function DraftModeBanner() {
77
const router = useRouter();
8+
const pathname = usePathname();
89
const [isExiting, setIsExiting] = useState(false);
910

1011
const handleExitDraft = async () => {

0 commit comments

Comments
 (0)