Changeset View
Changeset View
Standalone View
Standalone View
web/cashtab/src/components/Home/Tx.js
import React from 'react'; | import React from 'react'; | ||||
import { Link } from 'react-router-dom'; | import { Link } from 'react-router-dom'; | ||||
import PropTypes from 'prop-types'; | import PropTypes from 'prop-types'; | ||||
import styled from 'styled-components'; | import styled from 'styled-components'; | ||||
import { | import { | ||||
SendIcon, | SendIcon, | ||||
ReceiveIcon, | ReceiveIcon, | ||||
GenesisIcon, | GenesisIcon, | ||||
UnparsedIcon, | UnparsedIcon, | ||||
ThemedContactsOutlined, | ThemedContactsOutlined, | ||||
} from 'components/Common/CustomIcons'; | } from 'components/Common/CustomIcons'; | ||||
import { currency } from 'components/Common/Ticker'; | import { currency } from 'components/Common/Ticker'; | ||||
import { fromLegacyDecimals } from 'utils/cashMethods'; | import { fromLegacyDecimals } from 'utils/cashMethods'; | ||||
import { formatBalance, formatDate } from 'utils/formatting'; | import { formatBalance, formatDate } from 'utils/formatting'; | ||||
import TokenIcon from 'components/Tokens/TokenIcon'; | import TokenIcon from 'components/Tokens/TokenIcon'; | ||||
import { Collapse } from 'antd'; | import { Collapse } from 'antd'; | ||||
import { generalNotification } from 'components/Common/Notifications'; | import CopyToClipboard from 'components/Common/CopyToClipboard'; | ||||
import { CopyToClipboard } from 'react-copy-to-clipboard'; | |||||
import { | import { | ||||
ThemedCopySolid, | ThemedCopySolid, | ||||
ThemedLinkSolid, | ThemedLinkSolid, | ||||
ThemedPdfSolid, | ThemedPdfSolid, | ||||
} from 'components/Common/CustomIcons'; | } from 'components/Common/CustomIcons'; | ||||
const TxIcon = styled.div` | const TxIcon = styled.div` | ||||
svg { | svg { | ||||
▲ Show 20 Lines • Show All 714 Lines • ▼ Show 20 Lines | return ( | ||||
</OpReturnType> | </OpReturnType> | ||||
</> | </> | ||||
)} | )} | ||||
</TxWrapper> | </TxWrapper> | ||||
</> | </> | ||||
} | } | ||||
> | > | ||||
<PanelCtn> | <PanelCtn> | ||||
<CopyToClipboard text={data.txid}> | <CopyToClipboard | ||||
<DropdownButton | data={data.txid} | ||||
onClick={() => { | optionalOnCopyNotification={{ | ||||
generalNotification( | title: 'Txid copied to clipboard', | ||||
data.txid, | msg: `${data.txid}`, | ||||
'Tx ID copied to clipboard', | |||||
); | |||||
}} | }} | ||||
> | > | ||||
<DropdownButton> | |||||
<DropdownIconWrapper> | <DropdownIconWrapper> | ||||
<TextLayer>Txid</TextLayer> | <TextLayer>Txid</TextLayer> | ||||
<ThemedCopySolid /> | <ThemedCopySolid /> | ||||
</DropdownIconWrapper> | </DropdownIconWrapper> | ||||
</DropdownButton> | </DropdownButton> | ||||
</CopyToClipboard> | </CopyToClipboard> | ||||
{data.opReturnMessage && ( | {data.opReturnMessage && ( | ||||
<CopyToClipboard | <CopyToClipboard | ||||
text={data.opReturnMessage} | data={data.opReturnMessage} | ||||
> | optionalOnCopyNotification={{ | ||||
<DropdownButton | title: 'Cashtab message copied to clipboard', | ||||
onClick={() => { | msg: `${data.opReturnMessage}`, | ||||
generalNotification( | |||||
data.opReturnMessage, | |||||
'Cashtab message copied to clipboard', | |||||
); | |||||
}} | }} | ||||
> | > | ||||
<DropdownButton> | |||||
<DropdownIconWrapper> | <DropdownIconWrapper> | ||||
<TextLayer>Msg</TextLayer> | <TextLayer>Msg</TextLayer> | ||||
<ThemedCopySolid /> | <ThemedCopySolid /> | ||||
</DropdownIconWrapper> | </DropdownIconWrapper> | ||||
</DropdownButton> | </DropdownButton> | ||||
</CopyToClipboard> | </CopyToClipboard> | ||||
)} | )} | ||||
<TxLink | <TxLink | ||||
▲ Show 20 Lines • Show All 76 Lines • Show Last 20 Lines |