Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
import { Modal, ModalHeader, ModalBody, Card, CardBody, Input, Button, Row, Col } from 'reactstrap'
import { pick } from 'lodash'
import routes from 'Routes'
import { routerPathToUri } from 'Utilities/helpers'
import toastr from 'Utilities/toastrWrapper'
import WalletSummary from 'Components/WalletSummary'
import T from 'Components/i18n/T'
const closeCondition = ({ wallet }) => !wallet.address
export default compose(
setDisplayName('ShareModal'),
setPropTypes({
wallet: PropTypes.object.isRequired,
...Modal.propTypes
}),
withHandlers(() => {
let inputRef
return {
handleRef: () => (ref) => {
inputRef = ref
},
handleFocus: () => (event) => {
event.target.select()
},
handleCopy: () => () => {
inputRef.select()
document.execCommand('copy')
toastr.info('Link copied to clipboard')
},
}
import { compose, setDisplayName, setPropTypes } from 'recompose'
import { connect } from 'react-redux'
import { createStructuredSelector } from 'reselect'
import { Modal, ModalBody, ModalHeader, Row, Col, Input } from 'reactstrap'
import { pick } from 'lodash'
import classNames from 'class-names'
import { affiliateId, secretKey, } from 'Selectors'
import { modalShadow, apiDocs } from './style'
import { cardHeader, input, text } from '../style'
export default compose(
setDisplayName('AccountInfoModal'),
setPropTypes({
...Modal.propTypes,
}),
connect(createStructuredSelector({
affiliateId,
secretKey,
}), {
}),
)(({ affiliateId, secretKey, toggle, ...props }) => {
return (
close} tag='h4' toggle={toggle} className={cardHeader}>
Affiliate Account Info
)(({ wallet, walletUri, showDirectLink, toggle, handleRef, handleFocus, handleCopy, ...props }) => (
Share Portfolio
Permalink:
<input value="{walletUri}/" readonly="" type="text">
<button color="link">
<i></i></button>
)(({ affiliateId, secretKey, toggle, ...props }) => {
return (
close} tag='h4' toggle={toggle} className={cardHeader}>
Affiliate Account Info
<small><p>Affiliate Id</p></small>
<input readonly="" type="text" value="{affiliateId}">
<small><p>Secret Key</p></small>
<input readonly="" type="text" value="{secretKey}">
<small><p>
* Save these credentials somewhere safe. You will need them to access the affiliate dashboard and authenticate API requests.
</p></small>