mirror of
https://github.com/lidarr/Lidarr
synced 2025-02-26 07:42:49 +00:00
Fixed: Collapse calendar view buttons on smaller screens
This commit is contained in:
parent
b258fc2e1d
commit
63253bf9e3
2 changed files with 16 additions and 1 deletions
|
@ -84,6 +84,7 @@ class CalendarHeader extends Component {
|
||||||
end,
|
end,
|
||||||
longDateFormat,
|
longDateFormat,
|
||||||
isSmallScreen,
|
isSmallScreen,
|
||||||
|
collapseViewButtons,
|
||||||
onTodayPress,
|
onTodayPress,
|
||||||
onPreviousPress,
|
onPreviousPress,
|
||||||
onNextPress
|
onNextPress
|
||||||
|
@ -146,7 +147,7 @@ class CalendarHeader extends Component {
|
||||||
}
|
}
|
||||||
|
|
||||||
{
|
{
|
||||||
isSmallScreen ?
|
collapseViewButtons ?
|
||||||
<Menu
|
<Menu
|
||||||
className={styles.viewMenu}
|
className={styles.viewMenu}
|
||||||
alignMenu={align.RIGHT}
|
alignMenu={align.RIGHT}
|
||||||
|
@ -159,6 +160,18 @@ class CalendarHeader extends Component {
|
||||||
</MenuButton>
|
</MenuButton>
|
||||||
|
|
||||||
<MenuContent>
|
<MenuContent>
|
||||||
|
{
|
||||||
|
isSmallScreen ?
|
||||||
|
null :
|
||||||
|
<ViewMenuItem
|
||||||
|
name={calendarViews.MONTH}
|
||||||
|
selectedView={view}
|
||||||
|
onPress={this.onViewChange}
|
||||||
|
>
|
||||||
|
Month
|
||||||
|
</ViewMenuItem>
|
||||||
|
}
|
||||||
|
|
||||||
<ViewMenuItem
|
<ViewMenuItem
|
||||||
name={calendarViews.WEEK}
|
name={calendarViews.WEEK}
|
||||||
selectedView={view}
|
selectedView={view}
|
||||||
|
@ -244,6 +257,7 @@ CalendarHeader.propTypes = {
|
||||||
end: PropTypes.string.isRequired,
|
end: PropTypes.string.isRequired,
|
||||||
view: PropTypes.oneOf(calendarViews.all).isRequired,
|
view: PropTypes.oneOf(calendarViews.all).isRequired,
|
||||||
isSmallScreen: PropTypes.bool.isRequired,
|
isSmallScreen: PropTypes.bool.isRequired,
|
||||||
|
collapseViewButtons: PropTypes.bool.isRequired,
|
||||||
longDateFormat: PropTypes.string.isRequired,
|
longDateFormat: PropTypes.string.isRequired,
|
||||||
onViewChange: PropTypes.func.isRequired,
|
onViewChange: PropTypes.func.isRequired,
|
||||||
onTodayPress: PropTypes.func.isRequired,
|
onTodayPress: PropTypes.func.isRequired,
|
||||||
|
|
|
@ -23,6 +23,7 @@ function createMapStateToProps() {
|
||||||
]);
|
]);
|
||||||
|
|
||||||
result.isSmallScreen = dimensions.isSmallScreen;
|
result.isSmallScreen = dimensions.isSmallScreen;
|
||||||
|
result.collapseViewButtons = dimensions.isLargeScreen;
|
||||||
result.longDateFormat = uiSettings.longDateFormat;
|
result.longDateFormat = uiSettings.longDateFormat;
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
|
|
Loading…
Reference in a new issue