diff --git a/package.json b/package.json index a05a09b..c44d720 100644 --- a/package.json +++ b/package.json @@ -10,6 +10,7 @@ "test": "jest" }, "dependencies": { + "@expo/metro-runtime": "^3.1.3", "@react-native-async-storage/async-storage": "^1.18.1", "@react-navigation/material-bottom-tabs": "^6.2.15", "@react-navigation/native": "^6.1.6", @@ -21,13 +22,16 @@ "expo-constants": "^14.4.2", "expo-modules-core": "^1.5.12", "react": "18.2.0", + "react-dom": "18.2.0", "react-native": "0.71.4", "react-native-async-storage": "^0.0.1", "react-native-paper": "^5.6.0", "react-native-safe-area-context": "^4.9.0", "react-native-safe-area-view": "^1.1.1", "react-native-simple-toast": "^2.0.0", + "react-native-toast-notifications": "^3.4.0", "react-native-vector-icons": "^9.2.0", + "react-native-web": "~0.18.10", "react-redux": "^8.0.5", "redux": "^4.2.1", "redux-persist": "^6.0.0" diff --git a/src/App.tsx b/src/App.tsx index e58a14a..8a61ca8 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -6,29 +6,18 @@ */ import * as React from 'react'; import {NavigationContainer, StackActions} from '@react-navigation/native'; -import type {PropsWithChildren} from 'react'; -import { - SafeAreaView, - ScrollView, - StatusBar, - StyleSheet, - Text, - useColorScheme, - View, -} from 'react-native'; - +import {Platform} from 'react-native'; import ClipViewLocal from './clip/ClipViewLocal'; import ClipViewRemote from './clip/ClipViewRemote'; import {createMaterialBottomTabNavigator} from '@react-navigation/material-bottom-tabs'; -import {createNativeStackNavigator} from '@react-navigation/native-stack'; import SignIn from './auth/SignIn'; import SignUp from './auth/SignUp'; import {Provider} from 'react-redux'; import {store, persistor} from './redux/store'; import {PersistGate} from 'redux-persist/integration/react'; - -const Stack = createNativeStackNavigator(); const Tab = createMaterialBottomTabNavigator(); +import { ToastProvider } from 'react-native-toast-notifications' + class App extends React.Component { constructor(props: any) { @@ -40,59 +29,64 @@ class App extends React.Component { store.subscribe(() => { this.setState({token: store.getState().persistedUserReducer.token}); }); + console.log(Platform.OS); + console.log(typeof store); } + render(): React.ReactNode { console.log('render app', store.getState()); console.log('app state', this.state); return ( - - - - - { - this.state.token === '' ? ( + + + + + + { + this.state.token === '' ? ( + //////////////////////////////////////////////////////////// + <> + } + name="Login" + options={{title: 'Connexion'}} + /> + } + name="Register" + options={{title: 'Créer un compte'}} + /> + + ) : ( + //////////////////////////////////////////////////////////// + <> + + {props => ( + + )} + + + {props => ( + + )} + + + ) //////////////////////////////////////////////////////////// - <> - } - 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 1cd80f4..14a001b 100644 --- a/src/auth/SignIn.tsx +++ b/src/auth/SignIn.tsx @@ -32,22 +32,22 @@ export default class SignIn extends React.Component { } else console.log(signInJson); } - updateUsername(event: any) { - this.setState({ username: event.target.value }); + updateUsername(username: string) { + this.setState({ username: username }); } - updatePassword(event: any) { - this.setState({ password: event.target.value }); + updatePassword(password: string) { + this.setState({ password: password }); } render(): React.ReactNode { return ( Connexion - - + +