2020-10-01 17:33:03 -07:00
|
|
|
import { connect } from 'react-redux';
|
|
|
|
import { changeSetting, getSettings } from 'soapbox/actions/settings';
|
2021-07-01 14:43:28 -07:00
|
|
|
import { injectIntl } from 'react-intl';
|
2020-10-01 17:33:03 -07:00
|
|
|
import ThemeToggle from './theme_toggle';
|
|
|
|
|
|
|
|
const mapStateToProps = state => {
|
|
|
|
return {
|
2021-07-01 14:43:28 -07:00
|
|
|
themeMode: getSettings(state).get('themeMode'),
|
2020-10-01 17:33:03 -07:00
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
const mapDispatchToProps = (dispatch) => ({
|
|
|
|
onToggle(setting) {
|
|
|
|
dispatch(changeSetting(['themeMode'], setting));
|
|
|
|
},
|
|
|
|
});
|
|
|
|
|
2021-07-01 14:43:28 -07:00
|
|
|
export default injectIntl(connect(mapStateToProps, mapDispatchToProps)(ThemeToggle));
|