diff --git a/src/components/Button.tsx b/src/components/Button.tsx new file mode 100644 index 00000000..49343b6f --- /dev/null +++ b/src/components/Button.tsx @@ -0,0 +1,27 @@ +import { Icon, Icons } from "@/components/Icon"; +import { ReactNode } from "react"; + +interface Props { + icon?: Icons; + onClick?: () => void; + children?: ReactNode; +} + +// TODO style button +// TODO transition modal +export function Button(props: Props) { + return ( + + ); +} diff --git a/src/components/layout/Modal.tsx b/src/components/layout/Modal.tsx index fb787259..17f0c4d2 100644 --- a/src/components/layout/Modal.tsx +++ b/src/components/layout/Modal.tsx @@ -18,7 +18,7 @@ export function Modal(props: Props) { export function ModalCard(props: { children?: ReactNode }) { return ( -
+
{props.children}
); diff --git a/src/setup/index.css b/src/setup/index.css index c6ca4617..79bd1613 100644 --- a/src/setup/index.css +++ b/src/setup/index.css @@ -13,6 +13,11 @@ html[data-full], html[data-full] body { overscroll-behavior-y: none; } +body[data-no-scroll] { + overflow-y: hidden; + height: 100vh; +} + #root { padding: 0.05px; min-height: 100vh; diff --git a/src/setup/locales/en/translation.json b/src/setup/locales/en/translation.json index d29abc38..811e33b7 100644 --- a/src/setup/locales/en/translation.json +++ b/src/setup/locales/en/translation.json @@ -77,5 +77,11 @@ "errors": { "fatalError": "The video player encounted a fatal error, please report it to the <0>Discord server or on <1>GitHub." } + }, + "v3": { + "newSiteTitle": "We have a new site!", + "newDomain": "https://movie-web.app", + "newDomainText": "We've moved from domain, you can now access our website on <0>https://movie-web.app. Make sure to change all your bookmarks as <1>the old link will stop working on 25 Febuary 2023.", + "tireless": "We've worked tirelessly on this new update, we hope you will enjoy what we've been cooking up for the past months." } } diff --git a/src/views/search/HomeView.tsx b/src/views/search/HomeView.tsx index 5f730b92..334486f3 100644 --- a/src/views/search/HomeView.tsx +++ b/src/views/search/HomeView.tsx @@ -1,5 +1,5 @@ -import { useTranslation } from "react-i18next"; -import { Icons } from "@/components/Icon"; +import { Trans, useTranslation } from "react-i18next"; +import { Icon, Icons } from "@/components/Icon"; import { SectionHeading } from "@/components/layout/SectionHeading"; import { MediaGrid } from "@/components/media/MediaGrid"; import { @@ -9,10 +9,11 @@ import { import { useWatchedContext } from "@/state/watched"; import { WatchedMediaCard } from "@/components/media/WatchedMediaCard"; import { EditButton } from "@/components/buttons/EditButton"; -import { useMemo, useState } from "react"; +import { useEffect, useState } from "react"; import { useAutoAnimate } from "@formkit/auto-animate/react"; -import { VideoPlayerIconButton } from "@/video/components/parts/VideoPlayerIconButton"; -import { useHistory, useLocation } from "react-router-dom"; +import { useHistory } from "react-router-dom"; +import { Modal, ModalCard } from "@/components/layout/Modal"; +import { Button } from "@/components/Button"; function Bookmarks() { const { t } = useTranslation(); @@ -81,48 +82,64 @@ function Watched() { ); } -function NewDomainInfo() { - const location = useLocation(); +function NewDomainModal() { + const [show, setShow] = useState( + new URLSearchParams(window.location.search).get("migrated") === "1" + ); const history = useHistory(); + const { t } = useTranslation(); + useEffect(() => { + const newParams = new URLSearchParams(history.location.search); + newParams.delete("migrated"); + history.replace({ + search: newParams.toString(), + }); + }, [history]); + + // Hi Isra! (TODO remove this in the future lol) return ( -
- { - const queryParams = new URLSearchParams(location.search); - queryParams.delete("redirected"); - history.replace({ - search: queryParams.toString(), - }); - }} - /> -

Hey there!

-

- Welcome to the long-awaited shiny new update of movie-web. This awesome - updates includes an awesome new look, updated functionality, and even a - fully custom-built video player. -

-

- We also have a new domain! Please be sure to update your bookmarks, as - the old domain is going to stop working on May 31st. - The new domain is movie-web.app -

-
+ + +
+
+
+
+ {t("v3.newDomain")} +
+
+
+
+

+ {t("v3.newSiteTitle")} +

+

+ + + + +

+

{t("v3.tireless")}

+
+
+ +
+ + ); } export function HomeView() { - const location = useLocation(); - - const showNewDomainInfo = useMemo(() => { - return location.search.includes("redirected=1"); - }, [location.search]); - return ( -
- {showNewDomainInfo ? : ""} +
+