From 18a8fd1e798ec333cf90cd2e7e065af2a9771686 Mon Sep 17 00:00:00 2001 From: Romain CLEMENT Date: Sun, 9 Apr 2023 22:30:47 +0200 Subject: [PATCH] Banned stack screen --- src/App.tsx | 23 ++++++++++++++++++----- src/auth/SignIn.tsx | 3 +-- src/auth/SignUp.tsx | 3 +-- src/clip/AClipView.tsx | 3 +-- 4 files changed, 21 insertions(+), 11 deletions(-) diff --git a/src/App.tsx b/src/App.tsx index c083e13..2c4f0f7 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -39,7 +39,7 @@ class App extends React.Component { } store.subscribe(() => { console.log("see a dispatch"); - this.setState({ token: store.getState().userReducer.token}) + this.setState({ token: store.getState().userReducer.token }); }); } @@ -69,13 +69,26 @@ class App extends React.Component { console.log("render app", store.getState()); console.log("app state", this.state); return - { + { this.state.token === "" ? - + //////////////////////////////////////////////////////////// + <> + } name="Login" options={{ title: 'Connexion' }} /> + } name="Register" options={{ title: 'Créer un compte' }} /> + : - - } + //////////////////////////////////////////////////////////// + <> + + {(props) => } + + + {(props) => } + + + //////////////////////////////////////////////////////////// + } }; } diff --git a/src/auth/SignIn.tsx b/src/auth/SignIn.tsx index eea6d42..ffd696c 100644 --- a/src/auth/SignIn.tsx +++ b/src/auth/SignIn.tsx @@ -22,7 +22,6 @@ export default class SignIn extends React.Component { ); const signInJson = await signInResponse.json(); if (signInJson.status === "ok") { - console.log(this.props.store); this.props.store.dispatch(setUser(signInJson.token, this.state.username)); } else console.log(signInJson); } @@ -38,7 +37,7 @@ export default class SignIn extends React.Component { render(): React.ReactNode { return ( - Connexion + Connexion