Skip to content

Commit

Permalink
add button to copy link to message
Browse files Browse the repository at this point in the history
  • Loading branch information
marcusmolchany committed Oct 15, 2022
1 parent f85140e commit 2e9f868
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/components/SignatureForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,12 @@ const getPostmessage = ({
return postMessage;
};

const getLinkToMessage = (message: string): string => {
return `${window.location.origin}${
window.location.pathname
}?message=${encodeURI(message)}`;
};

const INITIAL_MESSAGE =
"I hereby decree that this message has been signed by me.\n\nSigned using Wallet Sign";

Expand Down Expand Up @@ -131,6 +137,10 @@ export function SignatureForm({
onChange={onMessageChange}
value={message}
></textarea>
<div className="signatureForm_buttonGroup flexEnd">
<span style={{ marginRight: "0.25rem" }}>Copy link to message</span>
<CopyButton text={getLinkToMessage(message)} />
</div>
<h3>Message to sign</h3>
<div className="signatureForm_pre">
<PreWrap>{messageToSign}</PreWrap>
Expand Down

0 comments on commit 2e9f868

Please sign in to comment.