Skip to content

Commit 7944182

Browse files
committed
Add copy state change timeout
1 parent c557e85 commit 7944182

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

apps/landing/src/app/(detail)/components/MdxCardFooter.tsx

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,12 @@ export default function MdxCardFooter({
1818
const handleCopy = () => {
1919
navigator.clipboard
2020
.writeText(code)
21-
.then(() => setCopied(true))
21+
.then(() => {
22+
setCopied(true)
23+
setTimeout(() => {
24+
setCopied(false)
25+
}, 1000 * 5)
26+
})
2227
.catch(() => setCopied(false))
2328
}
2429

0 commit comments

Comments
 (0)