diff --git a/src/views/search/HomeView.tsx b/src/views/search/HomeView.tsx index b5a17843..c9b48ceb 100644 --- a/src/views/search/HomeView.tsx +++ b/src/views/search/HomeView.tsx @@ -9,8 +9,10 @@ import { import { useWatchedContext } from "@/state/watched"; import { WatchedMediaCard } from "@/components/media/WatchedMediaCard"; import { EditButton } from "@/components/buttons/EditButton"; -import { useState } from "react"; +import { useMemo, useState } from "react"; import { useAutoAnimate } from "@formkit/auto-animate/react"; +import { VideoPlayerIconButton } from "@/video/components/parts/VideoPlayerIconButton"; +import { useHistory, useLocation } from "react-router-dom"; function Bookmarks() { const { t } = useTranslation(); @@ -79,9 +81,49 @@ function Watched() { ); } -export function HomeView() { +function NewDomainInfo() { + const location = useLocation(); + const history = useHistory(); + 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, 2023. The new domain is{" "} + movie-web.app +

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