2021-08-06 04:41:37 +02:00
|
|
|
import { connect } from 'react-redux';
|
2021-10-17 10:36:14 +02:00
|
|
|
import { selectMyChannelUrls } from 'redux/selectors/claims';
|
|
|
|
import * as SETTINGS from 'constants/settings';
|
2021-08-06 04:41:37 +02:00
|
|
|
import { doOpenModal } from 'redux/actions/app';
|
|
|
|
import { doSetPlayingUri } from 'redux/actions/content';
|
|
|
|
import { doSetClientSetting } from 'redux/actions/settings';
|
2021-11-23 05:29:04 +01:00
|
|
|
import { selectShowMatureContent, selectLanguage, selectClientSetting } 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),
|
2021-11-23 05:29:04 +01:00
|
|
|
floatingPlayer: selectClientSetting(state, SETTINGS.FLOATING_PLAYER),
|
|
|
|
autoplayMedia: selectClientSetting(state, SETTINGS.AUTOPLAY_MEDIA),
|
|
|
|
autoplayNext: selectClientSetting(state, SETTINGS.AUTOPLAY_NEXT),
|
|
|
|
hideReposts: selectClientSetting(state, SETTINGS.HIDE_REPOSTS),
|
2022-01-05 22:20:43 +01:00
|
|
|
hideScheduledLivestreams: selectClientSetting(state, SETTINGS.HIDE_SCHEDULED_LIVESTREAMS),
|
2021-08-06 04:41:37 +02:00
|
|
|
showNsfw: selectShowMatureContent(state),
|
2021-08-06 09:56:48 +02:00
|
|
|
myChannelUrls: selectMyChannelUrls(state),
|
2021-11-23 05:29:04 +01:00
|
|
|
instantPurchaseEnabled: selectClientSetting(state, SETTINGS.INSTANT_PURCHASE_ENABLED),
|
|
|
|
instantPurchaseMax: selectClientSetting(state, SETTINGS.INSTANT_PURCHASE_MAX),
|
|
|
|
enablePublishPreview: selectClientSetting(state, SETTINGS.ENABLE_PUBLISH_PREVIEW),
|
2021-08-09 07:50:11 +02:00
|
|
|
language: selectLanguage(state),
|
2021-08-06 04:41:37 +02:00
|
|
|
});
|
|
|
|
|
|
|
|
const perform = (dispatch) => ({
|
|
|
|
setClientSetting: (key, value) => dispatch(doSetClientSetting(key, value)),
|
|
|
|
clearPlayingUri: () => dispatch(doSetPlayingUri({ uri: null })),
|
|
|
|
openModal: (id, params) => dispatch(doOpenModal(id, params)),
|
|
|
|
});
|
|
|
|
|
|
|
|
export default connect(select, perform)(SettingContent);
|