Add feedback when copy link to clipboard
This commit is contained in:
@@ -11,6 +11,7 @@ import { useModals } from "@mantine/modals";
|
|||||||
import { ModalsContextProps } from "@mantine/modals/lib/context";
|
import { ModalsContextProps } from "@mantine/modals/lib/context";
|
||||||
import { useRouter } from "next/router";
|
import { useRouter } from "next/router";
|
||||||
import { Copy } from "tabler-icons-react";
|
import { Copy } from "tabler-icons-react";
|
||||||
|
import toast from "../../utils/toast.util";
|
||||||
|
|
||||||
const showCompletedUploadModal = (
|
const showCompletedUploadModal = (
|
||||||
modals: ModalsContextProps,
|
modals: ModalsContextProps,
|
||||||
@@ -36,7 +37,12 @@ const Body = ({ link, expiresAt }: { link: string; expiresAt: string }) => {
|
|||||||
variant="filled"
|
variant="filled"
|
||||||
value={link}
|
value={link}
|
||||||
rightSection={
|
rightSection={
|
||||||
<ActionIcon onClick={() => clipboard.copy(link)}>
|
<ActionIcon
|
||||||
|
onClick={() => {
|
||||||
|
clipboard.copy(link);
|
||||||
|
toast.success("Your link was copied to the keyboard.");
|
||||||
|
}}
|
||||||
|
>
|
||||||
<Copy />
|
<Copy />
|
||||||
</ActionIcon>
|
</ActionIcon>
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user