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.
35 lines
900 B
35 lines
900 B
4 years ago
|
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';
|
||
6 years ago
|
|
||
4 years ago
|
export default function AddTokenButton() {
|
||
5 years ago
|
const addTokenEvent = useMetricEvent({
|
||
|
eventOpts: {
|
||
|
category: 'Navigation',
|
||
|
action: 'Token Menu',
|
||
|
name: 'Clicked "Add Token"',
|
||
|
},
|
||
4 years ago
|
});
|
||
|
const t = useI18nContext();
|
||
|
const history = useHistory();
|
||
6 years ago
|
|
||
5 years ago
|
return (
|
||
|
<div className="add-token-button">
|
||
|
<Button
|
||
|
className="add-token-button__button"
|
||
|
type="secondary"
|
||
|
rounded
|
||
|
onClick={() => {
|
||
4 years ago
|
history.push(ADD_TOKEN_ROUTE);
|
||
|
addTokenEvent();
|
||
5 years ago
|
}}
|
||
|
>
|
||
|
{t('addToken')}
|
||
|
</Button>
|
||
|
</div>
|
||
4 years ago
|
);
|
||
6 years ago
|
}
|