[skip ci] PatchHelper: Fix copy button style

This commit is contained in:
V 2023-09-05 21:37:39 +02:00
parent 9b987d1e56
commit 4c805d08be
No known key found for this signature in database
GPG key ID: A1DC0CFB5615D905
3 changed files with 25 additions and 12 deletions

View file

@ -17,6 +17,7 @@
*/
import { CheckedTextInput } from "@components/CheckedTextInput";
import { CodeBlock } from "@components/CodeBlock";
import { debounce } from "@utils/debounce";
import { Margins } from "@utils/margins";
import { canonicalizeMatch, canonicalizeReplace } from "@utils/patches";
@ -299,7 +300,7 @@ function PatchHelper() {
{!!(find && match && replacement) && (
<>
<Forms.FormTitle className={Margins.top20}>Code</Forms.FormTitle>
<div style={{ userSelect: "text" }}>{Parser.parse(makeCodeblock(code, "ts"))}</div>
<CodeBlock lang="js" content={code} />
<Button onClick={() => Clipboard.copy(code)}>Copy to Clipboard</Button>
</>
)}