3 `<ComposeAdvancedOptionsContainer>`
4 ===================================
6 This container connects `<ComposeAdvancedOptions>` to the Redux store.
10 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
20 import { connect
} from 'react-redux';
22 // Mastodon imports //
23 import { toggleComposeAdvancedOption
} from '../../../../mastodon/actions/compose';
26 import ComposeAdvancedOptions
from '.';
28 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
35 The `mapStateToProps()` function maps various state properties to the
36 props of our component. The only property we care about is
37 `compose.advanced_options`.
41 const mapStateToProps
= state
=> ({
42 values: state
.getIn(['compose', 'advanced_options']),
45 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
52 The `mapDispatchToProps()` function maps dispatches to our store to the
53 various props of our component. We just need to provide a dispatch for
54 when an advanced option toggle changes.
58 const mapDispatchToProps
= dispatch
=> ({
61 dispatch(toggleComposeAdvancedOption(option
));
66 export default connect(mapStateToProps
, mapDispatchToProps
)(ComposeAdvancedOptions
);