2021-02-04 19:15:23 +01:00
|
|
|
import PropTypes from 'prop-types';
|
|
|
|
import React from 'react';
|
|
|
|
import classnames from 'classnames';
|
|
|
|
import Identicon from '../../../ui/identicon';
|
2019-11-24 23:41:08 +01:00
|
|
|
|
2020-11-03 00:41:28 +01:00
|
|
|
export default function AccountModalContainer(props, context) {
|
2019-11-24 23:41:08 +01:00
|
|
|
const {
|
2020-08-11 18:07:47 +02:00
|
|
|
className,
|
2019-11-24 23:41:08 +01:00
|
|
|
selectedIdentity,
|
|
|
|
showBackButton,
|
|
|
|
backButtonAction,
|
|
|
|
hideModal,
|
|
|
|
children,
|
2021-02-04 19:15:23 +01:00
|
|
|
} = props;
|
2019-11-24 23:41:08 +01:00
|
|
|
|
|
|
|
return (
|
2020-11-03 00:41:28 +01:00
|
|
|
<div
|
|
|
|
className={classnames(className, 'account-modal')}
|
|
|
|
style={{ borderRadius: '4px' }}
|
|
|
|
>
|
2020-08-11 18:07:47 +02:00
|
|
|
<div className="account-modal__container">
|
2019-11-24 23:41:08 +01:00
|
|
|
<div>
|
2020-11-03 00:41:28 +01:00
|
|
|
<Identicon address={selectedIdentity.address} diameter={64} />
|
2019-11-24 23:41:08 +01:00
|
|
|
</div>
|
|
|
|
{showBackButton && (
|
2020-08-11 18:07:47 +02:00
|
|
|
<div className="account-modal__back" onClick={backButtonAction}>
|
2019-11-24 23:41:08 +01:00
|
|
|
<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>
|
2019-11-24 23:41:08 +01:00
|
|
|
</div>
|
|
|
|
)}
|
2020-08-11 18:07:47 +02:00
|
|
|
<button className="account-modal__close" onClick={hideModal} />
|
2019-11-24 23:41:08 +01:00
|
|
|
{children}
|
|
|
|
</div>
|
|
|
|
</div>
|
2021-02-04 19:15:23 +01:00
|
|
|
);
|
2019-11-24 23:41:08 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
AccountModalContainer.contextTypes = {
|
|
|
|
t: PropTypes.func,
|
2021-02-04 19:15:23 +01:00
|
|
|
};
|
2019-11-24 23:41:08 +01:00
|
|
|
|
|
|
|
AccountModalContainer.defaultProps = {
|
|
|
|
showBackButton: false,
|
|
|
|
children: null,
|
2019-11-26 23:44:33 +01:00
|
|
|
backButtonAction: undefined,
|
2021-02-04 19:15:23 +01:00
|
|
|
};
|
2019-11-24 23:41:08 +01:00
|
|
|
|
|
|
|
AccountModalContainer.propTypes = {
|
2020-08-11 18:07:47 +02:00
|
|
|
className: PropTypes.string,
|
2019-11-24 23:41:08 +01:00
|
|
|
selectedIdentity: PropTypes.object.isRequired,
|
|
|
|
showBackButton: PropTypes.bool,
|
2019-11-26 23:44:33 +01:00
|
|
|
backButtonAction: PropTypes.func,
|
2019-11-24 23:41:08 +01:00
|
|
|
hideModal: PropTypes.func.isRequired,
|
|
|
|
children: PropTypes.node,
|
2021-02-04 19:15:23 +01:00
|
|
|
};
|