From a37579f70e10e37ec708d3c24ee63af3912bfef5 Mon Sep 17 00:00:00 2001 From: Tim Date: Wed, 3 Jan 2024 12:15:35 +0100 Subject: [PATCH] fix: see all button was missing on MetaRow --- src/common/MetaRow/MetaRow.js | 36 +++++++++++++++++++++++++---------- src/routes/Board/Board.js | 5 +---- 2 files changed, 27 insertions(+), 14 deletions(-) diff --git a/src/common/MetaRow/MetaRow.js b/src/common/MetaRow/MetaRow.js index 48b5092fc..de56dcdca 100644 --- a/src/common/MetaRow/MetaRow.js +++ b/src/common/MetaRow/MetaRow.js @@ -11,13 +11,21 @@ const useTranslate = require('stremio/common/useTranslate'); const MetaRowPlaceholder = require('./MetaRowPlaceholder'); const styles = require('./styles'); -const MetaRow = ({ className, title, catalog, message, items, itemComponent, deepLinks }) => { +const MetaRow = ({ className, title, catalog, message, itemComponent }) => { const t = useTranslate(); const catalogTitle = React.useMemo(() => { return title ?? t.catalogTitle(catalog); }, [title, catalog]); + const items = React.useMemo(() => { + return catalog?.items ?? catalog?.content?.content; + }, [catalog]); + + const href = React.useMemo(() => { + return catalog?.deepLinks?.discover ?? catalog?.deepLinks?.library; + }, [catalog]); + return (
@@ -28,8 +36,8 @@ const MetaRow = ({ className, title, catalog, message, items, itemComponent, dee null } { - deepLinks && (typeof deepLinks.discover === 'string' || typeof deepLinks.library === 'string') ? - @@ -79,15 +87,23 @@ MetaRow.propTypes = { name: PropTypes.string, }), }), + content: PropTypes.shape({ + content: PropTypes.oneOfType([ + PropTypes.string, + PropTypes.arrayOf(PropTypes.shape({ + posterShape: PropTypes.string, + })), + ]), + }), + items: PropTypes.arrayOf(PropTypes.shape({ + posterShape: PropTypes.string, + })), + deepLinks: PropTypes.shape({ + discover: PropTypes.string, + library: PropTypes.string, + }), }), - items: PropTypes.arrayOf(PropTypes.shape({ - posterShape: PropTypes.string - })), itemComponent: PropTypes.elementType, - deepLinks: PropTypes.shape({ - discover: PropTypes.string, - library: PropTypes.string - }) }; module.exports = MetaRow; diff --git a/src/routes/Board/Board.js b/src/routes/Board/Board.js index f240a1051..2ce84ecaa 100644 --- a/src/routes/Board/Board.js +++ b/src/routes/Board/Board.js @@ -45,9 +45,8 @@ const Board = () => { : null @@ -60,7 +59,6 @@ const Board = () => { key={index} className={classnames(styles['board-row'], styles[`board-row-${catalog.content.content[0].posterShape}`], 'animation-fade-in')} catalog={catalog} - items={catalog.content.content} itemComponent={MetaItem} /> ); @@ -81,7 +79,6 @@ const Board = () => { key={index} className={classnames(styles['board-row'], styles['board-row-poster'], 'animation-fade-in')} catalog={catalog} - deepLinks={catalog.deepLinks} /> ); }