Changeset View
Changeset View
Standalone View
Standalone View
web/cashtab/src/components/Send/Send.js
Show All 20 Lines | |||||
import { | import { | ||||
sendXecNotification, | sendXecNotification, | ||||
errorNotification, | errorNotification, | ||||
messageSignedNotification, | messageSignedNotification, | ||||
generalNotification, | generalNotification, | ||||
} from 'components/Common/Notifications'; | } from 'components/Common/Notifications'; | ||||
import { isMobile, isIOS, isSafari } from 'react-device-detect'; | import { isMobile, isIOS, isSafari } from 'react-device-detect'; | ||||
import { currency, parseAddressForParams } from 'components/Common/Ticker.js'; | import { currency, parseAddressForParams } from 'components/Common/Ticker.js'; | ||||
import CopyToClipboard from 'components/Common/CopyToClipboard'; | |||||
import { Event } from 'utils/GoogleAnalytics'; | import { Event } from 'utils/GoogleAnalytics'; | ||||
import { | import { | ||||
fiatToCrypto, | fiatToCrypto, | ||||
shouldRejectAmountInput, | shouldRejectAmountInput, | ||||
isValidXecAddress, | isValidXecAddress, | ||||
isValidEtokenAddress, | isValidEtokenAddress, | ||||
isValidXecSendAmount, | isValidXecSendAmount, | ||||
} from 'utils/validation'; | } from 'utils/validation'; | ||||
Show All 17 Lines | |||||
import ApiError from 'components/Common/ApiError'; | import ApiError from 'components/Common/ApiError'; | ||||
import { formatFiatBalance, formatBalance } from 'utils/formatting'; | import { formatFiatBalance, formatBalance } from 'utils/formatting'; | ||||
import { | import { | ||||
TokenParamLabel, | TokenParamLabel, | ||||
MessageVerificationParamLabel, | MessageVerificationParamLabel, | ||||
} from 'components/Common/Atoms'; | } from 'components/Common/Atoms'; | ||||
import { PlusSquareOutlined } from '@ant-design/icons'; | import { PlusSquareOutlined } from '@ant-design/icons'; | ||||
import styled from 'styled-components'; | import styled from 'styled-components'; | ||||
import { CopyToClipboard } from 'react-copy-to-clipboard'; | |||||
import WalletLabel from 'components/Common/WalletLabel.js'; | import WalletLabel from 'components/Common/WalletLabel.js'; | ||||
import { ThemedCopySolid } from 'components/Common/CustomIcons'; | import { ThemedCopySolid } from 'components/Common/CustomIcons'; | ||||
const { TextArea } = Input; | const { TextArea } = Input; | ||||
const SignMessageLabel = styled.div` | const SignMessageLabel = styled.div` | ||||
text-align: left; | text-align: left; | ||||
color: ${props => props.theme.forms.text}; | color: ${props => props.theme.forms.text}; | ||||
▲ Show 20 Lines • Show All 1,084 Lines • ▼ Show 20 Lines | return ( | ||||
wallet.Path1899.cashAddress | wallet.Path1899.cashAddress | ||||
? convertToEcashPrefix( | ? convertToEcashPrefix( | ||||
wallet.Path1899 | wallet.Path1899 | ||||
.cashAddress, | .cashAddress, | ||||
) | ) | ||||
: '' | : '' | ||||
} | } | ||||
/> | /> | ||||
<div | <CopyToClipboard | ||||
onClick={() => { | data={convertToEcashPrefix( | ||||
const convertedAddress = | wallet.Path1899.cashAddress, | ||||
convertToEcashPrefix( | )} | ||||
optionalOnCopyNotification={{ | |||||
title: 'Copied', | |||||
msg: `${convertToEcashPrefix( | |||||
wallet.Path1899 | wallet.Path1899 | ||||
.cashAddress, | .cashAddress, | ||||
); | )} copied to clipboard`, | ||||
navigator.clipboard.writeText( | |||||
convertedAddress, | |||||
); | |||||
generalNotification( | |||||
convertedAddress + | |||||
' copied to clipboard', | |||||
'Copied', | |||||
'Success', | |||||
); | |||||
}} | }} | ||||
> | > | ||||
<ThemedCopySolid /> | <ThemedCopySolid /> | ||||
</div> | </CopyToClipboard> | ||||
</AddressCopyCtn> | </AddressCopyCtn> | ||||
)} | )} | ||||
</Form.Item> | </Form.Item> | ||||
<SmartButton | <SmartButton | ||||
onClick={() => setShowConfirmMsgToSign(true)} | onClick={() => setShowConfirmMsgToSign(true)} | ||||
disabled={!signMessageIsValid} | disabled={!signMessageIsValid} | ||||
> | > | ||||
<PlusSquareOutlined /> | <PlusSquareOutlined /> | ||||
Sign Message | Sign Message | ||||
</SmartButton> | </SmartButton> | ||||
<CopyToClipboard | <CopyToClipboard | ||||
style={{ | data={messageSignature} | ||||
display: 'inline-block', | optionalOnCopyNotification={{ | ||||
width: '100%', | title: 'Message signature copied to clipboard', | ||||
position: 'relative', | msg: `${messageSignature}`, | ||||
}} | }} | ||||
text={messageSignature} | |||||
> | > | ||||
<Form.Item> | <Form.Item> | ||||
<SignMessageLabel> | <SignMessageLabel> | ||||
Signature: | Signature: | ||||
</SignMessageLabel> | </SignMessageLabel> | ||||
<TextArea | <TextArea | ||||
name="signMessageSignature" | name="signMessageSignature" | ||||
placeholder="The signature will be generated upon signing of the message" | placeholder="The signature will be generated upon signing of the message" | ||||
▲ Show 20 Lines • Show All 128 Lines • Show Last 20 Lines |