mirror of
https://github.com/ecency/ecency-mobile.git
synced 2024-12-21 04:11:50 +03:00
35 lines
717 B
JavaScript
35 lines
717 B
JavaScript
/* eslint-disable no-unused-vars */
|
|
import React from 'react';
|
|
import { connect } from 'react-redux';
|
|
|
|
const AccountContainer = ({
|
|
accounts,
|
|
children,
|
|
currentAccount,
|
|
isLoggedIn,
|
|
isLoginDone,
|
|
username,
|
|
}) => {
|
|
return (
|
|
children &&
|
|
children({
|
|
accounts,
|
|
currentAccount,
|
|
isLoggedIn,
|
|
isLoginDone,
|
|
username,
|
|
})
|
|
);
|
|
};
|
|
|
|
const mapStateToProps = state => ({
|
|
accounts: state.account.otherAccounts,
|
|
currentAccount: state.account.currentAccount,
|
|
isLoggedIn: state.application.isLoggedIn,
|
|
isLoginDone: state.application.isLoginDone,
|
|
username: state.account.currentAccount.name,
|
|
});
|
|
|
|
export default connect(mapStateToProps)(AccountContainer);
|
|
/* eslint-enable */
|