mirror of
https://github.com/lidarr/lidarr.git
synced 2025-07-14 00:53:57 -07:00
33 lines
1,013 B
JavaScript
33 lines
1,013 B
JavaScript
import { connect } from 'react-redux';
|
|
import { createSelector } from 'reselect';
|
|
import { setCalendarDaysCount, setCalendarIncludeUnmonitored } from 'Store/Actions/calendarActions';
|
|
import createUISettingsSelector from 'Store/Selectors/createUISettingsSelector';
|
|
import CalendarPage from './CalendarPage';
|
|
|
|
function createMapStateToProps() {
|
|
return createSelector(
|
|
(state) => state.calendar,
|
|
createUISettingsSelector(),
|
|
(calendar, uiSettings) => {
|
|
return {
|
|
unmonitored: calendar.unmonitored,
|
|
showUpcoming: calendar.showUpcoming,
|
|
colorImpairedMode: uiSettings.enableColorImpairedMode
|
|
};
|
|
}
|
|
);
|
|
}
|
|
|
|
function createMapDispatchToProps(dispatch, props) {
|
|
return {
|
|
onDaysCountChange(dayCount) {
|
|
dispatch(setCalendarDaysCount({ dayCount }));
|
|
},
|
|
|
|
onUnmonitoredChange(unmonitored) {
|
|
dispatch(setCalendarIncludeUnmonitored({ unmonitored }));
|
|
}
|
|
};
|
|
}
|
|
|
|
export default connect(createMapStateToProps, createMapDispatchToProps)(CalendarPage);
|