Skip to content

Commit

Permalink
feat: make text selectable in PatchHelper (Vendicated#188)
Browse files Browse the repository at this point in the history
* feat: make text selectable in PatchHelper

* real div moment
  • Loading branch information
MeguminSama authored Nov 5, 2022
1 parent 65620f4 commit 0cb24ca
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/components/PatchHelper.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -85,16 +85,16 @@ function ReplacementComponent({ module, match, replacement, setReplacementError

return (
<>
{Parser.parse(fullMatch)}
{Parser.parse(groups)}
<div style={{ userSelect: "text" }}>{Parser.parse(fullMatch)}</div>
<div style={{ userSelect: "text" }}>{Parser.parse(groups)}</div>
</>
);
}

function renderDiff() {
return diff?.map(p => {
const color = p.added ? "lime" : p.removed ? "red" : "grey";
return <span style={{ color }}>{p.value}</span>;
return <div style={{ color, userSelect: "text" }}>{p.value}</div>;
});
}

Expand Down Expand Up @@ -284,7 +284,7 @@ function PatchHelper() {
{!!(find && match && replacement) && (
<>
<Forms.FormTitle className={Margins.marginTop20}>Code</Forms.FormTitle>
{Parser.parse(makeCodeblock(code, "ts"))}
<div style={{ userSelect: "text" }}>{Parser.parse(makeCodeblock(code, "ts"))}</div>
<Button onClick={() => Clipboard.copy(code)}>Copy to Clipboard</Button>
</>
)}
Expand Down

0 comments on commit 0cb24ca

Please sign in to comment.