From 944069e41199d877d47cfe95122bc09f9dab7492 Mon Sep 17 00:00:00 2001 From: "Timothy Z." Date: Wed, 11 Dec 2024 11:38:36 +0200 Subject: [PATCH 1/3] refactor(StreamsList): addons install button --- .../MetaDetails/StreamsList/StreamsList.js | 19 ++++++++++++++----- .../MetaDetails/StreamsList/styles.less | 11 +++++++++++ 2 files changed, 25 insertions(+), 5 deletions(-) diff --git a/src/routes/MetaDetails/StreamsList/StreamsList.js b/src/routes/MetaDetails/StreamsList/StreamsList.js index 840664c8b..aa204000a 100644 --- a/src/routes/MetaDetails/StreamsList/StreamsList.js +++ b/src/routes/MetaDetails/StreamsList/StreamsList.js @@ -23,7 +23,7 @@ const StreamsList = ({ className, video, ...props }) => { if (video.deepLinks && typeof video.deepLinks.metaDetailsVideos === 'string') { window.location.replace(video.deepLinks.metaDetailsVideos + ( typeof video.season === 'number' ? - `?${new URLSearchParams({'season': video.season})}` + `?${new URLSearchParams({ 'season': video.season })}` : null )); @@ -157,13 +157,22 @@ const StreamsList = ({ className, video, ...props }) => { onClick={stream.onClick} /> ))} + } - + { + Object.keys(streamsByAddon).length < 2 && props.streams.every((streams) => streams.content.type === 'Ready') ? + + : + null + } ); }; diff --git a/src/routes/MetaDetails/StreamsList/styles.less b/src/routes/MetaDetails/StreamsList/styles.less index c22b14071..9859ea2d0 100644 --- a/src/routes/MetaDetails/StreamsList/styles.less +++ b/src/routes/MetaDetails/StreamsList/styles.less @@ -151,6 +151,17 @@ background-color: var(--secondary-accent-color); border-radius: 3rem; + &.streams { + padding: 1rem; + margin: 1rem auto; + max-width: 50%; + border-radius: 2rem; + + .label { + font-size: 1rem; + } + } + &:hover { outline: var(--focus-outline-size) solid var(--secondary-accent-color); background-color: transparent; From 203c04b8c872c26f0d9a27762a43b07119a5cc70 Mon Sep 17 00:00:00 2001 From: "Timothy Z." Date: Wed, 11 Dec 2024 11:48:17 +0200 Subject: [PATCH 2/3] refactor: logic for showing the button --- src/routes/MetaDetails/StreamsList/StreamsList.js | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/src/routes/MetaDetails/StreamsList/StreamsList.js b/src/routes/MetaDetails/StreamsList/StreamsList.js index aa204000a..05d3c94fc 100644 --- a/src/routes/MetaDetails/StreamsList/StreamsList.js +++ b/src/routes/MetaDetails/StreamsList/StreamsList.js @@ -157,15 +157,20 @@ const StreamsList = ({ className, video, ...props }) => { onClick={stream.onClick} /> ))} - + { + Object.keys(streamsByAddon).length > 1 ? + + : + null + } } { - Object.keys(streamsByAddon).length < 2 && props.streams.every((streams) => streams.content.type === 'Ready') ? + Object.keys(streamsByAddon).length < 2 && countLoadingAddons === 0 ?