mirror of
https://github.com/kremalicious/metamask-extension.git
synced 2024-12-12 04:37:13 +01:00
4ce6487160
* Add beta home banner to home screen * Move the beta home notification to the app-header * Updates to formatting * Add beta home banner to home screen * Move the beta home notification to the app-header * Updates to formatting * Update ui/components/app/app-header/index.scss Co-authored-by: George Marshall <george.marshall@consensys.net> * Update ui/components/app/app-header/index.scss Co-authored-by: George Marshall <george.marshall@consensys.net> * Update ui/components/app/app-header/index.scss Co-authored-by: George Marshall <george.marshall@consensys.net> * Move banner to top of page * Move to own folder, update styles * Swith to BOX component * Address feedback * Add tests * Update name of component * Fix tests * Fix proptype errors * Fixups * Remove unrelated changes * Remove unwanted string changes * Update beta component name and text * Update mock data Co-authored-by: George Marshall <george.marshall@consensys.net>
55 lines
1.5 KiB
JavaScript
55 lines
1.5 KiB
JavaScript
import { connect } from 'react-redux';
|
|
import { withRouter } from 'react-router-dom';
|
|
import { compose } from 'redux';
|
|
import {
|
|
///: BEGIN:ONLY_INCLUDE_IN(flask)
|
|
getUnreadNotificationsCount,
|
|
///: END:ONLY_INCLUDE_IN
|
|
///: BEGIN:ONLY_INCLUDE_IN(beta)
|
|
getShowBetaHeader,
|
|
///: END:ONLY_INCLUDE_IN
|
|
} from '../../../selectors';
|
|
|
|
import * as actions from '../../../store/actions';
|
|
import AppHeader from './app-header.component';
|
|
|
|
const mapStateToProps = (state) => {
|
|
const { appState, metamask } = state;
|
|
const { networkDropdownOpen } = appState;
|
|
const { selectedAddress, isUnlocked, isAccountMenuOpen } = metamask;
|
|
|
|
///: BEGIN:ONLY_INCLUDE_IN(flask)
|
|
const unreadNotificationsCount = getUnreadNotificationsCount(state);
|
|
///: END:ONLY_INCLUDE_IN
|
|
|
|
///: BEGIN:ONLY_INCLUDE_IN(beta)
|
|
const showBetaHeader = getShowBetaHeader(state);
|
|
///: END:ONLY_INCLUDE_IN
|
|
|
|
return {
|
|
networkDropdownOpen,
|
|
selectedAddress,
|
|
isUnlocked,
|
|
isAccountMenuOpen,
|
|
///: BEGIN:ONLY_INCLUDE_IN(flask)
|
|
unreadNotificationsCount,
|
|
///: END:ONLY_INCLUDE_IN
|
|
///: BEGIN:ONLY_INCLUDE_IN(beta)
|
|
showBetaHeader,
|
|
///: END:ONLY_INCLUDE_IN
|
|
};
|
|
};
|
|
|
|
const mapDispatchToProps = (dispatch) => {
|
|
return {
|
|
showNetworkDropdown: () => dispatch(actions.showNetworkDropdown()),
|
|
hideNetworkDropdown: () => dispatch(actions.hideNetworkDropdown()),
|
|
toggleAccountMenu: () => dispatch(actions.toggleAccountMenu()),
|
|
};
|
|
};
|
|
|
|
export default compose(
|
|
withRouter,
|
|
connect(mapStateToProps, mapDispatchToProps),
|
|
)(AppHeader);
|