Skip to content

Commit

Permalink
fix: cast ui shows replay button when seeking after replay (#343)
Browse files Browse the repository at this point in the history
Somehow when `BottomBar/TopBar` returns `undefined` it causes duplication of `SeekBar` creation. So handle casting+ended logic via css style
  • Loading branch information
yairans committed Feb 4, 2019
1 parent e7f83bb commit ac98217
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 4 deletions.
4 changes: 4 additions & 0 deletions src/components/bottom-bar/_bottom-bar.scss
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@
left: 0;
z-index: 1;

&.hide {
display: none;
}

.left-controls {
float: left;
text-align: left;
Expand Down
5 changes: 3 additions & 2 deletions src/components/bottom-bar/bottom-bar.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,12 +35,13 @@ class BottomBar extends Component {
* @memberof BottomBar
*/
render(props: any): ?React$Element<any> {
const styleClass = [style.bottomBar];
if (props.isCasting && props.isPlaybackEnded) {
return undefined;
styleClass.push(style.hide);
}
return (
<div
className={style.bottomBar}
className={styleClass.join(' ')}
onMouseOver={() => this.props.updateBottomBarHoverActive(true)}
onMouseLeave={() => this.props.updateBottomBarHoverActive(false)}>
{props.children}
Expand Down
4 changes: 4 additions & 0 deletions src/components/top-bar/_top-bar.scss
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,10 @@
left: 0;
pointer-events: none;

&.hide {
display: none;
}

.left-controls {
text-align: left;
min-width: 0;
Expand Down
5 changes: 3 additions & 2 deletions src/components/top-bar/top-bar.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,11 @@ class TopBar extends Component {
* @memberof TopBar
*/
render(props: any): ?React$Element<any> {
const styleClass = [style.topBar];
if (props.isCasting && props.isPlaybackEnded) {
return undefined;
styleClass.push(style.hide);
}
return <div className={style.topBar}>{props.children}</div>;
return <div className={styleClass.join(' ')}>{props.children}</div>;
}
}

Expand Down

0 comments on commit ac98217

Please sign in to comment.