diff --git a/web/cashtab/src/assets/styles/theme.js b/web/cashtab/src/assets/styles/theme.js --- a/web/cashtab/src/assets/styles/theme.js +++ b/web/cashtab/src/assets/styles/theme.js @@ -11,6 +11,7 @@ text: { primary: '#273498', secondary: '#273498', + link: '#20242d', }, switch: { activeCash: { diff --git a/web/cashtab/src/components/Common/Atoms.js b/web/cashtab/src/components/Common/Atoms.js --- a/web/cashtab/src/components/Common/Atoms.js +++ b/web/cashtab/src/components/Common/Atoms.js @@ -1,5 +1,9 @@ import styled from 'styled-components'; +export const CopyToClipBoardStyle = styled.span` + font-size: 20px; +`; + export const LoadingCtn = styled.div` width: 100%; display: flex; diff --git a/web/cashtab/src/components/Common/Notifications.js b/web/cashtab/src/components/Common/Notifications.js --- a/web/cashtab/src/components/Common/Notifications.js +++ b/web/cashtab/src/components/Common/Notifications.js @@ -170,6 +170,15 @@ }); }; +const generalNotification = msg => { + const notificationStyle = getDeviceNotificationStyle(); + notification.success({ + message: msg, + icon: , + style: notificationStyle, + }); +}; + export { sendXecNotification, createTokenNotification, @@ -179,4 +188,5 @@ eTokenReceivedNotification, errorNotification, messageSignedNotification, + generalNotification, }; diff --git a/web/cashtab/src/components/Configure/__tests__/__snapshots__/Configure.test.js.snap b/web/cashtab/src/components/Configure/__tests__/__snapshots__/Configure.test.js.snap --- a/web/cashtab/src/components/Configure/__tests__/__snapshots__/Configure.test.js.snap +++ b/web/cashtab/src/components/Configure/__tests__/__snapshots__/Configure.test.js.snap @@ -2,7 +2,7 @@ exports[`Configure with a wallet 1`] = `

,
Signatures
, @@ -915,14 +915,14 @@ exports[`Wallet with BCH balances and tokens and state field 1`] = ` Array [
0.06 XEC
,
$ NaN @@ -954,7 +954,7 @@ type="button" >
Switch to multiple recipients
@@ -1244,14 +1244,14 @@

0 XEC

= @@ -1326,7 +1326,7 @@

,
Signatures
, @@ -1379,7 +1379,7 @@ exports[`Wallet without BCH balance 1`] = ` Array [
You currently have 0 XEC @@ -1411,7 +1411,7 @@ type="button" >
Switch to multiple recipients
@@ -1701,14 +1701,14 @@

0 XEC

= @@ -1782,7 +1782,7 @@
,
Signatures
, @@ -1835,7 +1835,7 @@ exports[`Without wallet defined 1`] = ` Array [
You currently have 0 XEC @@ -1867,7 +1867,7 @@ type="button" >
Switch to multiple recipients
@@ -2157,14 +2157,14 @@

0 XEC

= @@ -2238,7 +2238,7 @@
,
Signatures
, diff --git a/web/cashtab/src/components/Send/__tests__/__snapshots__/SendToken.test.js.snap b/web/cashtab/src/components/Send/__tests__/__snapshots__/SendToken.test.js.snap --- a/web/cashtab/src/components/Send/__tests__/__snapshots__/SendToken.test.js.snap +++ b/web/cashtab/src/components/Send/__tests__/__snapshots__/SendToken.test.js.snap @@ -5,7 +5,7 @@ exports[`Wallet with BCH balances and tokens and state field 1`] = ` Array [
6.001 diff --git a/web/cashtab/src/components/Tokens/__tests__/__snapshots__/Tokens.test.js.snap b/web/cashtab/src/components/Tokens/__tests__/__snapshots__/Tokens.test.js.snap --- a/web/cashtab/src/components/Tokens/__tests__/__snapshots__/Tokens.test.js.snap +++ b/web/cashtab/src/components/Tokens/__tests__/__snapshots__/Tokens.test.js.snap @@ -3,14 +3,14 @@ exports[`Wallet with BCH balances 1`] = ` Array [
You need some XEC in your wallet to create tokens.
,
0 @@ -107,7 +107,7 @@
,

You need at least @@ -130,14 +130,14 @@ exports[`Wallet with BCH balances and tokens 1`] = ` Array [

You need some XEC in your wallet to create tokens.
,
0 @@ -234,7 +234,7 @@
,

You need at least @@ -257,14 +257,14 @@ exports[`Wallet with BCH balances and tokens and state field 1`] = ` Array [

0.06 XEC
,
$ NaN @@ -367,13 +367,13 @@ onClick={[Function]} >
6.001 @@ -390,14 +390,14 @@ exports[`Wallet without BCH balance 1`] = ` Array [
You need some XEC in your wallet to create tokens.
,
0 @@ -494,7 +494,7 @@
,

You need at least @@ -517,14 +517,14 @@ exports[`Without wallet defined 1`] = ` Array [

You need some XEC in your wallet to create tokens.
,
0 @@ -621,7 +621,7 @@
,

You need at least diff --git a/web/cashtab/src/components/Wallet/Tx.js b/web/cashtab/src/components/Wallet/Tx.js --- a/web/cashtab/src/components/Wallet/Tx.js +++ b/web/cashtab/src/components/Wallet/Tx.js @@ -7,7 +7,10 @@ ArrowDownOutlined, ExperimentOutlined, ExclamationOutlined, + CopyOutlined, } from '@ant-design/icons'; +import { generalNotification } from '@components/Common/Notifications'; +import { CopyToClipBoardStyle } from '@components/Common/Atoms'; import { currency } from '@components/Common/Ticker'; import makeBlockie from 'ethereum-blockies-base64'; import { Img } from 'react-image'; @@ -193,6 +196,18 @@ } `; +const handleCopyMsgToClipboard = (message, e) => { + // prevent the click of the clipboard button from opening up the explorer link + if (e) { + e.stopPropagation(); + } + + // @TODO: back out the Buffer.from().toString() conversion once D10821 lands + navigator.clipboard.writeText(Buffer.from(message).toString()); + + generalNotification('Message copied to clipboard'); +}; + const Tx = ({ data, fiatPrice, fiatCurrency }) => { const txDate = typeof data.blocktime === 'undefined' @@ -459,8 +474,24 @@ ) : ( '' )} +   + {data.opReturnMessage ? ( + + + handleCopyMsgToClipboard( + data.opReturnMessage, + e, + ) + } + /> + + ) : ( + '' + )} {!data.outgoingTx && data.replyAddress ? ( e.stopPropagation()} to={{ pathname: `/send`, state: { diff --git a/web/cashtab/src/components/Wallet/TxHistory.js b/web/cashtab/src/components/Wallet/TxHistory.js --- a/web/cashtab/src/components/Wallet/TxHistory.js +++ b/web/cashtab/src/components/Wallet/TxHistory.js @@ -3,17 +3,28 @@ import styled from 'styled-components'; import Tx from './Tx'; -export const TxLink = styled.a``; +export const TxLink = styled.span` + color: ${props => props.theme.wallet.text.link}; + cursor: pointer; + transition: color 0.3s; + -webkit-text-decoration-skip: objects; +`; const TxHistory = ({ txs, fiatPrice, fiatCurrency }) => { + const openTxExplorer = transactionId => { + window.open( + `https://explorer.be.cash/tx/${transactionId}`, + '_blank', + 'noopener,noreferrer', + ); + }; return (

{txs.map(tx => ( openTxExplorer(tx.txid)} > ,
0 @@ -119,16 +119,16 @@
,
XEC
eToken @@ -140,7 +140,7 @@ exports[`Wallet with BCH balances and tokens 1`] = ` Array [
,
0 @@ -256,16 +256,16 @@
,
XEC
eToken @@ -277,14 +277,14 @@ exports[`Wallet with BCH balances and tokens and state field 1`] = ` Array [
0.06 XEC
,
$ NaN @@ -375,16 +375,16 @@
,
XEC
eToken @@ -396,7 +396,7 @@ exports[`Wallet without BCH balance 1`] = ` Array [
,
0 @@ -512,16 +512,16 @@
,
XEC
eToken