Add announcement toast for 2.0
This commit is contained in:
parent
13de88a77f
commit
9c26825ed4
@ -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 */}
|
||||||
|
22
src/MigrationNotification.tsx
Normal file
22
src/MigrationNotification.tsx
Normal 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;
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user