1
0
mirror of https://github.com/kremalicious/metamask-extension.git synced 2024-11-29 15:50:28 +01:00
metamask-extension/ui/components/app/detected-token/detected-token-details/detected-token-details.js

59 lines
1.7 KiB
JavaScript
Raw Normal View History

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,
}) => {
return (
2022-05-09 19:47:06 +02:00
<Box
display={DISPLAY.FLEX}
className="detected-token-details"
marginBottom={4}
>
<Identicon
className="detected-token-details__identicon"
2022-05-09 19:47:06 +02:00
address={token.address}
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} />
{token.aggregators.length && (
<DetectedTokenAggregators aggregators={token.aggregators} />
)}
</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,
};
export default DetectedTokenDetails;