mirror of
https://github.com/Stremio/stremio-web.git
synced 2026-04-27 17:53:08 +00:00
forward ref to MetaRow
This commit is contained in:
parent
92ed0cdaa7
commit
473ccafee3
2 changed files with 10 additions and 6 deletions
|
|
@ -10,9 +10,9 @@ const CONSTANTS = require('stremio/common/CONSTANTS');
|
||||||
const MetaRowPlaceholder = require('./MetaRowPlaceholder');
|
const MetaRowPlaceholder = require('./MetaRowPlaceholder');
|
||||||
const styles = require('./styles');
|
const styles = require('./styles');
|
||||||
|
|
||||||
const MetaRow = ({ className, title, message, items, itemComponent, deepLinks, ...props }) => {
|
const MetaRow = React.forwardRef(({ className, title, message, items, itemComponent, deepLinks, ...props }, ref) => {
|
||||||
return (
|
return (
|
||||||
<div {...props} className={classnames(className, styles['meta-row-container'])}>
|
<div {...props} ref={ref} className={classnames(className, styles['meta-row-container'])}>
|
||||||
{
|
{
|
||||||
(typeof title === 'string' && title.length > 0) || (deepLinks && (typeof deepLinks.discover === 'string' || typeof deepLinks.library === 'string')) ?
|
(typeof title === 'string' && title.length > 0) || (deepLinks && (typeof deepLinks.discover === 'string' || typeof deepLinks.library === 'string')) ?
|
||||||
<div className={styles['header-container']}>
|
<div className={styles['header-container']}>
|
||||||
|
|
@ -59,7 +59,9 @@ const MetaRow = ({ className, title, message, items, itemComponent, deepLinks, .
|
||||||
}
|
}
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
};
|
});
|
||||||
|
|
||||||
|
MetaRow.displayName = 'MetaRow';
|
||||||
|
|
||||||
MetaRow.Placeholder = MetaRowPlaceholder;
|
MetaRow.Placeholder = MetaRowPlaceholder;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -8,9 +8,9 @@ const Button = require('stremio/common/Button');
|
||||||
const CONSTANTS = require('stremio/common/CONSTANTS');
|
const CONSTANTS = require('stremio/common/CONSTANTS');
|
||||||
const styles = require('./styles');
|
const styles = require('./styles');
|
||||||
|
|
||||||
const MetaRowPlaceholder = ({ className, title, deepLinks, ...props }) => {
|
const MetaRowPlaceholder = React.forwardRef(({ className, title, deepLinks, ...props }, ref) => {
|
||||||
return (
|
return (
|
||||||
<div {...props} className={classnames(className, styles['meta-row-placeholder-container'])}>
|
<div {...props} ref={ref} className={classnames(className, styles['meta-row-placeholder-container'])}>
|
||||||
<div className={styles['header-container']}>
|
<div className={styles['header-container']}>
|
||||||
<div className={styles['title-container']} title={typeof title === 'string' && title.length > 0 ? title : null}>
|
<div className={styles['title-container']} title={typeof title === 'string' && title.length > 0 ? title : null}>
|
||||||
{typeof title === 'string' && title.length > 0 ? title : null}
|
{typeof title === 'string' && title.length > 0 ? title : null}
|
||||||
|
|
@ -37,7 +37,9 @@ const MetaRowPlaceholder = ({ className, title, deepLinks, ...props }) => {
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
};
|
});
|
||||||
|
|
||||||
|
MetaRowPlaceholder.displayName = 'MetaRowPlaceholder';
|
||||||
|
|
||||||
MetaRowPlaceholder.propTypes = {
|
MetaRowPlaceholder.propTypes = {
|
||||||
className: PropTypes.string,
|
className: PropTypes.string,
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue