diff --git a/src/renderer/component/videoOverlay/index.js b/src/renderer/component/videoOverlay/index.js index 75a249ad7..09574a725 100644 --- a/src/renderer/component/videoOverlay/index.js +++ b/src/renderer/component/videoOverlay/index.js @@ -1,9 +1,14 @@ import { connect } from 'react-redux'; import { selectPlayingUri } from 'redux/selectors/content'; +import { doSetPlayingUri } from 'redux/actions/content'; import VideoOverlay from './view'; const select = state => ({ playingUri: selectPlayingUri(state), }); -export default connect(select, null)(VideoOverlay); +const perform = dispatch => ({ + cancelPlay: () => dispatch(doSetPlayingUri(null)), +}); + +export default connect(select, perform)(VideoOverlay); diff --git a/src/renderer/component/videoOverlay/view.jsx b/src/renderer/component/videoOverlay/view.jsx index 13119e9f2..a2baca81f 100644 --- a/src/renderer/component/videoOverlay/view.jsx +++ b/src/renderer/component/videoOverlay/view.jsx @@ -1,22 +1,22 @@ // @flow import React from 'react'; import Video from 'component/video'; -import FileActions from 'component/fileActions'; import Overlay from 'component/overlay'; +import VideoOverlayHeader from '../videoOverlayHeader'; type Props = { + cancelPlay: () => void, playingUri: ?string, }; class VideoOverlay extends React.Component { render() { - const { playingUri } = this.props; + const { playingUri, cancelPlay } = this.props; + if (!playingUri) return ''; return ( -
- -
- {playingUri ?
); } diff --git a/src/renderer/component/videoOverlayHeader/index.js b/src/renderer/component/videoOverlayHeader/index.js new file mode 100644 index 000000000..c50ab5bcb --- /dev/null +++ b/src/renderer/component/videoOverlayHeader/index.js @@ -0,0 +1,10 @@ +import { connect } from 'react-redux'; +import { makeSelectTitleForUri } from 'lbry-redux'; +import VideoOverlayHeader from './view'; + +const select = (state, props) => ({ + title: makeSelectTitleForUri(props.uri)(state), + onClose: props.onClose, +}); + +export default connect(select, null)(VideoOverlayHeader); diff --git a/src/renderer/component/videoOverlayHeader/view.jsx b/src/renderer/component/videoOverlayHeader/view.jsx new file mode 100644 index 000000000..d923c9d05 --- /dev/null +++ b/src/renderer/component/videoOverlayHeader/view.jsx @@ -0,0 +1,31 @@ +// @flow +import React from 'react'; +import Button from 'component/button'; +import * as icons from 'constants/icons'; +import TruncatedText from 'component/common/truncated-text'; + +type Props = { + onClose: () => void, + title: string, +}; + +class VideoOverlayHeader extends React.Component { + render() { + const { onClose, title } = this.props; + return ( +
+

+ {title} +

+
+ ); + } +} + +export default VideoOverlayHeader; diff --git a/src/renderer/scss/component/_overlay.scss b/src/renderer/scss/component/_overlay.scss index 3592b1105..f9480a101 100644 --- a/src/renderer/scss/component/_overlay.scss +++ b/src/renderer/scss/component/_overlay.scss @@ -8,21 +8,21 @@ right: 1%; z-index: 3; box-shadow: var(--box-shadow-layer); +} - &:hover .button-close { - display: inline-block; - background: rgba(0, 0, 0, 0.5); - position: absolute; - height: 22px; - width: 22px; - top: 0px; - right: 0px; - color: #000; - text-align: center; - cursor: pointer; - z-index: 4; +.video_overlay__header { + flex-direction: row; + justify-content: space-between; + align-items: center; + flex-wrap: nowrap; + display: flex; + width: 100%; + height: 2rem; + background-color: var(--header-primary-color); + padding: 20px 10px; + + .overlay__title--small { + font-size: 15px; + line-height: 15px; } } -.overlay .button-close { - display: none; -} diff --git a/src/renderer/scss/component/_video_overlay.scss b/src/renderer/scss/component/_video_overlay.scss new file mode 100644 index 000000000..e69de29bb