mirror of
https://github.com/Stremio/stremio-web.git
synced 2026-04-20 19:02:15 +00:00
showbutton linked to metadetails page
This commit is contained in:
parent
cccca66241
commit
4c09156e02
2 changed files with 23 additions and 2 deletions
|
|
@ -23,7 +23,7 @@ const ALLOWED_LINK_REDIRECTS = [
|
|||
routesRegexp.metadetails.regexp
|
||||
];
|
||||
|
||||
const MetaPreview = ({ className, compact, name, logo, background, runtime, releaseInfo, released, description, links, trailerStreams, inLibrary, toggleInLibrary }) => {
|
||||
const MetaPreview = ({ className, compact, name, logo, background, runtime, releaseInfo, released, description, deepLinks, links, trailerStreams, inLibrary, toggleInLibrary }) => {
|
||||
const [shareModalOpen, openShareModal, closeShareModal] = useBinaryState(false);
|
||||
const linksGroups = React.useMemo(() => {
|
||||
return Array.isArray(links) ?
|
||||
|
|
@ -70,6 +70,21 @@ const MetaPreview = ({ className, compact, name, logo, background, runtime, rele
|
|||
:
|
||||
new Map();
|
||||
}, [links]);
|
||||
const href = React.useMemo(() => {
|
||||
return deepLinks ?
|
||||
typeof deepLinks.player === 'string' ?
|
||||
deepLinks.player
|
||||
:
|
||||
typeof deepLinks.metaDetailsStreams === 'string' ?
|
||||
deepLinks.metaDetailsStreams
|
||||
:
|
||||
typeof deepLinks.metaDetailsVideos === 'string' ?
|
||||
deepLinks.metaDetailsVideos
|
||||
:
|
||||
null
|
||||
:
|
||||
null;
|
||||
}, [deepLinks]);
|
||||
const trailerHref = React.useMemo(() => {
|
||||
if (!Array.isArray(trailerStreams) || trailerStreams.length === 0) {
|
||||
return null;
|
||||
|
|
@ -200,7 +215,7 @@ const MetaPreview = ({ className, compact, name, logo, background, runtime, rele
|
|||
icon={'ic_play'}
|
||||
label={'Show'}
|
||||
tabIndex={compact ? -1 : 0}
|
||||
href={'#'}
|
||||
href={href}
|
||||
/>
|
||||
}
|
||||
{
|
||||
|
|
@ -245,6 +260,11 @@ MetaPreview.propTypes = {
|
|||
releaseInfo: PropTypes.string,
|
||||
released: PropTypes.instanceOf(Date),
|
||||
description: PropTypes.string,
|
||||
deepLinks: PropTypes.shape({
|
||||
metaDetailsVideos: PropTypes.string,
|
||||
metaDetailsStreams: PropTypes.string,
|
||||
player: PropTypes.string
|
||||
}),
|
||||
links: PropTypes.arrayOf(PropTypes.shape({
|
||||
category: PropTypes.string,
|
||||
name: PropTypes.string,
|
||||
|
|
|
|||
|
|
@ -165,6 +165,7 @@ const Discover = ({ urlParams, queryParams }) => {
|
|||
releaseInfo={selectedMetaItem.releaseInfo}
|
||||
released={selectedMetaItem.released}
|
||||
description={selectedMetaItem.description}
|
||||
deepLinks={selectedMetaItem.deepLinks}
|
||||
trailerStreams={selectedMetaItem.trailerStreams}
|
||||
inLibrary={selectedMetaItem.inLibrary}
|
||||
toggleInLibrary={selectedMetaItem.inLibrary ? removeFromLibrary : addToLibrary}
|
||||
|
|
|
|||
Loading…
Reference in a new issue