|
|
|
@ -1,4 +1,5 @@ |
|
|
|
|
import React from 'react'; |
|
|
|
|
import PropTypes from 'prop-types'; |
|
|
|
|
import { useHistory } from 'react-router-dom'; |
|
|
|
|
import { useMetricEvent } from '../../../hooks/useMetricEvent'; |
|
|
|
|
import { useI18nContext } from '../../../hooks/useI18nContext'; |
|
|
|
@ -8,7 +9,7 @@ import Box from '../../ui/box/box'; |
|
|
|
|
import { TEXT_ALIGN } from '../../../helpers/constants/design-system'; |
|
|
|
|
import { detectNewTokens } from '../../../store/actions'; |
|
|
|
|
|
|
|
|
|
export default function ImportTokenLink() { |
|
|
|
|
export default function ImportTokenLink({ isMainnet }) { |
|
|
|
|
const addTokenEvent = useMetricEvent({ |
|
|
|
|
eventOpts: { |
|
|
|
|
category: 'Navigation', |
|
|
|
@ -21,14 +22,18 @@ export default function ImportTokenLink() { |
|
|
|
|
|
|
|
|
|
return ( |
|
|
|
|
<Box className="import-token-link" textAlign={TEXT_ALIGN.CENTER}> |
|
|
|
|
<Button |
|
|
|
|
className="import-token-link__link" |
|
|
|
|
type="link" |
|
|
|
|
onClick={() => detectNewTokens()} |
|
|
|
|
> |
|
|
|
|
{t('refreshList')} |
|
|
|
|
</Button> |
|
|
|
|
{' or '} |
|
|
|
|
{isMainnet && ( |
|
|
|
|
<> |
|
|
|
|
<Button |
|
|
|
|
className="import-token-link__link" |
|
|
|
|
type="link" |
|
|
|
|
onClick={() => detectNewTokens()} |
|
|
|
|
> |
|
|
|
|
{t('refreshList')} |
|
|
|
|
</Button> |
|
|
|
|
{t('or')} |
|
|
|
|
</> |
|
|
|
|
)} |
|
|
|
|
<Button |
|
|
|
|
className="import-token-link__link" |
|
|
|
|
type="link" |
|
|
|
@ -37,8 +42,15 @@ export default function ImportTokenLink() { |
|
|
|
|
addTokenEvent(); |
|
|
|
|
}} |
|
|
|
|
> |
|
|
|
|
{t('importTokens')} |
|
|
|
|
{isMainnet |
|
|
|
|
? t('importTokens') |
|
|
|
|
: t('importTokens').charAt(0).toUpperCase() + |
|
|
|
|
t('importTokens').slice(1)} |
|
|
|
|
</Button> |
|
|
|
|
</Box> |
|
|
|
|
); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
ImportTokenLink.propTypes = { |
|
|
|
|
isMainnet: PropTypes.bool, |
|
|
|
|
}; |
|
|
|
|