mirror of
https://github.com/Stremio/stremio-web.git
synced 2026-03-13 06:26:41 +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 });
|
||||
}
|
||||
|
||||
onClick = (event) => {
|
||||
event.preventDefault();
|
||||
if (typeof this.props.onClick === 'function') {
|
||||
this.props.onClick();
|
||||
}
|
||||
}
|
||||
|
||||
renderProgress() {
|
||||
if (this.props.progress === 0) {
|
||||
return null;
|
||||
|
|
@ -92,10 +99,10 @@ class MetaItem extends Component {
|
|||
|
||||
render() {
|
||||
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.renderInfoBar()}
|
||||
</div>
|
||||
</a>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
@ -103,6 +110,7 @@ class MetaItem extends Component {
|
|||
MetaItem.propTypes = {
|
||||
className: PropTypes.string,
|
||||
popupClassName: PropTypes.string,
|
||||
onClick: PropTypes.func,
|
||||
type: PropTypes.string.isRequired,
|
||||
relativeSize: PropTypes.oneOf(['auto', 'height']).isRequired,
|
||||
posterShape: PropTypes.oneOf(['poster', 'landscape', 'square']).isRequired,
|
||||
|
|
|
|||
|
|
@ -74,7 +74,7 @@
|
|||
}
|
||||
}
|
||||
|
||||
&:hover {
|
||||
&:hover, &:focus {
|
||||
cursor: pointer;
|
||||
padding: 0;
|
||||
border: calc(var(--progress-bar-size) * 0.5) solid white;
|
||||
|
|
|
|||
Loading…
Reference in a new issue