diff --git a/App.tsx b/App.tsx index 99a4052..453b082 100644 --- a/App.tsx +++ b/App.tsx @@ -1,7 +1,11 @@ import { StatusBar } from 'expo-status-bar'; import { StyleSheet, Text, View, Button } from 'react-native'; import React, { useState } from "react"; + import Navigation from './navigation/Navigation'; +import StackNavigation from './navigation/StackNavigation'; + +import { createStackNavigator } from '@react-navigation/stack'; import { SafeAreaView, diff --git a/navigation/Navigation.tsx b/navigation/Navigation.tsx index dae5f3a..d2d0ce9 100644 --- a/navigation/Navigation.tsx +++ b/navigation/Navigation.tsx @@ -10,6 +10,7 @@ import ListScreen from '../screens/ListScreen'; import ListFav from '../screens/ListFav'; import TabBarIcon from '../components/TabBarIcon'; +import StackNavigation from './StackNavigation'; @@ -24,14 +25,16 @@ export default function Navigation() { title: 'List', tabBarIcon: ({color}) => , }}/> - , - }}/> + headerShown: false + }} + /> , }}/> diff --git a/navigation/StackNavigation.tsx b/navigation/StackNavigation.tsx index 21744cb..3c63f32 100644 --- a/navigation/StackNavigation.tsx +++ b/navigation/StackNavigation.tsx @@ -8,16 +8,15 @@ import HomeScreen from '../screens/HomeScreen'; import ListScreen from '../screens/ListScreen'; import ListFav from '../screens/ListFav'; - export default function StackNavigation() { const Stack = createStackNavigator(); return ( - + // - + // ) } \ No newline at end of file diff --git a/screens/HomeScreen.tsx b/screens/HomeScreen.tsx index 21f05fa..9255c15 100644 --- a/screens/HomeScreen.tsx +++ b/screens/HomeScreen.tsx @@ -1,27 +1,39 @@ -import { StyleSheet, Text, View, Button, TouchableNativeFeedback } from 'react-native'; +import { StyleSheet, Text, View, TouchableNativeFeedback } from 'react-native'; import { useNavigation } from '@react-navigation/native'; import { NavigationContainer } from '@react-navigation/native'; import StackNavigation from '../navigation/StackNavigation' import { Colors } from 'react-native/Libraries/NewAppScreen'; -export default function HomeScreen() { +import Button from 'react-bootstrap/Button'; + +// @ts-ignore //(ta gueule pour l'erreur sur navigation) +export default function HomeScreen({navigation}) { return ( - // - // navigation.navigate("ListScreen")}> - //Click me ! - // - - - Mes super Nounours ! - - Mon super texte ... - {/* */} - - Nous sommes actuellement dans l'écran d'accueil ! - + + + Mes super Nounours ! + + Mon super texte ... + {/* */} + + Nous sommes actuellement dans l'écran d'accueil ! + + + + Vous cherchez une entités ? + navigation.navigate("ListScreen")}> + Consulter la liste global ! + + + + + Vous avez des entités favorites ? + navigation.navigate("ListFav")}> + Aller sur la page de favoris ! + - // + ) }; @@ -35,7 +47,8 @@ export default function HomeScreen() { alignItems: "center" }, title: { - fontSize: 20 + fontSize: 20, + fontWeight: 'bold', }, MidArea: { justifyContent: "center", @@ -43,9 +56,22 @@ export default function HomeScreen() { paddingTop: 50, paddingBottom: 50, margin: 40, + borderRadius: 15, }, textStyle: { textAlign: "center", fontSize: 20, + }, + ButtonStyle :{ + backgroundColor: "#2E8AE6", + borderRadius: 15, + padding: 20, + color: "white", + fontSize : 20, + fontWeight: 'bold', + }, + t3 :{ + fontSize : 20, + fontWeight: 'bold', } }); diff --git a/screens/ListScreen.tsx b/screens/ListScreen.tsx index bc68ccb..e7e5192 100644 --- a/screens/ListScreen.tsx +++ b/screens/ListScreen.tsx @@ -2,6 +2,42 @@ import { StyleSheet, Text, View, Button } from 'react-native'; import { StatusBar } from 'expo-status-bar'; import React, { useState } from "react"; +import { FlatList } from 'react-native-gesture-handler'; + + +export const DATA = [ + { + id: '1', + title: "premier élément", + }, + { + id: '2', + title: "second élément", + }, + { + id: '3', + title: "élément", + }, + { + id: '4', + title: "Rick", + }, + { + id: '5', + title: "Corentin", + }, + { + id: '10', + title: "dernier élément", + }, +]; + +//@ts-ignore +const Item = ({title}) => ( + + {title} + +); export default function Main(){ @@ -14,6 +50,9 @@ export default function Main(){ {count}