Skip to content

armgit / memos

Public Imported from GitHub
0

Memos is an open-source, self-hosted note-taking app that brings your everyday thoughts together in a personal timeline. Your data stays yours, and you choose what to keep private or share.

fix: show copy button on hover (#1002)

Stephen Zhou42cd93cf3370
diff --git a/web/src/labs/marked/parser/CodeBlock.tsx b/web/src/labs/marked/parser/CodeBlock.tsx
index e9671be60..2f21ea112 100644
--- a/web/src/labs/marked/parser/CodeBlock.tsx
+++ b/web/src/labs/marked/parser/CodeBlock.tsx
@@ -29,9 +29,9 @@ const renderer = (rawStr: string) => {
};
return (
- <pre>
+ <pre className="group">
<button
- className="text-xs font-mono italic absolute top-0 right-0 px-2 leading-6 border btn-text rounded opacity-60"
+ className="text-xs font-mono italic absolute top-0 right-0 px-2 leading-6 border btn-text rounded opacity-0 group-hover:opacity-60"
onClick={handleCopyButtonClick}
>
copy