From fbd683e0b52a4ec7bfe50b9729ae9c97cfaa27fe Mon Sep 17 00:00:00 2001 From: Max Ward Date: Mon, 20 Feb 2023 18:10:22 -0800 Subject: [PATCH] implement comment fixes --- src/components/layout/BrandPill.tsx | 7 ++++--- src/components/layout/SectionHeading.tsx | 2 +- src/components/media/MediaCard.tsx | 21 +++++++++++-------- src/setup/locales/en/translation.json | 3 ++- src/video/components/VideoPlayer.tsx | 4 ++-- .../components/parts/VideoPlayerHeader.tsx | 8 ++++++- .../popouts/PopoutProviderAction.tsx | 7 ++++--- .../popouts/SourceSelectionPopout.tsx | 2 -- 8 files changed, 32 insertions(+), 22 deletions(-) diff --git a/src/components/layout/BrandPill.tsx b/src/components/layout/BrandPill.tsx index 91b2458f..45fe75e2 100644 --- a/src/components/layout/BrandPill.tsx +++ b/src/components/layout/BrandPill.tsx @@ -17,9 +17,10 @@ export function BrandPill(props: { > {t("global.name")} diff --git a/src/components/layout/SectionHeading.tsx b/src/components/layout/SectionHeading.tsx index e4d37dfc..fda60bae 100644 --- a/src/components/layout/SectionHeading.tsx +++ b/src/components/layout/SectionHeading.tsx @@ -10,7 +10,7 @@ interface SectionHeadingProps { export function SectionHeading(props: SectionHeadingProps) { return ( -
+

{props.icon ? ( diff --git a/src/components/media/MediaCard.tsx b/src/components/media/MediaCard.tsx index 42f74181..ca7ad96f 100644 --- a/src/components/media/MediaCard.tsx +++ b/src/components/media/MediaCard.tsx @@ -45,23 +45,26 @@ function MediaCardContent({ }`} >

{series ? (

{t("seasons.seasonAndEpisode", { season: series.season, diff --git a/src/setup/locales/en/translation.json b/src/setup/locales/en/translation.json index 3f175c68..14bb2845 100644 --- a/src/setup/locales/en/translation.json +++ b/src/setup/locales/en/translation.json @@ -54,7 +54,8 @@ "findingBestVideo": "Finding the best video for you", "noVideos": "Whoops, couldn't find any videos for you", "loading": "Loading...", - "backToHome": "Back", + "backToHome": "Back to home", + "backToHomeShort": "Back", "seasonAndEpisode": "S{{season}} E{{episode}}", "buttons": { "episodes": "Episodes", diff --git a/src/video/components/VideoPlayer.tsx b/src/video/components/VideoPlayer.tsx index 55daf522..688f42e2 100644 --- a/src/video/components/VideoPlayer.tsx +++ b/src/video/components/VideoPlayer.tsx @@ -138,8 +138,8 @@ export function VideoPlayer(props: Props) {

{isMobile ? ( -
-
+
+
diff --git a/src/video/components/parts/VideoPlayerHeader.tsx b/src/video/components/parts/VideoPlayerHeader.tsx index 3fc2ff3d..741b5640 100644 --- a/src/video/components/parts/VideoPlayerHeader.tsx +++ b/src/video/components/parts/VideoPlayerHeader.tsx @@ -9,6 +9,7 @@ import { import { AirplayAction } from "@/video/components/actions/AirplayAction"; import { ChromecastAction } from "@/video/components/actions/ChromecastAction"; import { useTranslation } from "react-i18next"; +import { useIsMobile } from "@/hooks/useIsMobile"; interface VideoPlayerHeaderProps { media?: MWMediaMeta; @@ -17,6 +18,7 @@ interface VideoPlayerHeaderProps { } export function VideoPlayerHeader(props: VideoPlayerHeaderProps) { + const { isMobile } = useIsMobile(); const { bookmarkStore, setItemBookmark } = useBookmarkContext(); const isBookmarked = props.media ? getIfBookmarkedFromPortable(bookmarkStore.bookmarks, props.media) @@ -34,7 +36,11 @@ export function VideoPlayerHeader(props: VideoPlayerHeaderProps) { className="flex cursor-pointer items-center py-1 text-white opacity-50 transition-opacity hover:opacity-100" > - {t("videoPlayer.backToHome")} + {isMobile ? ( + {t("videoPlayer.backToHomeShort")} + ) : ( + {t("videoPlayer.backToHome")} + )} ) : null} {showDivider ? ( diff --git a/src/video/components/popouts/PopoutProviderAction.tsx b/src/video/components/popouts/PopoutProviderAction.tsx index 23734c2e..c2b495aa 100644 --- a/src/video/components/popouts/PopoutProviderAction.tsx +++ b/src/video/components/popouts/PopoutProviderAction.tsx @@ -60,9 +60,10 @@ function PopoutContainer(props: { videoInterface: VideoInterfaceEvent }) { return (