From eaf5730415df632b8e4e27a9a623297f1cf5f47f Mon Sep 17 00:00:00 2001 From: Jip Fr Date: Sun, 12 Feb 2023 23:41:47 +0100 Subject: [PATCH 1/2] Add v3 prompt thingie --- src/views/search/HomeView.tsx | 48 ++++++++++++++++++++++++++++++++--- 1 file changed, 45 insertions(+), 3 deletions(-) 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 ? : ""}
From 75762aca48292203b1fe7ba81e59103798ba55fd Mon Sep 17 00:00:00 2001 From: Jip Fr Date: Sun, 12 Feb 2023 23:45:11 +0100 Subject: [PATCH 2/2] Goodbye year --- src/views/search/HomeView.tsx | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/views/search/HomeView.tsx b/src/views/search/HomeView.tsx index c9b48ceb..5f730b92 100644 --- a/src/views/search/HomeView.tsx +++ b/src/views/search/HomeView.tsx @@ -106,9 +106,8 @@ function NewDomainInfo() {

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 + the old domain is going to stop working on May 31st. + The new domain is movie-web.app

);