Created
October 12, 2019 05:20
-
-
Save hckhanh/ccc5f342f77904aa018b4458d7b5f8dc to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { Router } from "@reach/router"; | |
import { useMachine } from "@xstate/react"; | |
import { SnackbarProvider } from "notistack"; | |
import React from "react"; | |
import Header from "./components/Header"; | |
import SignIn from "./components/SignIn"; | |
import AuthMachine from "./states/AuthMachine"; | |
const App: React.FC = () => { | |
const [current, send] = useMachine(AuthMachine, { devTools: true }); | |
console.log(current); | |
return ( | |
<SnackbarProvider maxSnack={3}> | |
<Header /> | |
{current.matches("authorized") && <h1>Authorized</h1>} | |
<Router> | |
<SignIn path="/login" /> | |
</Router> | |
</SnackbarProvider> | |
); | |
}; | |
export default App; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment