You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
37 lines
1.1 KiB
37 lines
1.1 KiB
import { connect } from 'react-redux';
|
|
import { createSelector } from 'reselect';
|
|
import { setCalendarDaysCount, setCalendarIncludeUnmonitored } from 'Store/Actions/calendarActions';
|
|
import createArtistCountSelector from 'Store/Selectors/createArtistCountSelector';
|
|
import createUISettingsSelector from 'Store/Selectors/createUISettingsSelector';
|
|
import CalendarPage from './CalendarPage';
|
|
|
|
function createMapStateToProps() {
|
|
return createSelector(
|
|
(state) => state.calendar,
|
|
createArtistCountSelector(),
|
|
createUISettingsSelector(),
|
|
(calendar, artistCount, uiSettings) => {
|
|
return {
|
|
unmonitored: calendar.unmonitored,
|
|
showUpcoming: calendar.showUpcoming,
|
|
colorImpairedMode: uiSettings.enableColorImpairedMode,
|
|
hasArtist: !!artistCount
|
|
};
|
|
}
|
|
);
|
|
}
|
|
|
|
function createMapDispatchToProps(dispatch, props) {
|
|
return {
|
|
onDaysCountChange(dayCount) {
|
|
dispatch(setCalendarDaysCount({ dayCount }));
|
|
},
|
|
|
|
onUnmonitoredChange(unmonitored) {
|
|
dispatch(setCalendarIncludeUnmonitored({ unmonitored }));
|
|
}
|
|
};
|
|
}
|
|
|
|
export default connect(createMapStateToProps, createMapDispatchToProps)(CalendarPage);
|