From f1c335815f2f17465cdd36ceb223e78a58149b3b Mon Sep 17 00:00:00 2001 From: Brandon Cohen Date: Tue, 16 Feb 2021 02:16:14 -0500 Subject: [PATCH] fix(frontend): changed plex, request, and cog buttons to align properly on smaller mobile UIs (#928) --- src/components/MovieDetails/index.tsx | 154 ++++++++++++------------ src/components/TvDetails/index.tsx | 164 +++++++++++++------------- 2 files changed, 161 insertions(+), 157 deletions(-) diff --git a/src/components/MovieDetails/index.tsx b/src/components/MovieDetails/index.tsx index e8af7eeb5..9d64d2fe6 100644 --- a/src/components/MovieDetails/index.tsx +++ b/src/components/MovieDetails/index.tsx @@ -352,7 +352,7 @@ const MovieDetails: React.FC = ({ movie }) => {
{data.mediaInfo && data.mediaInfo.status !== MediaStatus.UNKNOWN && ( - + 0} @@ -394,93 +394,95 @@ const MovieDetails: React.FC = ({ movie }) => { ))}
-
+
{(trailerUrl || data.mediaInfo?.plexUrl || data.mediaInfo?.plexUrl4k) && ( - - - - - - - {data.mediaInfo?.plexUrl - ? intl.formatMessage(messages.playonplex) - : data.mediaInfo?.plexUrl4k && - (hasPermission(Permission.REQUEST_4K) || - hasPermission(Permission.REQUEST_4K_MOVIE)) - ? intl.formatMessage(messages.playonplex) - : intl.formatMessage(messages.watchtrailer)} - - - } - onClick={() => { - if (data.mediaInfo?.plexUrl) { - window.open(data.mediaInfo?.plexUrl, '_blank'); - } else if (data.mediaInfo?.plexUrl4k) { - window.open(data.mediaInfo?.plexUrl4k, '_blank'); - } else if (trailerUrl) { - window.open(trailerUrl, '_blank'); +
+ + + + + + + {data.mediaInfo?.plexUrl + ? intl.formatMessage(messages.playonplex) + : data.mediaInfo?.plexUrl4k && + (hasPermission(Permission.REQUEST_4K) || + hasPermission(Permission.REQUEST_4K_MOVIE)) + ? intl.formatMessage(messages.playonplex) + : intl.formatMessage(messages.watchtrailer)} + + } - }} - > - {( - trailerUrl - ? data.mediaInfo?.plexUrl || - (data.mediaInfo?.plexUrl4k && + onClick={() => { + if (data.mediaInfo?.plexUrl) { + window.open(data.mediaInfo?.plexUrl, '_blank'); + } else if (data.mediaInfo?.plexUrl4k) { + window.open(data.mediaInfo?.plexUrl4k, '_blank'); + } else if (trailerUrl) { + window.open(trailerUrl, '_blank'); + } + }} + > + {( + 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 && - (hasPermission(Permission.REQUEST_4K) || - hasPermission(Permission.REQUEST_4K_MOVIE)) - ) ? ( - <> - {data.mediaInfo?.plexUrl && - data.mediaInfo?.plexUrl4k && - (hasPermission(Permission.REQUEST_4K) || - hasPermission(Permission.REQUEST_4K_MOVIE)) && ( + hasPermission(Permission.REQUEST_4K_MOVIE)) + ) ? ( + <> + {data.mediaInfo?.plexUrl && + data.mediaInfo?.plexUrl4k && + (hasPermission(Permission.REQUEST_4K) || + hasPermission(Permission.REQUEST_4K_MOVIE)) && ( + { + window.open(data.mediaInfo?.plexUrl4k, '_blank'); + }} + buttonType="ghost" + > + {intl.formatMessage(messages.play4konplex)} + + )} + {trailerUrl && ( { - window.open(data.mediaInfo?.plexUrl4k, '_blank'); + window.open(trailerUrl, '_blank'); }} buttonType="ghost" > - {intl.formatMessage(messages.play4konplex)} + {intl.formatMessage(messages.watchtrailer)} )} - {trailerUrl && ( - { - window.open(trailerUrl, '_blank'); - }} - buttonType="ghost" - > - {intl.formatMessage(messages.watchtrailer)} - - )} - - ) : null} - + + ) : null} + +
)}
= ({ tv }) => {
{data.mediaInfo && data.mediaInfo.status !== MediaStatus.UNKNOWN && ( - + 0} @@ -422,93 +422,95 @@ const TvDetails: React.FC = ({ tv }) => { ))}
-
+
{(trailerUrl || data.mediaInfo?.plexUrl || data.mediaInfo?.plexUrl4k) && ( - - - - - - - {data.mediaInfo?.plexUrl - ? intl.formatMessage(messages.playonplex) - : data.mediaInfo?.plexUrl4k && - (hasPermission(Permission.REQUEST_4K) || - hasPermission(Permission.REQUEST_4K_TV)) - ? intl.formatMessage(messages.play4konplex) - : intl.formatMessage(messages.watchtrailer)} - - - } - onClick={() => { - if (data.mediaInfo?.plexUrl) { - window.open(data.mediaInfo?.plexUrl, '_blank'); - } else if (data.mediaInfo?.plexUrl4k) { - window.open(data.mediaInfo?.plexUrl4k, '_blank'); - } else if (trailerUrl) { - window.open(trailerUrl, '_blank'); +
+ + + + + + + {data.mediaInfo?.plexUrl + ? intl.formatMessage(messages.playonplex) + : data.mediaInfo?.plexUrl4k && + (hasPermission(Permission.REQUEST_4K) || + hasPermission(Permission.REQUEST_4K_TV)) + ? intl.formatMessage(messages.play4konplex) + : intl.formatMessage(messages.watchtrailer)} + + } - }} - > - {( - trailerUrl - ? data.mediaInfo?.plexUrl || - (data.mediaInfo?.plexUrl4k && + onClick={() => { + if (data.mediaInfo?.plexUrl) { + window.open(data.mediaInfo?.plexUrl, '_blank'); + } else if (data.mediaInfo?.plexUrl4k) { + window.open(data.mediaInfo?.plexUrl4k, '_blank'); + } else if (trailerUrl) { + window.open(trailerUrl, '_blank'); + } + }} + > + {( + 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))) - : data.mediaInfo?.plexUrl && + hasPermission(Permission.REQUEST_4K_TV)) + ) ? ( + <> + {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)} - - ) : null} - {trailerUrl ? ( - { - window.open(trailerUrl, '_blank'); - }} - buttonType="ghost" - > - {intl.formatMessage(messages.watchtrailer)} - - ) : null} - - ) : null} - + 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} + +
)}