diff --git a/src/components/Common/ButtonWithDropdown/index.tsx b/src/components/Common/ButtonWithDropdown/index.tsx index ecca1e15..054ecaea 100644 --- a/src/components/Common/ButtonWithDropdown/index.tsx +++ b/src/components/Common/ButtonWithDropdown/index.tsx @@ -92,8 +92,8 @@ const ButtonWithDropdown: React.FC = ({ > {text} - - {children && ( + {children && ( + - )} - -
-
-
{children}
+ +
+
+
{children}
+
-
- - + + + )} ); }; diff --git a/src/components/MovieDetails/index.tsx b/src/components/MovieDetails/index.tsx index 55bbeb93..1859c95b 100644 --- a/src/components/MovieDetails/index.tsx +++ b/src/components/MovieDetails/index.tsx @@ -417,10 +417,17 @@ const MovieDetails: React.FC = ({ movie }) => { } }} > - {data.mediaInfo?.plexUrl || - (data.mediaInfo?.plexUrl4k && - (hasPermission(Permission.REQUEST_4K) || - hasPermission(Permission.REQUEST_4K_MOVIE))) ? ( + {( + trailerUrl + ? data.mediaInfo?.plexUrl || + (data.mediaInfo?.plexUrl4k && + (hasPermission(Permission.REQUEST_4K) || + hasPermission(Permission.REQUEST_4K_MOVIE))) + : data.mediaInfo?.plexUrl && + data.mediaInfo?.plexUrl4k && + (hasPermission(Permission.REQUEST_4K) || + hasPermission(Permission.REQUEST_4K_MOVIE)) + ) ? ( <> {data.mediaInfo?.plexUrl && data.mediaInfo?.plexUrl4k && @@ -435,17 +442,16 @@ const MovieDetails: React.FC = ({ movie }) => { {intl.formatMessage(messages.play4konplex)} )} - {(data.mediaInfo?.plexUrl || data.mediaInfo?.plexUrl4k) && - trailerUrl && ( - { - window.open(trailerUrl, '_blank'); - }} - buttonType="ghost" - > - {intl.formatMessage(messages.watchtrailer)} - - )} + {trailerUrl && ( + { + window.open(trailerUrl, '_blank'); + }} + buttonType="ghost" + > + {intl.formatMessage(messages.watchtrailer)} + + )} ) : null} diff --git a/src/components/TvDetails/index.tsx b/src/components/TvDetails/index.tsx index fd6170e6..2ad62883 100644 --- a/src/components/TvDetails/index.tsx +++ b/src/components/TvDetails/index.tsx @@ -443,35 +443,41 @@ const TvDetails: React.FC = ({ tv }) => { } }} > - {data.mediaInfo?.plexUrl || - (data.mediaInfo?.plexUrl4k && - (hasPermission(Permission.REQUEST_4K) || - hasPermission(Permission.REQUEST_4K_TV))) ? ( - <> - {data.mediaInfo?.plexUrl && + {( + trailerUrl + ? data.mediaInfo?.plexUrl || + (data.mediaInfo?.plexUrl4k && + (hasPermission(Permission.REQUEST_4K) || + hasPermission(Permission.REQUEST_4K_TV))) + : data.mediaInfo?.plexUrl && data.mediaInfo?.plexUrl4k && (hasPermission(Permission.REQUEST_4K) || - hasPermission(Permission.REQUEST_4K_TV)) && ( - { - window.open(data.mediaInfo?.plexUrl4k, '_blank'); - }} - buttonType="ghost" - > - {intl.formatMessage(messages.play4konplex)} - - )} - {(data.mediaInfo?.plexUrl || data.mediaInfo?.plexUrl4k) && - trailerUrl && ( - { - window.open(trailerUrl, '_blank'); - }} - buttonType="ghost" - > - {intl.formatMessage(messages.watchtrailer)} - - )} + hasPermission(Permission.REQUEST_4K_TV)) + ) ? ( + <> + {data.mediaInfo?.plexUrl && + data.mediaInfo?.plexUrl4k && + (hasPermission(Permission.REQUEST_4K) || + hasPermission(Permission.REQUEST_4K_TV)) ? ( + { + window.open(data.mediaInfo?.plexUrl4k, '_blank'); + }} + buttonType="ghost" + > + {intl.formatMessage(messages.play4konplex)} + + ) : null} + {trailerUrl ? ( + { + window.open(trailerUrl, '_blank'); + }} + buttonType="ghost" + > + {intl.formatMessage(messages.watchtrailer)} + + ) : null} ) : null}