1
0
mirror of https://github.com/kremalicious/metamask-extension.git synced 2024-11-30 08:09:15 +01:00
metamask-extension/ui/components/app/app-header/app-header.container.js
David Walsh 4ce6487160
BETA - Add beta banner to all screens (#16307)
* 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>
2022-11-16 11:41:15 -06:00

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);