import React, { PureComponent } from 'react';
import PropTypes from 'prop-types';
import ToggleButton from '../../../components/ui/toggle-button';
import {
getNumberOfSettingsInSection,
handleSettingsRefs,
} from '../../../helpers/utils/settings-search';
import { MetaMetricsEventCategory } from '../../../../shared/constants/metametrics';
import { Text, Box } from '../../../components/component-library';
import {
TextColor,
TextVariant,
FontWeight,
///: BEGIN:ONLY_INCLUDE_IN(desktop)
Display,
FlexDirection,
JustifyContent,
///: END:ONLY_INCLUDE_IN
} from '../../../helpers/constants/design-system';
///: BEGIN:ONLY_INCLUDE_IN(desktop)
import DesktopEnableButton from '../../../components/app/desktop-enable-button';
///: END:ONLY_INCLUDE_IN
export default class ExperimentalTab extends PureComponent {
static contextTypes = {
t: PropTypes.func,
trackEvent: PropTypes.func,
};
static propTypes = {
transactionSecurityCheckEnabled: PropTypes.bool,
setTransactionSecurityCheckEnabled: PropTypes.func,
///: BEGIN:ONLY_INCLUDE_IN(blockaid)
securityAlertsEnabled: PropTypes.bool,
setSecurityAlertsEnabled: PropTypes.func,
///: END:ONLY_INCLUDE_IN
};
settingsRefs = Array(
getNumberOfSettingsInSection(
this.context.t,
this.context.t('experimental'),
),
)
.fill(undefined)
.map(() => {
return React.createRef();
});
componentDidUpdate() {
const { t } = this.context;
handleSettingsRefs(t, t('experimental'), this.settingsRefs);
}
componentDidMount() {
const { t } = this.context;
handleSettingsRefs(t, t('experimental'), this.settingsRefs);
}
///: BEGIN:ONLY_INCLUDE_IN(blockaid)
renderSecurityAlertsToggle() {
const { t } = this.context;
const { securityAlertsEnabled, setSecurityAlertsEnabled } = this.props;
return (
<>