From e8d8dfa76bd23e8ec685ff0d4af8b37d365cb398 Mon Sep 17 00:00:00 2001 From: saltrafael <76502841+saltrafael@users.noreply.github.com> Date: Fri, 10 Sep 2021 14:27:21 -0300 Subject: [PATCH] Playlist fall out fixes (#7032) * Add snack bar notification * Fix and improve code * Better handle paid content on playlists * Fix menu options that show for unauth users --- ui/component/autoplayCountdown/view.jsx | 53 ++++-- ui/component/claimMenuList/index.js | 11 +- ui/component/claimMenuList/view.jsx | 176 ++++++++++---------- ui/component/claimPreviewTile/view.jsx | 12 +- ui/component/collectionActions/index.js | 20 +-- ui/component/collectionActions/view.jsx | 36 ++-- ui/component/collectionMenuList/index.js | 20 ++- ui/component/collectionMenuList/view.jsx | 31 ++-- ui/component/collectionPreviewTile/view.jsx | 13 +- ui/component/common/icon-custom.jsx | 6 + ui/component/fileRenderFloating/index.js | 26 ++- ui/component/fileRenderFloating/view.jsx | 112 ++++++++++--- ui/component/fileRenderInitiator/index.js | 1 - ui/component/fileRenderInitiator/view.jsx | 33 ++-- ui/component/uriIndicator/view.jsx | 4 +- ui/component/viewers/videoViewer/index.js | 23 ++- ui/component/viewers/videoViewer/view.jsx | 54 +++--- ui/constants/icons.js | 1 + ui/redux/actions/content.js | 23 +-- ui/redux/actions/settings.js | 6 + ui/util/url.js | 6 + 21 files changed, 391 insertions(+), 276 deletions(-) diff --git a/ui/component/autoplayCountdown/view.jsx b/ui/component/autoplayCountdown/view.jsx index 938f32851..f1fd4b78f 100644 --- a/ui/component/autoplayCountdown/view.jsx +++ b/ui/component/autoplayCountdown/view.jsx @@ -15,8 +15,11 @@ type Props = { nextRecommendedClaim: ?StreamClaim, nextRecommendedUri: string, modal: { id: string, modalProps: {} }, + skipPaid: boolean, doNavigate: () => void, doReplay: () => void, + doPrevious: () => void, + onCanceled: () => void, }; function AutoplayCountdown(props: Props) { @@ -25,8 +28,11 @@ function AutoplayCountdown(props: Props) { nextRecommendedClaim, history: { push }, modal, + skipPaid, doNavigate, doReplay, + doPrevious, + onCanceled, } = props; const nextTitle = nextRecommendedClaim && nextRecommendedClaim.value && nextRecommendedClaim.value.title; @@ -68,6 +74,7 @@ function AutoplayCountdown(props: Props) { interval = setInterval(() => { const newTime = timer - 1; if (newTime === 0) { + if (skipPaid) setTimer(countdownTime); doNavigate(); } else { setTimer(timer - 1); @@ -78,7 +85,7 @@ function AutoplayCountdown(props: Props) { return () => { clearInterval(interval); }; - }, [timer, doNavigate, push, timerCanceled, isTimerPaused, nextRecommendedUri]); + }, [timer, doNavigate, push, timerCanceled, isTimerPaused, nextRecommendedUri, skipPaid]); if (timerCanceled || !nextRecommendedUri) { return null; @@ -105,19 +112,41 @@ function AutoplayCountdown(props: Props) { )} {!isTimerPaused && (
- {__('Playing in %seconds_left% seconds...', { seconds_left: timer })}{' '} -
)} -