Skip to content

Commit 4657440

Browse files
committed
feat(admin): add link to admin home
1 parent 6e516f1 commit 4657440

2 files changed

Lines changed: 16 additions & 0 deletions

File tree

src/components/RootLayout/Navbar/DesktopProfile.tsx

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,14 @@ export const DesktopProfile = () => {
6363
</Link>
6464
</div>
6565

66+
{session.user.admin && (
67+
<div className="border-b border-gray-100 px-8 py-4 text-prog-gray-500 hover:text-gray-700 dark:border-slate-900 dark:text-gray-100 dark:hover:text-gray-400">
68+
<Link href="/admin" onClick={() => close()}>
69+
Admin Home
70+
</Link>
71+
</div>
72+
)}
73+
6674
<div className="px-8 py-4">
6775
<SignoutButton className="text-prog-gray-500 hover:text-gray-700 dark:text-gray-100 dark:hover:text-gray-400" />
6876
</div>

src/components/RootLayout/Navbar/MobileProfile.tsx

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,14 @@ export const MobileProfile = () => {
4949
</button>
5050
</PopoverButton>
5151

52+
{session.user.admin && (
53+
<PopoverButton as={Link} href="/admin">
54+
<button className="block w-full rounded-md bg-gray-600 px-4 py-3 text-center font-medium text-white shadow hover:bg-gray-700 dark:bg-slate-600 dark:hover:bg-slate-700">
55+
Admin Home
56+
</button>
57+
</PopoverButton>
58+
)}
59+
5260
<SignoutButton className="block w-full rounded-md bg-gray-600 px-4 py-3 text-center font-medium text-white shadow hover:bg-gray-700 dark:bg-slate-600 dark:hover:bg-slate-700" />
5361
</div>
5462
) : (

0 commit comments

Comments
 (0)