lbry-desktop/ui/component/themeSelector/index.js
infinite-persistence 3c4ccdd2fe
Kill makeSelectClientSetting
## Why
- No memo required (no transformation).
- `makeSelect*` is an incorrect pattern.

## Changes
- Replaced makeSelectClientSetting with selectClientSetting.
- Remove unused selectShowRepostedContent.
2021-11-23 12:29:53 +08:00

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);