copyToClipboard(plainKey)}
+ />
+ )
+ }
+
+ renderButtons (privateKey, address, hideModal) {
+ return (
+
+ {!privateKey && (
+
+ )}
+ {
+ privateKey
+ ? (
+
+ )
+ : (
+
+ )
+ }
+
+ )
+ }
+
+ render () {
+ const {
+ selectedIdentity,
+ warning,
+ showAccountDetailModal,
+ hideModal,
+ previousModalState,
+ } = this.props
+ const { name, address } = selectedIdentity
+
+ const {
+ privateKey,
+ showWarning,
+ } = this.state
+
+ return (
+ showAccountDetailModal()}
+ >
+ {name}
+
+
+ {this.context.t('showPrivateKeys')}
+
+ {this.renderPasswordLabel(privateKey)}
+ {this.renderPasswordInput(privateKey)}
+ {
+ (showWarning && warning)
+ ? {warning}
+ : null
+ }
+
+ {this.context.t('privateKeyWarning')}
+ {this.renderButtons(privateKey, address, hideModal)}
+
+ )
+ }
+}
diff --git a/ui/app/components/app/modals/export-private-key-modal/export-private-key-modal.container.js b/ui/app/components/app/modals/export-private-key-modal/export-private-key-modal.container.js
new file mode 100644
index 000000000..1b8f63c94
--- /dev/null
+++ b/ui/app/components/app/modals/export-private-key-modal/export-private-key-modal.container.js
@@ -0,0 +1,38 @@
+import { connect } from 'react-redux'
+import { exportAccount, hideWarning, showModal, hideModal } from '../../../../store/actions'
+import { getSelectedIdentity } from '../../../../selectors/selectors'
+import ExportPrivateKeyModal from './export-private-key-modal.component'
+
+function mapStateToPropsFactory () {
+ let selectedIdentity = null
+ return function mapStateToProps (state) {
+ // We should **not** change the identity displayed here even if it changes from underneath us.
+ // If we do, we will be showing the user one private key and a **different** address and name.
+ // Note that the selected identity **will** change from underneath us when we unlock the keyring
+ // which is the expected behavior that we are side-stepping.
+ selectedIdentity = selectedIdentity || getSelectedIdentity(state)
+ return {
+ warning: state.appState.warning,
+ privateKey: state.appState.accountDetail.privateKey,
+ network: state.metamask.network,
+ selectedIdentity,
+ previousModalState: state.appState.modal.previousModalState.name,
+ }
+ }
+}
+
+function mapDispatchToProps (dispatch) {
+ return {
+ exportAccount: (password, address) => {
+ return dispatch(exportAccount(password, address))
+ .then((res) => {
+ dispatch(hideWarning())
+ return res
+ })
+ },
+ showAccountDetailModal: () => dispatch(showModal({ name: 'ACCOUNT_DETAILS' })),
+ hideModal: () => dispatch(hideModal()),
+ }
+}
+
+export default connect(mapStateToPropsFactory, mapDispatchToProps)(ExportPrivateKeyModal)
diff --git a/ui/app/components/app/modals/export-private-key-modal/index.js b/ui/app/components/app/modals/export-private-key-modal/index.js
new file mode 100644
index 000000000..996c995ca
--- /dev/null
+++ b/ui/app/components/app/modals/export-private-key-modal/index.js
@@ -0,0 +1 @@
+export { default } from './export-private-key-modal.container'
diff --git a/ui/app/components/app/modals/modal.js b/ui/app/components/app/modals/modal.js
index ada758b99..27162bdd5 100644
--- a/ui/app/components/app/modals/modal.js
+++ b/ui/app/components/app/modals/modal.js
@@ -12,7 +12,7 @@ const { ENVIRONMENT_TYPE_POPUP } = require('../../../../../app/scripts/lib/enums
// Modal Components
const DepositEtherModal = require('./deposit-ether-modal')
import AccountDetailsModal from './account-details-modal'
-const ExportPrivateKeyModal = require('./export-private-key-modal')
+const ExportPrivateKeyModal = require('./export-private-key-modal').default
const HideTokenConfirmationModal = require('./hide-token-confirmation-modal')
const NotifcationModal = require('./notification-modal')
const QRScanner = require('./qr-scanner')