mirror of
https://github.com/Stremio/stremio-web.git
synced 2026-05-04 18:09:07 +00:00
MetaItem click/focus implemented
This commit is contained in:
parent
778c70e6f2
commit
d117fe86ec
2 changed files with 11 additions and 3 deletions
|
|
@ -22,6 +22,13 @@ class MetaItem extends Component {
|
||||||
this.setState({ menuPopupOpen: false });
|
this.setState({ menuPopupOpen: false });
|
||||||
}
|
}
|
||||||
|
|
||||||
|
onClick = (event) => {
|
||||||
|
event.preventDefault();
|
||||||
|
if (typeof this.props.onClick === 'function') {
|
||||||
|
this.props.onClick();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
renderProgress() {
|
renderProgress() {
|
||||||
if (this.props.progress === 0) {
|
if (this.props.progress === 0) {
|
||||||
return null;
|
return null;
|
||||||
|
|
@ -92,10 +99,10 @@ class MetaItem extends Component {
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
return (
|
return (
|
||||||
<div className={classnames(styles['meta-item-container'], styles[`relative-size-${this.props.relativeSize}`], styles[`poster-shape-${this.props.posterShape}`], this.props.className)}>
|
<a className={classnames(styles['meta-item-container'], styles[`relative-size-${this.props.relativeSize}`], styles[`poster-shape-${this.props.posterShape}`], this.props.className)} href="#" onClick={this.onClick}>
|
||||||
{this.renderPoster()}
|
{this.renderPoster()}
|
||||||
{this.renderInfoBar()}
|
{this.renderInfoBar()}
|
||||||
</div>
|
</a>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -103,6 +110,7 @@ class MetaItem extends Component {
|
||||||
MetaItem.propTypes = {
|
MetaItem.propTypes = {
|
||||||
className: PropTypes.string,
|
className: PropTypes.string,
|
||||||
popupClassName: PropTypes.string,
|
popupClassName: PropTypes.string,
|
||||||
|
onClick: PropTypes.func,
|
||||||
type: PropTypes.string.isRequired,
|
type: PropTypes.string.isRequired,
|
||||||
relativeSize: PropTypes.oneOf(['auto', 'height']).isRequired,
|
relativeSize: PropTypes.oneOf(['auto', 'height']).isRequired,
|
||||||
posterShape: PropTypes.oneOf(['poster', 'landscape', 'square']).isRequired,
|
posterShape: PropTypes.oneOf(['poster', 'landscape', 'square']).isRequired,
|
||||||
|
|
|
||||||
|
|
@ -74,7 +74,7 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
&:hover {
|
&:hover, &:focus {
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
padding: 0;
|
padding: 0;
|
||||||
border: calc(var(--progress-bar-size) * 0.5) solid white;
|
border: calc(var(--progress-bar-size) * 0.5) solid white;
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue