Skip to content

Commit 767d3f4

Browse files
committed
2.10.0
1 parent 7e71769 commit 767d3f4

File tree

3 files changed

+9
-6
lines changed

3 files changed

+9
-6
lines changed

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@samvera/clover-iiif",
3-
"version": "2.9.1",
3+
"version": "2.10.0",
44
"description": "Extensible IIIF front-end toolkit and Manifest viewer. Accessible. Composable. Open Source.",
55
"files": [
66
"dist"

src/hooks/useCopyToClipboard.ts

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,10 @@ import { useTranslation } from "react-i18next";
55
export const useCopyToClipboard = (
66
text: string,
77
notifyTimeout = 2500,
8-
): [string | undefined, () => void] => {
8+
): [string, () => void] => {
99
const { t } = useTranslation();
1010

11-
const [copyStatus, setCopyStatus] = useState();
11+
const [copyStatus, setCopyStatus] = useState("");
1212
const copy = useCallback(() => {
1313
navigator.clipboard.writeText(text).then(
1414
() => setCopyStatus(t("copySuccess")),
@@ -19,7 +19,10 @@ export const useCopyToClipboard = (
1919
useEffect(() => {
2020
if (!copyStatus) return;
2121

22-
const timeoutId = setTimeout(() => setCopyStatus(undefined), notifyTimeout);
22+
const timeoutId = setTimeout(
23+
() => setCopyStatus(t("copyFailure")),
24+
notifyTimeout,
25+
);
2326

2427
return () => clearTimeout(timeoutId);
2528
}, [copyStatus]);

0 commit comments

Comments
 (0)