From 9c26825ed4059f9bb5cf18134b756c90d1d33e9c Mon Sep 17 00:00:00 2001 From: nthouliss Date: Fri, 28 Apr 2023 12:11:08 +1000 Subject: [PATCH 1/5] Add announcement toast for 2.0 --- src/App.tsx | 2 ++ src/MigrationNotification.tsx | 22 ++++++++++++++++++++++ 2 files changed, 24 insertions(+) create mode 100644 src/MigrationNotification.tsx diff --git a/src/App.tsx b/src/App.tsx index aab03d7..d3a7494 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -16,6 +16,7 @@ import { DatabaseProvider } from "./contexts/DatabaseContext"; import { UserIdProvider } from "./contexts/UserIdContext"; import { ToastProvider } from "./components/Toast"; +import { MigrationNotification } from "./MigrationNotification"; function App() { return ( @@ -24,6 +25,7 @@ function App() { + {/* Legacy support camel case routes */} diff --git a/src/MigrationNotification.tsx b/src/MigrationNotification.tsx new file mode 100644 index 0000000..6285246 --- /dev/null +++ b/src/MigrationNotification.tsx @@ -0,0 +1,22 @@ +import { useEffect } from "react"; +import { useToasts } from "react-toast-notifications"; +import { Link } from "theme-ui"; + +export function MigrationNotification() { + const { addToast } = useToasts(); + + useEffect(() => { + const message = ( + + The new era of Owlbear Rodeo is coming on July 19th. Make sure to + migrate your data before July 19th. Read more + + ); + addToast(message, { + autoDismiss: false, + appearance: "info", + }); + }, [addToast]); + + return null; +} From c382c7dfb1644b74c64e894e1922792526567a0e Mon Sep 17 00:00:00 2001 From: nthouliss Date: Fri, 28 Apr 2023 14:50:02 +1000 Subject: [PATCH 2/5] Edit migration message --- src/MigrationNotification.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/MigrationNotification.tsx b/src/MigrationNotification.tsx index 6285246..9516da0 100644 --- a/src/MigrationNotification.tsx +++ b/src/MigrationNotification.tsx @@ -8,8 +8,8 @@ export function MigrationNotification() { useEffect(() => { const message = ( - The new era of Owlbear Rodeo is coming on July 19th. Make sure to - migrate your data before July 19th. Read more + The new era of Owlbear Rodeo is coming on July 18th. Make sure to + migrate your data before July 18th. Read more ); addToast(message, { From 8cba6f42c18811818c223b8e19bb49a4be5242a5 Mon Sep 17 00:00:00 2001 From: Mitchell McCaffrey Date: Fri, 28 Apr 2023 16:20:21 +1000 Subject: [PATCH 3/5] Add href to migration notification --- src/MigrationNotification.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/MigrationNotification.tsx b/src/MigrationNotification.tsx index 9516da0..c4fe8e7 100644 --- a/src/MigrationNotification.tsx +++ b/src/MigrationNotification.tsx @@ -9,7 +9,7 @@ export function MigrationNotification() { const message = ( The new era of Owlbear Rodeo is coming on July 18th. Make sure to - migrate your data before July 18th. Read more + migrate your data before July 18th. Read more ); addToast(message, { From a0eae6bb5dca607d1be7d19e5ee9e69550423844 Mon Sep 17 00:00:00 2001 From: Mitchell McCaffrey Date: Sat, 29 Apr 2023 08:12:37 +1000 Subject: [PATCH 4/5] Update migration notification --- src/MigrationNotification.tsx | 52 +++++++++++++++++++++++------------ src/routes/Home.tsx | 23 +--------------- 2 files changed, 36 insertions(+), 39 deletions(-) diff --git a/src/MigrationNotification.tsx b/src/MigrationNotification.tsx index c4fe8e7..bade90b 100644 --- a/src/MigrationNotification.tsx +++ b/src/MigrationNotification.tsx @@ -1,22 +1,40 @@ -import { useEffect } from "react"; -import { useToasts } from "react-toast-notifications"; -import { Link } from "theme-ui"; +import { useState } from "react"; +import { Box, Close, Link, Text } from "theme-ui"; export function MigrationNotification() { - const { addToast } = useToasts(); + const [closed, setClosed] = useState(false); - useEffect(() => { - const message = ( - - The new era of Owlbear Rodeo is coming on July 18th. Make sure to - migrate your data before July 18th. Read more - - ); - addToast(message, { - autoDismiss: false, - appearance: "info", - }); - }, [addToast]); + if (closed) { + return null; + } - return null; + return ( + + + + The new era of Owlbear Rodeo is coming on July 18th. Make sure to + migrate your data before July 18th.{" "} + + Read more + + + setClosed(true)} sx={{ minWidth: "32px" }} /> + + + ); } diff --git a/src/routes/Home.tsx b/src/routes/Home.tsx index 08e27a0..9e44d33 100644 --- a/src/routes/Home.tsx +++ b/src/routes/Home.tsx @@ -1,14 +1,5 @@ import { useState, useEffect } from "react"; -import { - Flex, - Button, - Image, - Text, - IconButton, - Link, - Message, - Paragraph, -} from "theme-ui"; +import { Flex, Button, Image, Text, IconButton, Link } from "theme-ui"; import Footer from "../components/Footer"; @@ -61,18 +52,6 @@ function Home() { Owlbear Rodeo - - - Check out our blog{" "} - for all the news on the next version of Owlbear Rodeo - -