A Metamask fork with Infura removed and default networks editable
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
ciphermask/ui/components/app/import-token-link/import-token-link.component.js

45 lines
1.2 KiB

import React from 'react';
import { useHistory } from 'react-router-dom';
import { useMetricEvent } from '../../../hooks/useMetricEvent';
import { useI18nContext } from '../../../hooks/useI18nContext';
import { ADD_TOKEN_ROUTE } from '../../../helpers/constants/routes';
import Button from '../../ui/button';
import Box from '../../ui/box/box';
import { TEXT_ALIGN } from '../../../helpers/constants/design-system';
import { detectNewTokens } from '../../../store/actions';
export default function ImportTokenLink() {
const addTokenEvent = useMetricEvent({
eventOpts: {
category: 'Navigation',
action: 'Token Menu',
name: 'Clicked "Add Token"',
},
});
const t = useI18nContext();
const history = useHistory();
return (
<Box className="import-token-link" textAlign={TEXT_ALIGN.CENTER}>
<Button
className="import-token-link__link"
type="link"
onClick={() => detectNewTokens()}
>
{t('refreshList')}
</Button>
{' or '}
<Button
className="import-token-link__link"
type="link"
onClick={() => {
history.push(ADD_TOKEN_ROUTE);
addTokenEvent();
}}
>
{t('importTokens')}
</Button>
</Box>
);
}