2021-08-06 04:41:37 +02:00
|
|
|
import { connect } from 'react-redux';
|
2021-10-08 05:47:39 +02:00
|
|
|
import { selectMyChannelUrls } from 'redux/selectors/claims';
|
|
|
|
import * as SETTINGS from 'constants/settings';
|
2021-08-06 04:41:37 +02:00
|
|
|
import { doSetPlayingUri } from 'redux/actions/content';
|
|
|
|
import { doSetClientSetting } from 'redux/actions/settings';
|
2022-03-04 16:29:20 +01:00
|
|
|
import { selectShowMatureContent, makeSelectClientSetting } from 'redux/selectors/settings';
|
2021-08-06 04:41:37 +02:00
|
|
|
import { selectUserVerifiedEmail } from 'redux/selectors/user';
|
2021-08-09 07:50:11 +02:00
|
|
|
|
2021-08-06 04:41:37 +02:00
|
|
|
import SettingContent from './view';
|
|
|
|
|
|
|
|
const select = (state) => ({
|
|
|
|
isAuthenticated: selectUserVerifiedEmail(state),
|
|
|
|
floatingPlayer: makeSelectClientSetting(SETTINGS.FLOATING_PLAYER)(state),
|
2021-09-02 22:05:32 +02:00
|
|
|
autoplayMedia: makeSelectClientSetting(SETTINGS.AUTOPLAY_MEDIA)(state),
|
|
|
|
autoplayNext: makeSelectClientSetting(SETTINGS.AUTOPLAY_NEXT)(state),
|
2021-08-06 04:41:37 +02:00
|
|
|
hideReposts: makeSelectClientSetting(SETTINGS.HIDE_REPOSTS)(state),
|
|
|
|
showNsfw: selectShowMatureContent(state),
|
2021-08-06 09:56:48 +02:00
|
|
|
myChannelUrls: selectMyChannelUrls(state),
|
2021-08-07 14:40:17 +02:00
|
|
|
instantPurchaseEnabled: makeSelectClientSetting(SETTINGS.INSTANT_PURCHASE_ENABLED)(state),
|
|
|
|
instantPurchaseMax: makeSelectClientSetting(SETTINGS.INSTANT_PURCHASE_MAX)(state),
|
2021-08-07 14:50:24 +02:00
|
|
|
enablePublishPreview: makeSelectClientSetting(SETTINGS.ENABLE_PUBLISH_PREVIEW)(state),
|
2021-08-06 04:41:37 +02:00
|
|
|
});
|
|
|
|
|
|
|
|
const perform = (dispatch) => ({
|
|
|
|
setClientSetting: (key, value) => dispatch(doSetClientSetting(key, value)),
|
|
|
|
clearPlayingUri: () => dispatch(doSetPlayingUri({ uri: null })),
|
|
|
|
});
|
|
|
|
|
|
|
|
export default connect(select, perform)(SettingContent);
|