2022-04-02 23:33:35 +02:00
|
|
|
import React from 'react';
|
|
|
|
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-05-09 19:47:06 +02:00
|
|
|
const DetectedTokenDetails = ({
|
|
|
|
token,
|
|
|
|
handleTokenSelection,
|
|
|
|
tokensListDetected,
|
|
|
|
}) => {
|
2022-04-02 23:33:35 +02:00
|
|
|
return (
|
2022-05-09 19:47:06 +02:00
|
|
|
<Box
|
|
|
|
display={DISPLAY.FLEX}
|
|
|
|
className="detected-token-details"
|
|
|
|
marginBottom={4}
|
|
|
|
>
|
2022-04-02 23:33:35 +02:00
|
|
|
<Identicon
|
|
|
|
className="detected-token-details__identicon"
|
2022-05-09 19:47:06 +02:00
|
|
|
address={token.address}
|
2022-04-02 23:33:35 +02:00
|
|
|
diameter={40}
|
|
|
|
/>
|
|
|
|
<Box
|
|
|
|
display={DISPLAY.GRID}
|
|
|
|
marginLeft={2}
|
|
|
|
className="detected-token-details__data"
|
|
|
|
>
|
2022-05-09 19:47:06 +02:00
|
|
|
<DetectedTokenValues
|
|
|
|
token={token}
|
|
|
|
handleTokenSelection={handleTokenSelection}
|
|
|
|
tokensListDetected={tokensListDetected}
|
|
|
|
/>
|
|
|
|
<DetectedTokenAddress tokenAddress={token.address} />
|
|
|
|
<DetectedTokenAggregators aggregators={token.aggregators} />
|
2022-04-02 23:33:35 +02:00
|
|
|
</Box>
|
|
|
|
</Box>
|
|
|
|
);
|
|
|
|
};
|
|
|
|
|
|
|
|
DetectedTokenDetails.propTypes = {
|
2022-05-09 19:47:06 +02:00
|
|
|
token: PropTypes.shape({
|
|
|
|
address: PropTypes.string.isRequired,
|
|
|
|
decimals: PropTypes.number,
|
|
|
|
symbol: PropTypes.string,
|
|
|
|
iconUrl: PropTypes.string,
|
|
|
|
aggregators: PropTypes.array,
|
|
|
|
}),
|
|
|
|
handleTokenSelection: PropTypes.func.isRequired,
|
|
|
|
tokensListDetected: PropTypes.object,
|
2022-04-02 23:33:35 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
export default DetectedTokenDetails;
|