lbry-desktop/ui/js/component/app/index.js
2017-11-17 16:27:35 -05:00

28 lines
1,022 B
JavaScript

import React from "react";
import { connect } from "react-redux";
import {
selectPageTitle,
selectHistoryIndex,
selectActiveHistoryEntry,
} from "redux/selectors/navigation";
import { selectUser } from "redux/selectors/user";
import { doCheckUpgradeAvailable, doAlertError } from "redux/actions/app";
import { doRecordScroll } from "redux/actions/navigation";
import { doFetchRewardedContent } from "redux/actions/content";
import App from "./view";
const select = (state, props) => ({
pageTitle: selectPageTitle(state),
user: selectUser(state),
currentStackIndex: selectHistoryIndex(state),
currentPageAttributes: selectActiveHistoryEntry(state),
});
const perform = dispatch => ({
alertError: errorList => dispatch(doAlertError(errorList)),
checkUpgradeAvailable: () => dispatch(doCheckUpgradeAvailable()),
fetchRewardedContent: () => dispatch(doFetchRewardedContent()),
recordScroll: scrollPosition => dispatch(doRecordScroll(scrollPosition)),
});
export default connect(select, perform)(App);