mirror of
https://github.com/kremalicious/metamask-extension.git
synced 2024-12-23 09:52:26 +01:00
Use variable to check if should display dialog and display dialog
inline. Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com>
This commit is contained in:
parent
409bb00748
commit
1ad80f0ae8
@ -71,25 +71,6 @@ export default class ConfirmPageContainer extends Component {
|
|||||||
contact: PropTypes.object,
|
contact: PropTypes.object,
|
||||||
};
|
};
|
||||||
|
|
||||||
maybeRenderAddContact() {
|
|
||||||
const { t } = this.context;
|
|
||||||
const { showAddToAddressBookModal, toAddress, contact = {} } = this.props;
|
|
||||||
|
|
||||||
if (contact.name || toAddress === undefined) {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
return (
|
|
||||||
<Dialog
|
|
||||||
type="message"
|
|
||||||
className="send__dialog"
|
|
||||||
onClick={() => showAddToAddressBookModal()}
|
|
||||||
>
|
|
||||||
{t('newAccountDetectedDialogMessage')}
|
|
||||||
</Dialog>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
const {
|
const {
|
||||||
showEdit,
|
showEdit,
|
||||||
@ -136,9 +117,14 @@ export default class ConfirmPageContainer extends Component {
|
|||||||
editingGas,
|
editingGas,
|
||||||
handleCloseEditGas,
|
handleCloseEditGas,
|
||||||
currentTransaction,
|
currentTransaction,
|
||||||
|
showAddToAddressBookModal,
|
||||||
|
contact = {},
|
||||||
} = this.props;
|
} = this.props;
|
||||||
const renderAssetImage = contentComponent || !identiconAddress;
|
const renderAssetImage = contentComponent || !identiconAddress;
|
||||||
|
|
||||||
|
const showAddToAddressDialog =
|
||||||
|
contact.name === undefined && toAddress !== undefined;
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="page-container">
|
<div className="page-container">
|
||||||
<ConfirmPageContainerNavigation
|
<ConfirmPageContainerNavigation
|
||||||
@ -171,7 +157,17 @@ export default class ConfirmPageContainer extends Component {
|
|||||||
/>
|
/>
|
||||||
)}
|
)}
|
||||||
</ConfirmPageContainerHeader>
|
</ConfirmPageContainerHeader>
|
||||||
<div>{this.maybeRenderAddContact()}</div>
|
<div>
|
||||||
|
{showAddToAddressDialog && (
|
||||||
|
<Dialog
|
||||||
|
type="message"
|
||||||
|
className="send__dialog"
|
||||||
|
onClick={() => showAddToAddressBookModal()}
|
||||||
|
>
|
||||||
|
{this.context.t('newAccountDetectedDialogMessage')}
|
||||||
|
</Dialog>
|
||||||
|
)}
|
||||||
|
</div>
|
||||||
{contentComponent || (
|
{contentComponent || (
|
||||||
<ConfirmPageContainerContent
|
<ConfirmPageContainerContent
|
||||||
action={action}
|
action={action}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user