2021-07-25 14:52:45 +02:00
|
|
|
import { connect } from 'react-redux';
|
2021-10-17 10:36:14 +02:00
|
|
|
import * as SETTINGS from 'constants/settings';
|
2021-07-25 14:52:45 +02:00
|
|
|
import { doSetClientSetting } from 'redux/actions/settings';
|
2021-11-23 05:29:04 +01:00
|
|
|
import { selectClientSetting } from 'redux/selectors/settings';
|
2021-07-25 14:52:45 +02:00
|
|
|
import SettingCommentsServer from './view';
|
|
|
|
|
|
|
|
const select = (state) => ({
|
2021-11-23 05:29:04 +01:00
|
|
|
customServerEnabled: selectClientSetting(state, SETTINGS.CUSTOM_COMMENTS_SERVER_ENABLED),
|
|
|
|
customServerUrl: selectClientSetting(state, SETTINGS.CUSTOM_COMMENTS_SERVER_URL),
|
2021-07-25 14:52:45 +02:00
|
|
|
});
|
|
|
|
|
|
|
|
const perform = (dispatch) => ({
|
|
|
|
setCustomServerEnabled: (val) => dispatch(doSetClientSetting(SETTINGS.CUSTOM_COMMENTS_SERVER_ENABLED, val, true)),
|
|
|
|
setCustomServerUrl: (url) => dispatch(doSetClientSetting(SETTINGS.CUSTOM_COMMENTS_SERVER_URL, url, true)),
|
|
|
|
});
|
|
|
|
|
|
|
|
export default connect(select, perform)(SettingCommentsServer);
|