Add announcement toast for 2.0

This commit is contained in:
nthouliss 2023-04-28 12:11:08 +10:00
parent 13de88a77f
commit 9c26825ed4
2 changed files with 24 additions and 0 deletions

View File

@ -16,6 +16,7 @@ import { DatabaseProvider } from "./contexts/DatabaseContext";
import { UserIdProvider } from "./contexts/UserIdContext"; import { UserIdProvider } from "./contexts/UserIdContext";
import { ToastProvider } from "./components/Toast"; import { ToastProvider } from "./components/Toast";
import { MigrationNotification } from "./MigrationNotification";
function App() { function App() {
return ( return (
@ -24,6 +25,7 @@ function App() {
<AuthProvider> <AuthProvider>
<KeyboardProvider> <KeyboardProvider>
<ToastProvider> <ToastProvider>
<MigrationNotification />
<Router> <Router>
<Switch> <Switch>
{/* Legacy support camel case routes */} {/* Legacy support camel case routes */}

View File

@ -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 = (
<span>
The new era of Owlbear Rodeo is coming on July 19th. Make sure to
migrate your data before July 19th. <Link href="#">Read more</Link>
</span>
);
addToast(message, {
autoDismiss: false,
appearance: "info",
});
}, [addToast]);
return null;
}