Sticky App bar for fullscreen

master
Håvar Aambø Fosstveit 2020-03-18 00:50:50 +01:00
parent 8ba29338d1
commit 11de9a2dba
1 changed files with 7 additions and 3 deletions

View File

@ -83,6 +83,7 @@ const FullScreenView = (props) =>
consumer, consumer,
toggleConsumerFullscreen, toggleConsumerFullscreen,
toolbarsVisible, toolbarsVisible,
stickyAppBar,
classes classes
} = props; } = props;
@ -105,7 +106,7 @@ const FullScreenView = (props) =>
<div className={classes.controls}> <div className={classes.controls}>
<div <div
className={classnames(classes.button, { className={classnames(classes.button, {
visible : toolbarsVisible visible : toolbarsVisible || stickyAppBar
})} })}
onClick={(e) => onClick={(e) =>
{ {
@ -134,13 +135,15 @@ FullScreenView.propTypes =
consumer : appPropTypes.Consumer, consumer : appPropTypes.Consumer,
toggleConsumerFullscreen : PropTypes.func.isRequired, toggleConsumerFullscreen : PropTypes.func.isRequired,
toolbarsVisible : PropTypes.bool, toolbarsVisible : PropTypes.bool,
stickyAppBar : PropTypes.bool,
classes : PropTypes.object.isRequired classes : PropTypes.object.isRequired
}; };
const mapStateToProps = (state) => const mapStateToProps = (state) =>
({ ({
consumer : state.consumers[state.room.fullScreenConsumer], consumer : state.consumers[state.room.fullScreenConsumer],
toolbarsVisible : state.room.toolbarsVisible toolbarsVisible : state.room.toolbarsVisible,
stickyAppBar : state.settings.stickyAppBar
}); });
const mapDispatchToProps = (dispatch) => const mapDispatchToProps = (dispatch) =>
@ -162,7 +165,8 @@ export default connect(
return ( return (
prev.consumers[prev.room.fullScreenConsumer] === prev.consumers[prev.room.fullScreenConsumer] ===
next.consumers[next.room.fullScreenConsumer] && next.consumers[next.room.fullScreenConsumer] &&
prev.room.toolbarsVisible === next.room.toolbarsVisible prev.room.toolbarsVisible === next.room.toolbarsVisible &&
prev.settings.stickyAppBar === next.settings.stickyAppBar
); );
} }
} }