3c4ccdd2fe
## Why - No memo required (no transformation). - `makeSelect*` is an incorrect pattern. ## Changes - Replaced makeSelectClientSetting with selectClientSetting. - Remove unused selectShowRepostedContent.
20 lines
884 B
JavaScript
20 lines
884 B
JavaScript
import { connect } from 'react-redux';
|
|
import * as SETTINGS from 'constants/settings';
|
|
import { doSetClientSetting, doSetDarkTime } from 'redux/actions/settings';
|
|
import { selectClientSetting } from 'redux/selectors/settings';
|
|
import ThemeSelector from './view';
|
|
|
|
const select = (state) => ({
|
|
currentTheme: selectClientSetting(state, SETTINGS.THEME),
|
|
themes: selectClientSetting(state, SETTINGS.THEMES),
|
|
automaticDarkModeEnabled: selectClientSetting(state, SETTINGS.AUTOMATIC_DARK_MODE_ENABLED),
|
|
darkModeTimes: selectClientSetting(state, SETTINGS.DARK_MODE_TIMES),
|
|
clock24h: selectClientSetting(state, SETTINGS.CLOCK_24H),
|
|
});
|
|
|
|
const perform = (dispatch) => ({
|
|
setClientSetting: (key, value) => dispatch(doSetClientSetting(key, value)),
|
|
setDarkTime: (time, options) => dispatch(doSetDarkTime(time, options)),
|
|
});
|
|
|
|
export default connect(select, perform)(ThemeSelector);
|