1
0
mirror of https://github.com/kremalicious/metamask-extension.git synced 2024-12-05 15:35:46 +01:00
metamask-extension/ui/components/app/modals/account-modal-container/account-modal-container.component.js

58 lines
1.4 KiB
JavaScript
Raw Normal View History

import PropTypes from 'prop-types';
import React from 'react';
import classnames from 'classnames';
import Identicon from '../../../ui/identicon';
2020-11-03 00:41:28 +01:00
export default function AccountModalContainer(props, context) {
const {
className,
selectedIdentity,
showBackButton,
backButtonAction,
hideModal,
children,
} = props;
return (
2020-11-03 00:41:28 +01:00
<div
className={classnames(className, 'account-modal')}
style={{ borderRadius: '4px' }}
>
<div className="account-modal__container">
<div>
2020-11-03 00:41:28 +01:00
<Identicon address={selectedIdentity.address} diameter={64} />
</div>
{showBackButton && (
<div className="account-modal__back" onClick={backButtonAction}>
<i className="fa fa-angle-left fa-lg" />
2020-11-03 00:41:28 +01:00
<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 = {
className: PropTypes.string,
selectedIdentity: PropTypes.object.isRequired,
showBackButton: PropTypes.bool,
backButtonAction: PropTypes.func,
hideModal: PropTypes.func.isRequired,
children: PropTypes.node,
};