Last updated
This commit is contained in:
@@ -29,6 +29,7 @@ const Body = ({ share, appUrl }: { share: Share; appUrl: string }) => {
|
|||||||
const clipboard = useClipboard({ timeout: 500 });
|
const clipboard = useClipboard({ timeout: 500 });
|
||||||
const modals = useModals();
|
const modals = useModals();
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
|
|
||||||
const [checkState, setCheckState] = useState(false);
|
const [checkState, setCheckState] = useState(false);
|
||||||
const timerRef = useRef<number | ReturnType<typeof setTimeout> | undefined>(undefined);
|
const timerRef = useRef<number | ReturnType<typeof setTimeout> | undefined>(undefined);
|
||||||
|
|
||||||
@@ -37,15 +38,11 @@ const Body = ({ share, appUrl }: { share: Share; appUrl: string }) => {
|
|||||||
const copyLink = () => {
|
const copyLink = () => {
|
||||||
clipboard.copy(link);
|
clipboard.copy(link);
|
||||||
toast.success("Your link was copied to the keyboard.");
|
toast.success("Your link was copied to the keyboard.");
|
||||||
|
if (timerRef.current)
|
||||||
if (timerRef.current) {
|
|
||||||
clearTimeout(timerRef.current);
|
clearTimeout(timerRef.current);
|
||||||
}
|
|
||||||
|
|
||||||
timerRef.current = setTimeout(() => {
|
timerRef.current = setTimeout(() => {
|
||||||
setCheckState(false);
|
setCheckState(false);
|
||||||
}, 1500);
|
}, 1500);
|
||||||
|
|
||||||
setCheckState(true);
|
setCheckState(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -54,7 +51,6 @@ const Body = ({ share, appUrl }: { share: Share; appUrl: string }) => {
|
|||||||
<TextInput
|
<TextInput
|
||||||
readOnly
|
readOnly
|
||||||
variant="filled"
|
variant="filled"
|
||||||
style={{ borderColor: "green" }}
|
|
||||||
value={link}
|
value={link}
|
||||||
onClick={copyLink}
|
onClick={copyLink}
|
||||||
rightSection={
|
rightSection={
|
||||||
|
|||||||
Reference in New Issue
Block a user