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.
38 lines
1.2 KiB
38 lines
1.2 KiB
import { connect } from 'react-redux';
|
|
import { createSelector } from 'reselect';
|
|
import { setCalendarDaysCount, setCalendarFilter } 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 {
|
|
filters: calendar.filters,
|
|
selectedFilterKey: calendar.selectedFilterKey,
|
|
showUpcoming: calendar.showUpcoming,
|
|
colorImpairedMode: uiSettings.enableColorImpairedMode,
|
|
hasArtist: !!artistCount
|
|
};
|
|
}
|
|
);
|
|
}
|
|
|
|
function createMapDispatchToProps(dispatch, props) {
|
|
return {
|
|
onDaysCountChange(dayCount) {
|
|
dispatch(setCalendarDaysCount({ dayCount }));
|
|
},
|
|
|
|
onFilterSelect(selectedFilterKey) {
|
|
dispatch(setCalendarFilter({ selectedFilterKey }));
|
|
}
|
|
};
|
|
}
|
|
|
|
export default connect(createMapStateToProps, createMapDispatchToProps)(CalendarPage);
|