mirror of
https://github.com/kremalicious/metamask-extension.git
synced 2024-12-23 09:52:26 +01:00
The account details close button is difficult to click from the e2e tests because it has a size of zero. The actual icon is added via CSS as an `::after` pseudo-element. The CSS has been adjusted to give the icon a size, and it the markup is now a `button` rather than a `div`.
53 lines
1.3 KiB
JavaScript
53 lines
1.3 KiB
JavaScript
import PropTypes from 'prop-types'
|
|
import React from 'react'
|
|
import Identicon from '../../../ui/identicon'
|
|
|
|
export default function AccountModalContainer (props, context) {
|
|
const {
|
|
selectedIdentity,
|
|
showBackButton,
|
|
backButtonAction,
|
|
hideModal,
|
|
children,
|
|
} = props
|
|
|
|
return (
|
|
<div style={{ borderRadius: '4px' }}>
|
|
<div className="account-modal-container">
|
|
<div>
|
|
<Identicon
|
|
address={selectedIdentity.address}
|
|
diameter={64}
|
|
/>
|
|
</div>
|
|
{showBackButton && (
|
|
<div className="account-modal-back" onClick={backButtonAction}>
|
|
<i className="fa fa-angle-left fa-lg" />
|
|
<span className="account-modal-back__text">{' ' + context.t('back')}</span>
|
|
</div>
|
|
)}
|
|
<button className="account-modal-close" onClick={hideModal} />
|
|
{children}
|
|
</div>
|
|
</div>
|
|
)
|
|
}
|
|
|
|
AccountModalContainer.contextTypes = {
|
|
t: PropTypes.func,
|
|
}
|
|
|
|
AccountModalContainer.defaultProps = {
|
|
showBackButton: false,
|
|
children: null,
|
|
backButtonAction: undefined,
|
|
}
|
|
|
|
AccountModalContainer.propTypes = {
|
|
selectedIdentity: PropTypes.object.isRequired,
|
|
showBackButton: PropTypes.bool,
|
|
backButtonAction: PropTypes.func,
|
|
hideModal: PropTypes.func.isRequired,
|
|
children: PropTypes.node,
|
|
}
|