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.
68 lines
1.9 KiB
68 lines
1.9 KiB
4 years ago
|
import { connect } from 'react-redux';
|
||
|
import { withRouter } from 'react-router-dom';
|
||
|
import { compose } from 'redux';
|
||
5 years ago
|
import {
|
||
|
getNetworkIdentifier,
|
||
5 years ago
|
getPreferences,
|
||
4 years ago
|
isNetworkLoading,
|
||
5 years ago
|
submittedPendingTransactionsSelector,
|
||
4 years ago
|
} from '../../selectors';
|
||
5 years ago
|
import {
|
||
|
hideSidebar,
|
||
|
lockMetamask,
|
||
|
setCurrentCurrency,
|
||
|
setLastActiveTime,
|
||
|
setMouseUserState,
|
||
4 years ago
|
} from '../../store/actions';
|
||
|
import { pageChanged } from '../../ducks/history/history';
|
||
|
import { prepareToLeaveSwaps } from '../../ducks/swaps/swaps';
|
||
|
import Routes from './routes.component';
|
||
5 years ago
|
|
||
4 years ago
|
function mapStateToProps(state) {
|
||
4 years ago
|
const { appState } = state;
|
||
5 years ago
|
const {
|
||
|
sidebar,
|
||
|
alertOpen,
|
||
|
alertMessage,
|
||
|
isLoading,
|
||
|
loadingMessage,
|
||
4 years ago
|
} = appState;
|
||
|
const { autoLockTimeLimit = 0 } = getPreferences(state);
|
||
5 years ago
|
|
||
|
return {
|
||
|
sidebar,
|
||
|
alertOpen,
|
||
|
alertMessage,
|
||
|
textDirection: state.metamask.textDirection,
|
||
|
isLoading,
|
||
|
loadingMessage,
|
||
|
isUnlocked: state.metamask.isUnlocked,
|
||
|
submittedPendingTransactions: submittedPendingTransactionsSelector(state),
|
||
4 years ago
|
isNetworkLoading: isNetworkLoading(state),
|
||
5 years ago
|
provider: state.metamask.provider,
|
||
|
frequentRpcListDetail: state.metamask.frequentRpcListDetail || [],
|
||
|
currentCurrency: state.metamask.currentCurrency,
|
||
|
isMouseUser: state.appState.isMouseUser,
|
||
|
providerId: getNetworkIdentifier(state),
|
||
|
autoLockTimeLimit,
|
||
4 years ago
|
};
|
||
5 years ago
|
}
|
||
|
|
||
4 years ago
|
function mapDispatchToProps(dispatch) {
|
||
5 years ago
|
return {
|
||
|
lockMetaMask: () => dispatch(lockMetamask(false)),
|
||
|
hideSidebar: () => dispatch(hideSidebar()),
|
||
|
setCurrentCurrencyToUSD: () => dispatch(setCurrentCurrency('usd')),
|
||
4 years ago
|
setMouseUserState: (isMouseUser) =>
|
||
|
dispatch(setMouseUserState(isMouseUser)),
|
||
5 years ago
|
setLastActiveTime: () => dispatch(setLastActiveTime()),
|
||
5 years ago
|
pageChanged: (path) => dispatch(pageChanged(path)),
|
||
4 years ago
|
prepareToLeaveSwaps: () => dispatch(prepareToLeaveSwaps()),
|
||
4 years ago
|
};
|
||
5 years ago
|
}
|
||
|
|
||
4 years ago
|
export default compose(
|
||
|
withRouter,
|
||
|
connect(mapStateToProps, mapDispatchToProps),
|
||
4 years ago
|
)(Routes);
|