2022-04-02 23:33:35 +02:00
|
|
|
import React from 'react';
|
2022-06-28 15:11:19 +02:00
|
|
|
import { useSelector } from 'react-redux';
|
2022-04-02 23:33:35 +02:00
|
|
|
import PropTypes from 'prop-types';
|
|
|
|
|
|
|
|
import Box from '../../../ui/box';
|
|
|
|
import Identicon from '../../../ui/identicon';
|
|
|
|
import DetectedTokenValues from '../detected-token-values/detected-token-values';
|
|
|
|
import DetectedTokenAddress from '../detected-token-address/detected-token-address';
|
|
|
|
import DetectedTokenAggregators from '../detected-token-aggregators/detected-token-aggregators';
|
|
|
|
import { DISPLAY } from '../../../../helpers/constants/design-system';
|
2022-06-28 15:11:19 +02:00
|
|
|
import { getTokenList } from '../../../../selectors';
|
|
|
|
|
|
|
|
const DetectedTokenDetails = ({ tokenAddress }) => {
|
|
|
|
const tokenList = useSelector(getTokenList);
|
|
|
|
const token = tokenList[tokenAddress];
|
2022-04-02 23:33:35 +02:00
|
|
|
|
|
|
|
return (
|
2022-06-28 15:11:19 +02:00
|
|
|
<Box display={DISPLAY.FLEX} className="detected-token-details">
|
2022-04-02 23:33:35 +02:00
|
|
|
<Identicon
|
|
|
|
className="detected-token-details__identicon"
|
2022-06-28 15:11:19 +02:00
|
|
|
address={tokenAddress}
|
2022-04-02 23:33:35 +02:00
|
|
|
diameter={40}
|
|
|
|
/>
|
|
|
|
<Box
|
|
|
|
display={DISPLAY.GRID}
|
|
|
|
marginLeft={2}
|
|
|
|
className="detected-token-details__data"
|
|
|
|
>
|
2022-06-28 15:11:19 +02:00
|
|
|
<DetectedTokenValues token={token} />
|
|
|
|
<DetectedTokenAddress address={token.address} />
|
|
|
|
<DetectedTokenAggregators aggregatorsList={token.aggregators} />
|
2022-04-02 23:33:35 +02:00
|
|
|
</Box>
|
|
|
|
</Box>
|
|
|
|
);
|
|
|
|
};
|
|
|
|
|
|
|
|
DetectedTokenDetails.propTypes = {
|
2022-06-28 15:11:19 +02:00
|
|
|
tokenAddress: PropTypes.string,
|
2022-04-02 23:33:35 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
export default DetectedTokenDetails;
|