2021-10-27 18:55:14 +02:00
|
|
|
import React from 'react';
|
|
|
|
import PropTypes from 'prop-types';
|
|
|
|
import Box from '../../ui/box';
|
|
|
|
import Button from '../../ui/button';
|
|
|
|
import Typography from '../../ui/typography/typography';
|
2021-11-18 19:30:56 +01:00
|
|
|
import NewCollectiblesNotice from '../new-collectibles-notice';
|
2021-11-26 19:59:46 +01:00
|
|
|
import CollectiblesItems from '../collectibles-items';
|
2021-10-27 18:55:14 +02:00
|
|
|
import {
|
|
|
|
COLORS,
|
|
|
|
TYPOGRAPHY,
|
|
|
|
TEXT_ALIGN,
|
|
|
|
JUSTIFY_CONTENT,
|
|
|
|
FLEX_DIRECTION,
|
2021-11-05 22:23:28 +01:00
|
|
|
FONT_WEIGHT,
|
2021-10-27 18:55:14 +02:00
|
|
|
} from '../../../helpers/constants/design-system';
|
|
|
|
import { useI18nContext } from '../../../hooks/useI18nContext';
|
|
|
|
|
2021-11-26 19:59:46 +01:00
|
|
|
export default function CollectiblesTab({ onAddNFT }) {
|
2021-10-27 18:55:14 +02:00
|
|
|
const collectibles = [];
|
2021-11-26 19:59:46 +01:00
|
|
|
const newNFTsDetected = false;
|
2021-10-27 18:55:14 +02:00
|
|
|
const t = useI18nContext();
|
|
|
|
|
|
|
|
return (
|
2021-11-26 19:59:46 +01:00
|
|
|
<div className="collectibles-tab">
|
2021-10-27 18:55:14 +02:00
|
|
|
{collectibles.length > 0 ? (
|
2021-11-26 19:59:46 +01:00
|
|
|
<CollectiblesItems
|
|
|
|
onAddNFT={onAddNFT}
|
|
|
|
onRefreshList={() => {
|
|
|
|
console.log('refreshing collectibles');
|
|
|
|
}}
|
|
|
|
/>
|
2021-10-27 18:55:14 +02:00
|
|
|
) : (
|
2021-11-18 19:30:56 +01:00
|
|
|
<Box padding={[6, 12, 6, 12]}>
|
|
|
|
{newNFTsDetected ? <NewCollectiblesNotice /> : null}
|
2021-10-27 18:55:14 +02:00
|
|
|
<Box justifyContent={JUSTIFY_CONTENT.CENTER}>
|
2021-11-05 22:23:28 +01:00
|
|
|
<img src="./images/no-nfts.svg" />
|
2021-10-27 18:55:14 +02:00
|
|
|
</Box>
|
2021-11-05 22:23:28 +01:00
|
|
|
<Box
|
|
|
|
marginTop={4}
|
|
|
|
marginBottom={12}
|
|
|
|
justifyContent={JUSTIFY_CONTENT.CENTER}
|
|
|
|
flexDirection={FLEX_DIRECTION.COLUMN}
|
2021-10-27 18:55:14 +02:00
|
|
|
>
|
2021-11-05 22:23:28 +01:00
|
|
|
<Typography
|
|
|
|
color={COLORS.UI3}
|
|
|
|
variant={TYPOGRAPHY.H4}
|
|
|
|
align={TEXT_ALIGN.CENTER}
|
|
|
|
fontWeight={FONT_WEIGHT.BOLD}
|
|
|
|
>
|
|
|
|
{t('noNFTs')}
|
|
|
|
</Typography>
|
2021-10-27 18:55:14 +02:00
|
|
|
<Button
|
|
|
|
type="link"
|
2021-11-05 22:23:28 +01:00
|
|
|
target="_blank"
|
2021-10-27 18:55:14 +02:00
|
|
|
rel="noopener noreferrer"
|
2021-11-05 22:23:28 +01:00
|
|
|
href="https://metamask.zendesk.com/hc/en-us/articles/360058238591-NFT-tokens-in-MetaMask-wallet"
|
|
|
|
style={{ padding: 0, fontSize: '1rem' }}
|
2021-10-27 18:55:14 +02:00
|
|
|
>
|
|
|
|
{t('learnMore')}
|
|
|
|
</Button>
|
|
|
|
</Box>
|
2021-11-05 22:23:28 +01:00
|
|
|
<Box
|
|
|
|
marginBottom={4}
|
|
|
|
justifyContent={JUSTIFY_CONTENT.CENTER}
|
|
|
|
flexDirection={FLEX_DIRECTION.COLUMN}
|
|
|
|
>
|
|
|
|
<Typography
|
|
|
|
color={COLORS.UI3}
|
|
|
|
variant={TYPOGRAPHY.H5}
|
|
|
|
align={TEXT_ALIGN.CENTER}
|
|
|
|
>
|
|
|
|
{t('missingNFT')}
|
|
|
|
</Typography>
|
|
|
|
<Button
|
|
|
|
type="link"
|
|
|
|
onClick={onAddNFT}
|
|
|
|
style={{ padding: 0, fontSize: '1rem' }}
|
|
|
|
>
|
|
|
|
{t('addNFT')}
|
|
|
|
</Button>
|
|
|
|
</Box>
|
2021-10-27 18:55:14 +02:00
|
|
|
</Box>
|
|
|
|
)}
|
|
|
|
</div>
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
2021-11-26 19:59:46 +01:00
|
|
|
CollectiblesTab.propTypes = {
|
2021-10-27 18:55:14 +02:00
|
|
|
onAddNFT: PropTypes.func.isRequired,
|
|
|
|
};
|