From 7227a4cab0a37388e731383817e279571bd9f5d3 Mon Sep 17 00:00:00 2001 From: mohamed Date: Mon, 20 Mar 2023 21:34:42 +0100 Subject: [PATCH] =?UTF-8?q?=F0=9F=99=8D=E2=80=8D=E2=99=82=EF=B8=8F?= =?UTF-8?q?=F0=9F=99=8D=E2=80=8D=E2=99=82=EF=B8=8F=20ajout=20du=20componen?= =?UTF-8?q?t=20d'une=20=C3=A9curie,=20d=C3=A9but=20fonciton=20de=20recherc?= =?UTF-8?q?he=20team.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- R-Dash/components/TeamCmp.tsx | 39 +++++++++++++++++++++++ R-Dash/screens/Team_Browser.tsx | 56 +++++++++------------------------ 2 files changed, 54 insertions(+), 41 deletions(-) create mode 100644 R-Dash/components/TeamCmp.tsx diff --git a/R-Dash/components/TeamCmp.tsx b/R-Dash/components/TeamCmp.tsx new file mode 100644 index 0000000..c696508 --- /dev/null +++ b/R-Dash/components/TeamCmp.tsx @@ -0,0 +1,39 @@ +import { View,Image,Text, StyleSheet } from "react-native"; +import { Team } from "../core/Team"; + +type TeamListItemProps = { + team: Team; + } + + export default function TeamListItem(props: TeamListItemProps) { + return ( + + + {props.team.getName()} + + ) + } + + const styles = StyleSheet.create({ + container: { + alignItems:'center', + backgroundColor:'#e1e8ee', + padding:10, + flex: 1, + flexDirection: "row", + marginTop:10, + }, + text_style:{ + marginLeft:15, + textAlign:'center', + fontSize:20, + }, + teaserImage: { + borderWidth:1, + borderColor:'black', + borderRadius:50, + width: 50, + height: 50, + } + }); + \ No newline at end of file diff --git a/R-Dash/screens/Team_Browser.tsx b/R-Dash/screens/Team_Browser.tsx index 906a3c3..b701271 100644 --- a/R-Dash/screens/Team_Browser.tsx +++ b/R-Dash/screens/Team_Browser.tsx @@ -3,47 +3,23 @@ import { SafeAreaView } from 'react-native-safe-area-context'; import { SearchBar } from '@rneui/base'; import { TouchableHighlight } from 'react-native-gesture-handler'; import React from 'react'; +import { TEAMS } from '../stub/stub'; +import TeamListItem from '../components/TeamCmp'; export default function Team_Browser(props: { navigation: any }) { const { navigation } = props; - type ItemProps = { title: string }; - const Item = ({title}: ItemProps) => ( - - {title} - - ); - const DATA = [ - { - id: 'bd7acbea-c1b1-46c2-aed5-3ad53abb28ba', - title: 'First Item', - }, - { - id: '3ac68afc-c605-48d3-a4f8-fbd91aa97f63', - title: 'Second Item', - }, - { - id: '58694a0f-3da1-471f-bd96-145571e29d71', - title: 'Third Item', - }, - { - id: '58694a0f-3da1-471f-bd96-145571e29d78', - title: 'c Item', - }, - { - id: '58694a0f-3da1-471f-bd96-145571e29d76', - title: 'b Item', - }, - { - id: '58694a0f-3da1-471f-bd96-145571e29d75', - title: 'a Item', - }, - { - id: '58694a0f-3da1-471f-bd96-145571e29d73', - title: 's Item', - }, - ]; + const state = { + search: '', + }; + + const updateSearch = (search: string) => { + state.search=search; + }; + + const { search } = state; + return ( @@ -52,11 +28,9 @@ export default function Team_Browser(props: { navigation: any }) { platform="default" lightTheme /> - - navigation.navigate('Info', { "team": item })}> - - - }/> + } />