add welcome animation
Change-Id: Ifb08dacd20ee86e66b773cda6de912f698fd3599
diff --git a/client/src/App.js b/client/src/App.js
index bfe707e..6d2284c 100644
--- a/client/src/App.js
+++ b/client/src/App.js
@@ -18,12 +18,15 @@
import NotFoundPage from "./pages/404.jsx"
import LoadingPage from './components/loading'
import JamiAccountDialog from './pages/jamiAccountCreation.jsx'
+import WelcomeAnimation from './components/welcome'
const App = (props) => {
const [state, setState] = useState({
loaded: false,
auth: authManager.getState()
})
+ const [displayWelcome, setDisplayWelcome] = useState(true)
+
useEffect(() => {
authManager.init(auth => {
setState({ loaded: true, auth })
@@ -31,8 +34,9 @@
return () => authManager.deinit()
}, []);
- if (!state.loaded) {
- return <LoadingPage />
+ console.log("App render")
+ if (displayWelcome) {
+ return <WelcomeAnimation showSetup={!state.auth.setupComplete} onComplete={() => setDisplayWelcome(false)} />
} else if (!state.auth.setupComplete) {
return <Switch>
<Route path="/setup" component={ServerSetup} />