import React, { PureComponent } from 'react'; import PropTypes from 'prop-types'; import ToggleButton from '../../../components/ui/toggle-button'; export default class ExperimentalTab extends PureComponent { static contextTypes = { t: PropTypes.func, metricsEvent: PropTypes.func, }; static propTypes = { useTokenDetection: PropTypes.bool, setUseTokenDetection: PropTypes.func, useCollectibleDetection: PropTypes.bool, setUseCollectibleDetection: PropTypes.func, }; renderTokenDetectionToggle() { const { t } = this.context; const { useTokenDetection, setUseTokenDetection } = this.props; return (
{t('useTokenDetection')}
{t('useTokenDetectionDescription')}
{ this.context.metricsEvent({ eventOpts: { category: 'Settings', action: 'Token Detection', name: 'Token Detection', }, }); setUseTokenDetection(!value); }} offLabel={t('off')} onLabel={t('on')} />
); } renderCollectibleDetectionToggle() { const { t } = this.context; const { useCollectibleDetection, setUseCollectibleDetection } = this.props; return (
{t('useCollectibleDetection')}
{t('useCollectibleDetectionDescription')}
{ this.context.metricsEvent({ eventOpts: { category: 'Settings', action: 'Collectible Detection', name: 'Collectible Detection', }, }); setUseCollectibleDetection(!value); }} offLabel={t('off')} onLabel={t('on')} />
); } render() { return (
{this.renderTokenDetectionToggle()} {this.renderCollectibleDetectionToggle()}
); } }