You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
33 lines
893 B
33 lines
893 B
4 years ago
|
import { connect } from 'react-redux';
|
||
|
import { withRouter } from 'react-router-dom';
|
||
|
import { compose } from 'redux';
|
||
7 years ago
|
|
||
4 years ago
|
import * as actions from '../../../store/actions';
|
||
|
import AppHeader from './app-header.component';
|
||
7 years ago
|
|
||
5 years ago
|
const mapStateToProps = (state) => {
|
||
4 years ago
|
const { appState, metamask } = state;
|
||
|
const { networkDropdownOpen } = appState;
|
||
4 years ago
|
const { selectedAddress, isUnlocked, isAccountMenuOpen } = metamask;
|
||
7 years ago
|
|
||
|
return {
|
||
|
networkDropdownOpen,
|
||
|
selectedAddress,
|
||
|
isUnlocked,
|
||
6 years ago
|
isAccountMenuOpen,
|
||
4 years ago
|
};
|
||
|
};
|
||
7 years ago
|
|
||
5 years ago
|
const mapDispatchToProps = (dispatch) => {
|
||
7 years ago
|
return {
|
||
|
showNetworkDropdown: () => dispatch(actions.showNetworkDropdown()),
|
||
|
hideNetworkDropdown: () => dispatch(actions.hideNetworkDropdown()),
|
||
|
toggleAccountMenu: () => dispatch(actions.toggleAccountMenu()),
|
||
4 years ago
|
};
|
||
|
};
|
||
7 years ago
|
|
||
|
export default compose(
|
||
|
withRouter,
|
||
4 years ago
|
connect(mapStateToProps, mapDispatchToProps),
|
||
4 years ago
|
)(AppHeader);
|