import React, { PureComponent } from 'react';
import PropTypes from 'prop-types';
import { Redirect } from 'react-router-dom';
import Button from '../../../../components/ui/button/button.component';
import TextField from '../../../../components/ui/text-field';
import PageContainerFooter from '../../../../components/ui/page-container/page-container-footer';
import {
isBurnAddress,
isValidHexAddress,
} from '../../../../../shared/modules/hexstring-utils';
import {
AvatarAccount,
AvatarAccountSize,
Box,
Text,
} from '../../../../components/component-library';
import {
AlignItems,
Display,
TextVariant,
} from '../../../../helpers/constants/design-system';
export default class EditContact extends PureComponent {
static contextTypes = {
t: PropTypes.func,
};
static propTypes = {
addToAddressBook: PropTypes.func,
removeFromAddressBook: PropTypes.func,
history: PropTypes.object,
name: PropTypes.string,
address: PropTypes.string,
chainId: PropTypes.string,
memo: PropTypes.string,
viewRoute: PropTypes.string,
listRoute: PropTypes.string,
};
static defaultProps = {
name: '',
memo: '',
};
state = {
newName: this.props.name,
newAddress: this.props.address,
newMemo: this.props.memo,
error: '',
};
render() {
const { t } = this.context;
const {
address,
addToAddressBook,
chainId,
history,
listRoute,
memo,
name,
removeFromAddressBook,
viewRoute,
} = this.props;
if (!address) {
return