2020-07-06 13:56:15 -07:00
|
|
|
import React from 'react'
|
|
|
|
|
import PropTypes from 'prop-types'
|
|
|
|
|
import { Row, Col, Box, Button } from 'adminlte-2-react'
|
|
|
|
|
import Jdenticon from 'react-jdenticon'
|
|
|
|
|
import './token.css'
|
2020-06-27 00:12:07 -04:00
|
|
|
let _this
|
|
|
|
|
class TokenCard extends React.Component {
|
2020-07-06 13:56:15 -07:00
|
|
|
constructor (props) {
|
2020-06-27 00:12:07 -04:00
|
|
|
super(props)
|
|
|
|
|
_this = this
|
|
|
|
|
this.state = {}
|
|
|
|
|
}
|
2020-07-06 13:56:15 -07:00
|
|
|
|
|
|
|
|
render () {
|
2020-06-27 00:12:07 -04:00
|
|
|
const token = _this.props.token
|
|
|
|
|
return (
|
|
|
|
|
<>
|
2020-07-06 13:56:15 -07:00
|
|
|
<Box className='hover-shadow border-none mt-2' id='token-card'>
|
|
|
|
|
<Row className='text-center'>
|
|
|
|
|
<Col sm={12} className='text-center mt-2 '>
|
|
|
|
|
<Jdenticon size='100' value={token.tokenId} />
|
|
|
|
|
<hr />
|
2020-06-27 00:12:07 -04:00
|
|
|
</Col>
|
2020-07-06 13:56:15 -07:00
|
|
|
<Col sm={12} className='flex justify-content-center '>
|
|
|
|
|
<div className='info-container'>
|
|
|
|
|
<p className='info-content'>
|
2020-06-27 00:12:07 -04:00
|
|
|
<b>Ticker: </b>
|
|
|
|
|
<span> {token.ticker}</span>
|
|
|
|
|
</p>
|
2020-07-06 13:56:15 -07:00
|
|
|
<p className='info-content'>
|
2020-06-27 00:12:07 -04:00
|
|
|
<b>Name: </b>
|
|
|
|
|
<span>{token.name}</span>
|
|
|
|
|
</p>
|
|
|
|
|
|
2020-07-06 13:56:15 -07:00
|
|
|
<p className='info-content'>
|
2020-06-27 00:12:07 -04:00
|
|
|
<b>Balance</b>
|
|
|
|
|
<span>{token.qty}</span>
|
|
|
|
|
</p>
|
|
|
|
|
</div>
|
|
|
|
|
</Col>
|
|
|
|
|
|
2020-07-06 13:56:15 -07:00
|
|
|
<Col sm={12} className='text-center '>
|
2020-06-27 00:12:07 -04:00
|
|
|
<Button
|
2020-07-06 13:56:15 -07:00
|
|
|
text='Show Token'
|
|
|
|
|
type='primary'
|
|
|
|
|
className='btn-lg'
|
2020-06-27 00:12:07 -04:00
|
|
|
onClick={() => {
|
|
|
|
|
_this.props.showToken(token)
|
|
|
|
|
}}
|
|
|
|
|
/>
|
|
|
|
|
</Col>
|
|
|
|
|
</Row>
|
|
|
|
|
</Box>
|
|
|
|
|
</>
|
|
|
|
|
)
|
|
|
|
|
}
|
2020-07-06 13:56:15 -07:00
|
|
|
|
|
|
|
|
shouldComponentUpdate () {
|
2020-06-27 00:12:07 -04:00
|
|
|
return false
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
TokenCard.propTypes = {
|
|
|
|
|
token: PropTypes.object.isRequired,
|
2020-07-06 13:56:15 -07:00
|
|
|
showToken: PropTypes.func.isRequired
|
2020-06-27 00:12:07 -04:00
|
|
|
}
|
|
|
|
|
export default TokenCard
|