import React, { PureComponent } from 'react'
import PropTypes from 'prop-types'
import ToggleButton from '../../../components/ui/toggle-button'
import { REVEAL_SEED_ROUTE } from '../../../helpers/constants/routes'
import Button from '../../../components/ui/button'
export default class SecurityTab extends PureComponent {
static contextTypes = {
t: PropTypes.func,
metricsEvent: PropTypes.func,
}
static propTypes = {
warning: PropTypes.string,
history: PropTypes.object,
participateInMetaMetrics: PropTypes.bool,
setParticipateInMetaMetrics: PropTypes.func,
showIncomingTransactions: PropTypes.bool,
setShowIncomingTransactionsFeatureFlag: PropTypes.func,
}
renderSeedWords () {
const { t } = this.context
const { history } = this.props
return (
{ t('revealSeedWords') }
)
}
renderMetaMetricsOptIn () {
const { t } = this.context
const { participateInMetaMetrics, setParticipateInMetaMetrics } = this.props
return (
{ t('participateInMetaMetrics') }
{ t('participateInMetaMetricsDescription') }
setParticipateInMetaMetrics(!value)}
offLabel={t('off')}
onLabel={t('on')}
/>
)
}
renderIncomingTransactionsOptIn () {
const { t } = this.context
const { showIncomingTransactions, setShowIncomingTransactionsFeatureFlag } = this.props
return (
{ t('showIncomingTransactions') }
{ t('showIncomingTransactionsDescription') }
setShowIncomingTransactionsFeatureFlag(!value)}
offLabel={t('off')}
onLabel={t('on')}
/>
)
}
renderContent () {
const { warning } = this.props
return (
{ warning &&
{ warning }
}
{ this.renderSeedWords() }
{ this.renderIncomingTransactionsOptIn() }
{ this.renderMetaMetricsOptIn() }
)
}
render () {
return this.renderContent()
}
}