mirror of
https://github.com/Radiquum/AniX.git
synced 2025-05-04 11:59:40 +05:00
feat(navigation): add a copy current url button to navbar for ease of sharing
This commit is contained in:
parent
6bd46e8437
commit
65b26613c5
2 changed files with 56 additions and 0 deletions
|
@ -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) => {
|
|||
)}
|
||||
|
||||
<span className="max"></span>
|
||||
|
||||
<button className="circle transparent" onClick={() => copyToClipboard()}>
|
||||
<i>{isCopied ? "done" : "content_copy"}</i>
|
||||
<div class="tooltip right">
|
||||
{isCopied ? "Ссылка скопирована" : "Скопировать ссылку"}
|
||||
</div>
|
||||
</button>
|
||||
|
||||
<button
|
||||
className="circle transparent"
|
||||
onClick={() => props.setSettingsPopup(!props.settingsPopup)}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue