From 65b26613c56ee2b35206bbc55573d6c679bad217 Mon Sep 17 00:00:00 2001 From: Kentai Radiquum Date: Sat, 11 May 2024 07:02:56 +0500 Subject: [PATCH] feat(navigation): add a copy current url button to navbar for ease of sharing --- .../NavigationRail/NavigationRail.jsx | 10 ++++ frontend/app/hooks/useCopyToClipboard.js | 46 +++++++++++++++++++ 2 files changed, 56 insertions(+) create mode 100644 frontend/app/hooks/useCopyToClipboard.js diff --git a/frontend/app/components/NavigationRail/NavigationRail.jsx b/frontend/app/components/NavigationRail/NavigationRail.jsx index bad7d86..e399168 100644 --- a/frontend/app/components/NavigationRail/NavigationRail.jsx +++ b/frontend/app/components/NavigationRail/NavigationRail.jsx @@ -5,8 +5,10 @@ import Link from "next/link"; import Image from "next/image"; import { useUserStore } from "@/app/store/user-store"; import { useRouter } from "next/navigation"; +import useCopyToClipboard from "@/app/hooks/useCopyToClipboard"; export const NavigationRail = (props) => { + const [isCopied, copyToClipboard] = useCopyToClipboard(); const pathname = usePathname(); const userStore = useUserStore(); const router = useRouter(); @@ -98,6 +100,14 @@ export const NavigationRail = (props) => { )} + + +