diff --git a/README.md b/README.md index 78cbb30d..1167c00a 100644 --- a/README.md +++ b/README.md @@ -40,7 +40,7 @@ To run this project locally for contributing or testing, run the following comma git clone https://github.com/movie-web/movie-web cd movie-web yarn install -yarn start +yarn dev ``` To build production files, simply run `yarn build`. @@ -78,4 +78,4 @@ This project would not be possible without our amazing contributors and the comm
@lem6ns for helpfully implementing extra scrapers. -
+ diff --git a/src/components/layout/BrandPill.tsx b/src/components/layout/BrandPill.tsx index cef38ab5..45fe75e2 100644 --- a/src/components/layout/BrandPill.tsx +++ b/src/components/layout/BrandPill.tsx @@ -1,7 +1,10 @@ import { useTranslation } from "react-i18next"; import { Icon, Icons } from "@/components/Icon"; -export function BrandPill(props: { clickable?: boolean }) { +export function BrandPill(props: { + clickable?: boolean; + hideTextOnMobile?: boolean; +}) { const { t } = useTranslation(); return ( @@ -13,7 +16,14 @@ export function BrandPill(props: { clickable?: boolean }) { }`} > - {t("global.name")} + + {t("global.name")} + ); } diff --git a/src/components/layout/Navigation.tsx b/src/components/layout/Navigation.tsx index 71d40f76..90c8852d 100644 --- a/src/components/layout/Navigation.tsx +++ b/src/components/layout/Navigation.tsx @@ -12,43 +12,45 @@ export interface NavigationProps { export function Navigation(props: NavigationProps) { return ( -
-
-
-
-
-
- - - + ); diff --git a/src/components/layout/SectionHeading.tsx b/src/components/layout/SectionHeading.tsx index a9d01cb7..fda60bae 100644 --- a/src/components/layout/SectionHeading.tsx +++ b/src/components/layout/SectionHeading.tsx @@ -10,8 +10,8 @@ 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 f4305eca..ca7ad96f 100644 --- a/src/components/media/MediaCard.tsx +++ b/src/components/media/MediaCard.tsx @@ -45,14 +45,27 @@ function MediaCardContent({ }`} >

{series ? ( -
-

+

+

{t("seasons.seasonAndEpisode", { season: series.season, episode: series.episode, @@ -125,5 +138,9 @@ export function MediaCard(props: MediaCardProps) { )}`; if (!props.linkable) return {content}; - return {content}; + return ( + + {content} + + ); } diff --git a/src/hooks/useIsMobile.ts b/src/hooks/useIsMobile.ts index a336afdb..a2df937f 100644 --- a/src/hooks/useIsMobile.ts +++ b/src/hooks/useIsMobile.ts @@ -1,12 +1,14 @@ import { useEffect, useRef, useState } from "react"; -export function useIsMobile() { +export function useIsMobile(horizontal?: boolean) { const [isMobile, setIsMobile] = useState(false); const isMobileCurrent = useRef(false); useEffect(() => { function onResize() { - const value = window.innerWidth < 1024; + const value = horizontal + ? window.innerHeight < 600 + : window.innerWidth < 1024; const isChanged = isMobileCurrent.current !== value; if (!isChanged) return; @@ -20,7 +22,7 @@ export function useIsMobile() { return () => { window.removeEventListener("resize", onResize); }; - }, []); + }, [horizontal]); return { isMobile, diff --git a/src/setup/locales/en/translation.json b/src/setup/locales/en/translation.json index 8842b58f..14bb2845 100644 --- a/src/setup/locales/en/translation.json +++ b/src/setup/locales/en/translation.json @@ -55,6 +55,7 @@ "noVideos": "Whoops, couldn't find any videos for you", "loading": "Loading...", "backToHome": "Back to home", + "backToHomeShort": "Back", "seasonAndEpisode": "S{{season}} E{{episode}}", "buttons": { "episodes": "Episodes", diff --git a/src/video/components/parts/VideoPlayerHeader.tsx b/src/video/components/parts/VideoPlayerHeader.tsx index 81b1e5c8..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) @@ -26,24 +28,26 @@ export function VideoPlayerHeader(props: VideoPlayerHeaderProps) { return (

-
-

+

+

{props.onClick ? ( - {t("videoPlayer.backToHome")} + {isMobile ? ( + {t("videoPlayer.backToHomeShort")} + ) : ( + {t("videoPlayer.backToHome")} + )} ) : null} {showDivider ? ( ) : null} {props.media ? ( - - {props.media.title} - + {props.media.title} ) : null}

{props.media && ( @@ -64,7 +68,7 @@ export function VideoPlayerHeader(props: VideoPlayerHeaderProps) { ) : ( - + )}
); diff --git a/src/video/components/parts/VideoPlayerIconButton.tsx b/src/video/components/parts/VideoPlayerIconButton.tsx index 9193f635..8755d72d 100644 --- a/src/video/components/parts/VideoPlayerIconButton.tsx +++ b/src/video/components/parts/VideoPlayerIconButton.tsx @@ -31,7 +31,9 @@ export const VideoPlayerIconButton = forwardRef< ].join(" ")} > - {props.text ? {props.text} : null} +

+ {props.text ? {props.text} : null} +

diff --git a/src/video/components/popouts/PopoutProviderAction.tsx b/src/video/components/popouts/PopoutProviderAction.tsx index 8898bf26..c2b495aa 100644 --- a/src/video/components/popouts/PopoutProviderAction.tsx +++ b/src/video/components/popouts/PopoutProviderAction.tsx @@ -5,6 +5,7 @@ import { SourceSelectionPopout } from "@/video/components/popouts/SourceSelectio import { CaptionSelectionPopout } from "@/video/components/popouts/CaptionSelectionPopout"; import { useVideoPlayerDescriptor } from "@/video/state/hooks"; import { useControls } from "@/video/state/logic/controls"; +import { useIsMobile } from "@/hooks/useIsMobile"; import { useInterface, VideoInterfaceEvent, @@ -37,6 +38,8 @@ function PopoutContainer(props: { videoInterface: VideoInterfaceEvent }) { const [bottom, setBottom] = useState(0); const [width, setWidth] = useState(0); + const { isMobile } = useIsMobile(true); + const calculateAndSetCoords = useCallback((rect: DOMRect, w: number) => { const buttonCenter = rect.left + rect.width / 2; @@ -57,7 +60,10 @@ function PopoutContainer(props: { videoInterface: VideoInterfaceEvent }) { return (
{t("videoPlayer.loading")} -
+
diff --git a/src/views/search/HomeView.tsx b/src/views/search/HomeView.tsx index ec6455ab..60e213ad 100644 --- a/src/views/search/HomeView.tsx +++ b/src/views/search/HomeView.tsx @@ -172,7 +172,7 @@ function NewDomainModal() { export function HomeView() { return ( -
+
diff --git a/src/views/search/SearchView.tsx b/src/views/search/SearchView.tsx index 4201d954..5035574d 100644 --- a/src/views/search/SearchView.tsx +++ b/src/views/search/SearchView.tsx @@ -22,7 +22,7 @@ export function SearchView() { return ( <> -
+
{t("global.name")} @@ -32,10 +32,10 @@ export function SearchView() {
-
-
- {t("search.title")} -
+
+ {t("search.title")} +
+