import React from 'react'; import { connect } from 'react-redux'; import { defineMessages, injectIntl } from 'react-intl'; import ImmutablePureComponent from 'react-immutable-pure-component'; import PropTypes from 'prop-types'; import ImmutablePropTypes from 'react-immutable-proptypes'; import { changeSetting } from 'gabsocial/actions/settings'; import Column from '../ui/components/column'; import { SimpleForm, FieldsGroup, RadioGroup, RadioItem, SelectDropdown, } from 'gabsocial/features/forms'; import SettingsCheckbox from './components/settings_checkbox'; const messages = defineMessages({ heading: { id: 'column.preferences', defaultMessage: 'Preferences' }, }); // TODO: Pull dynamically const themes = { 'azure': 'Azure', 'purple': 'Purple Light', 'purple-dark': 'Purple Dark', 'purple-contrast': 'Purple Contrast', 'halloween': 'Halloween', 'aquatic': 'Aquatic', 'paleblue': 'Pale Blue', 'lime': 'Lime Green', }; const mapStateToProps = state => ({ settings: state.get('settings'), }); export default @connect(mapStateToProps) @injectIntl class Preferences extends ImmutablePureComponent { static propTypes = { dispatch: PropTypes.func.isRequired, intl: PropTypes.object.isRequired, settings: ImmutablePropTypes.map, }; onThemeChange = e => { const { dispatch } = this.props; dispatch(changeSetting(['theme'], e.target.value)); } onDefaultPrivacyChange = e => { const { dispatch } = this.props; dispatch(changeSetting(['defaultPrivacy'], e.target.value)); } render() { const { settings, intl } = this.props; return (
); } }