lbry-desktop/ui/js/page/settings/index.js
2017-08-06 18:55:31 -06:00

24 lines
763 B
JavaScript

import React from "react";
import { connect } from "react-redux";
import { doClearCache } from "actions/app";
import {
doSetDaemonSetting,
doSetClientSetting,
getThemes,
} from "actions/settings";
import { selectDaemonSettings, selectShowNsfw } from "selectors/settings";
import SettingsPage from "./view";
const select = state => ({
daemonSettings: selectDaemonSettings(state),
showNsfw: selectShowNsfw(state),
});
const perform = dispatch => ({
setDaemonSetting: (key, value) => dispatch(doSetDaemonSetting(key, value)),
clearCache: () => dispatch(doClearCache()),
getThemes: () => dispatch(getThemes()),
setClientSetting: (key, value) => dispatch(doSetClientSetting(key, value)),
});
export default connect(select, perform)(SettingsPage);