From 232b640b064f896e59e72a9b0b0e595e2aec2e69 Mon Sep 17 00:00:00 2001 From: "david.truong" <david.truong@hes-so.ch> Date: Tue, 18 Apr 2023 16:35:13 +0200 Subject: [PATCH] Suppression de la page des comptes et correction bug rafraichissement apres spuppression --- mobile_app/App.js | 2 - mobile_app/assets/adaptive-icon.png | Bin mobile_app/assets/favicon.png | Bin mobile_app/assets/fonts/Inter-Bold.ttf | Bin mobile_app/assets/fonts/Inter-Light.ttf | Bin mobile_app/assets/fonts/Inter-Medium.ttf | Bin mobile_app/assets/fonts/Inter-Regular.ttf | Bin mobile_app/assets/fonts/Inter-SemiBold.ttf | Bin mobile_app/assets/icon.png | Bin mobile_app/assets/icons/badge.png | Bin mobile_app/assets/icons/calendrier.png | Bin mobile_app/assets/icons/eth.png | Bin mobile_app/assets/icons/heart.png | Bin mobile_app/assets/icons/heure.png | Bin mobile_app/assets/icons/left.png | Bin mobile_app/assets/icons/search.png | Bin mobile_app/assets/images/calendar.png | Bin mobile_app/assets/images/email.png | Bin mobile_app/assets/images/fond1.jpg | Bin mobile_app/assets/images/fond2.jpg | Bin mobile_app/assets/images/fond3.jpg | Bin mobile_app/assets/images/logo.png | Bin mobile_app/assets/images/logo2.png | Bin mobile_app/assets/images/mdp.png | Bin mobile_app/assets/images/nft01.png | Bin mobile_app/assets/images/nft02.jpeg | Bin mobile_app/assets/images/nft03.jpeg | Bin mobile_app/assets/images/nft04.jpeg | Bin mobile_app/assets/images/nft05.jpeg | Bin mobile_app/assets/images/nft06.jpeg | Bin mobile_app/assets/images/nft07.jpeg | Bin mobile_app/assets/images/nike1.png | Bin mobile_app/assets/images/nike2.png | Bin mobile_app/assets/images/nike3.png | Bin mobile_app/assets/images/nike4.png | Bin mobile_app/assets/images/nom.png | Bin mobile_app/assets/images/person01.png | Bin mobile_app/assets/images/person02.png | Bin mobile_app/assets/images/person03.png | Bin mobile_app/assets/images/person04.png | Bin mobile_app/assets/images/poids.png | Bin mobile_app/assets/images/pointure.png | Bin mobile_app/assets/images/prenom.png | Bin mobile_app/assets/images/sex.png | Bin mobile_app/assets/images/size.png | Bin mobile_app/assets/images/taille.png | Bin mobile_app/assets/splash.png | Bin mobile_app/components/AccountCard.js | 26 --------- mobile_app/components/AccountsHeader.js | 37 ------------ mobile_app/components/Button.js | 0 mobile_app/components/DetailsDesc.js | 0 mobile_app/components/DetailsProduct.js | 0 mobile_app/components/FocusedStatusBar.js | 0 mobile_app/components/Forms.js | 0 mobile_app/components/HomeHeader.js | 10 +--- mobile_app/components/RDVCard.js | 12 ++-- mobile_app/components/RDVHeader.js | 0 mobile_app/components/ShopCard.js | 0 mobile_app/components/SubInfo.js | 0 mobile_app/components/index.js | 4 +- mobile_app/screens/Accounts.js | 63 --------------------- mobile_app/screens/Connexion.js | 6 +- mobile_app/screens/Home.js | 39 +++---------- 63 files changed, 21 insertions(+), 178 deletions(-) mode change 100644 => 100755 mobile_app/App.js mode change 100644 => 100755 mobile_app/assets/adaptive-icon.png mode change 100644 => 100755 mobile_app/assets/favicon.png mode change 100644 => 100755 mobile_app/assets/fonts/Inter-Bold.ttf mode change 100644 => 100755 mobile_app/assets/fonts/Inter-Light.ttf mode change 100644 => 100755 mobile_app/assets/fonts/Inter-Medium.ttf mode change 100644 => 100755 mobile_app/assets/fonts/Inter-Regular.ttf mode change 100644 => 100755 mobile_app/assets/fonts/Inter-SemiBold.ttf mode change 100644 => 100755 mobile_app/assets/icon.png mode change 100644 => 100755 mobile_app/assets/icons/badge.png mode change 100644 => 100755 mobile_app/assets/icons/calendrier.png mode change 100644 => 100755 mobile_app/assets/icons/eth.png mode change 100644 => 100755 mobile_app/assets/icons/heart.png mode change 100644 => 100755 mobile_app/assets/icons/heure.png mode change 100644 => 100755 mobile_app/assets/icons/left.png mode change 100644 => 100755 mobile_app/assets/icons/search.png mode change 100644 => 100755 mobile_app/assets/images/calendar.png mode change 100644 => 100755 mobile_app/assets/images/email.png mode change 100644 => 100755 mobile_app/assets/images/fond1.jpg mode change 100644 => 100755 mobile_app/assets/images/fond2.jpg mode change 100644 => 100755 mobile_app/assets/images/fond3.jpg mode change 100644 => 100755 mobile_app/assets/images/logo.png mode change 100644 => 100755 mobile_app/assets/images/logo2.png mode change 100644 => 100755 mobile_app/assets/images/mdp.png mode change 100644 => 100755 mobile_app/assets/images/nft01.png mode change 100644 => 100755 mobile_app/assets/images/nft02.jpeg mode change 100644 => 100755 mobile_app/assets/images/nft03.jpeg mode change 100644 => 100755 mobile_app/assets/images/nft04.jpeg mode change 100644 => 100755 mobile_app/assets/images/nft05.jpeg mode change 100644 => 100755 mobile_app/assets/images/nft06.jpeg mode change 100644 => 100755 mobile_app/assets/images/nft07.jpeg mode change 100644 => 100755 mobile_app/assets/images/nike1.png mode change 100644 => 100755 mobile_app/assets/images/nike2.png mode change 100644 => 100755 mobile_app/assets/images/nike3.png mode change 100644 => 100755 mobile_app/assets/images/nike4.png mode change 100644 => 100755 mobile_app/assets/images/nom.png mode change 100644 => 100755 mobile_app/assets/images/person01.png mode change 100644 => 100755 mobile_app/assets/images/person02.png mode change 100644 => 100755 mobile_app/assets/images/person03.png mode change 100644 => 100755 mobile_app/assets/images/person04.png mode change 100644 => 100755 mobile_app/assets/images/poids.png mode change 100644 => 100755 mobile_app/assets/images/pointure.png mode change 100644 => 100755 mobile_app/assets/images/prenom.png mode change 100644 => 100755 mobile_app/assets/images/sex.png mode change 100644 => 100755 mobile_app/assets/images/size.png mode change 100644 => 100755 mobile_app/assets/images/taille.png mode change 100644 => 100755 mobile_app/assets/splash.png delete mode 100644 mobile_app/components/AccountCard.js delete mode 100644 mobile_app/components/AccountsHeader.js mode change 100644 => 100755 mobile_app/components/Button.js mode change 100644 => 100755 mobile_app/components/DetailsDesc.js mode change 100644 => 100755 mobile_app/components/DetailsProduct.js mode change 100644 => 100755 mobile_app/components/FocusedStatusBar.js mode change 100644 => 100755 mobile_app/components/Forms.js mode change 100644 => 100755 mobile_app/components/RDVCard.js mode change 100644 => 100755 mobile_app/components/RDVHeader.js mode change 100644 => 100755 mobile_app/components/ShopCard.js mode change 100644 => 100755 mobile_app/components/SubInfo.js mode change 100644 => 100755 mobile_app/components/index.js delete mode 100644 mobile_app/screens/Accounts.js diff --git a/mobile_app/App.js b/mobile_app/App.js old mode 100644 new mode 100755 index 145f489e6..7a0833482 --- a/mobile_app/App.js +++ b/mobile_app/App.js @@ -4,7 +4,6 @@ import { useFonts } from "expo-font"; import Home from './screens/Home'; import Details from './screens/Details'; -import Accounts from './screens/Accounts'; import RdvScreen from './screens/RdvScreen'; import Subscription from './screens/Subscription'; import Connexion from './screens/Connexion'; @@ -36,7 +35,6 @@ const App = () => { <Stack.Navigator screenOptions={{headerShown: false}} initialRouteName="Connexion"> <Stack.Screen name="Home" component={Home}/> <Stack.Screen name="Details" component={Details}/> - <Stack.Screen name="Accounts" component={Accounts}/> <Stack.Screen name="RdvScreen" component={RdvScreen}/> <Stack.Screen name="Subscription" component={Subscription}/> <Stack.Screen name="Connexion" component={Connexion}/> diff --git a/mobile_app/assets/adaptive-icon.png b/mobile_app/assets/adaptive-icon.png old mode 100644 new mode 100755 diff --git a/mobile_app/assets/favicon.png b/mobile_app/assets/favicon.png old mode 100644 new mode 100755 diff --git a/mobile_app/assets/fonts/Inter-Bold.ttf b/mobile_app/assets/fonts/Inter-Bold.ttf old mode 100644 new mode 100755 diff --git a/mobile_app/assets/fonts/Inter-Light.ttf b/mobile_app/assets/fonts/Inter-Light.ttf old mode 100644 new mode 100755 diff --git a/mobile_app/assets/fonts/Inter-Medium.ttf b/mobile_app/assets/fonts/Inter-Medium.ttf old mode 100644 new mode 100755 diff --git a/mobile_app/assets/fonts/Inter-Regular.ttf b/mobile_app/assets/fonts/Inter-Regular.ttf old mode 100644 new mode 100755 diff --git a/mobile_app/assets/fonts/Inter-SemiBold.ttf b/mobile_app/assets/fonts/Inter-SemiBold.ttf old mode 100644 new mode 100755 diff --git a/mobile_app/assets/icon.png b/mobile_app/assets/icon.png old mode 100644 new mode 100755 diff --git a/mobile_app/assets/icons/badge.png b/mobile_app/assets/icons/badge.png old mode 100644 new mode 100755 diff --git a/mobile_app/assets/icons/calendrier.png b/mobile_app/assets/icons/calendrier.png old mode 100644 new mode 100755 diff --git a/mobile_app/assets/icons/eth.png b/mobile_app/assets/icons/eth.png old mode 100644 new mode 100755 diff --git a/mobile_app/assets/icons/heart.png b/mobile_app/assets/icons/heart.png old mode 100644 new mode 100755 diff --git a/mobile_app/assets/icons/heure.png b/mobile_app/assets/icons/heure.png old mode 100644 new mode 100755 diff --git a/mobile_app/assets/icons/left.png b/mobile_app/assets/icons/left.png old mode 100644 new mode 100755 diff --git a/mobile_app/assets/icons/search.png b/mobile_app/assets/icons/search.png old mode 100644 new mode 100755 diff --git a/mobile_app/assets/images/calendar.png b/mobile_app/assets/images/calendar.png old mode 100644 new mode 100755 diff --git a/mobile_app/assets/images/email.png b/mobile_app/assets/images/email.png old mode 100644 new mode 100755 diff --git a/mobile_app/assets/images/fond1.jpg b/mobile_app/assets/images/fond1.jpg old mode 100644 new mode 100755 diff --git a/mobile_app/assets/images/fond2.jpg b/mobile_app/assets/images/fond2.jpg old mode 100644 new mode 100755 diff --git a/mobile_app/assets/images/fond3.jpg b/mobile_app/assets/images/fond3.jpg old mode 100644 new mode 100755 diff --git a/mobile_app/assets/images/logo.png b/mobile_app/assets/images/logo.png old mode 100644 new mode 100755 diff --git a/mobile_app/assets/images/logo2.png b/mobile_app/assets/images/logo2.png old mode 100644 new mode 100755 diff --git a/mobile_app/assets/images/mdp.png b/mobile_app/assets/images/mdp.png old mode 100644 new mode 100755 diff --git a/mobile_app/assets/images/nft01.png b/mobile_app/assets/images/nft01.png old mode 100644 new mode 100755 diff --git a/mobile_app/assets/images/nft02.jpeg b/mobile_app/assets/images/nft02.jpeg old mode 100644 new mode 100755 diff --git a/mobile_app/assets/images/nft03.jpeg b/mobile_app/assets/images/nft03.jpeg old mode 100644 new mode 100755 diff --git a/mobile_app/assets/images/nft04.jpeg b/mobile_app/assets/images/nft04.jpeg old mode 100644 new mode 100755 diff --git a/mobile_app/assets/images/nft05.jpeg b/mobile_app/assets/images/nft05.jpeg old mode 100644 new mode 100755 diff --git a/mobile_app/assets/images/nft06.jpeg b/mobile_app/assets/images/nft06.jpeg old mode 100644 new mode 100755 diff --git a/mobile_app/assets/images/nft07.jpeg b/mobile_app/assets/images/nft07.jpeg old mode 100644 new mode 100755 diff --git a/mobile_app/assets/images/nike1.png b/mobile_app/assets/images/nike1.png old mode 100644 new mode 100755 diff --git a/mobile_app/assets/images/nike2.png b/mobile_app/assets/images/nike2.png old mode 100644 new mode 100755 diff --git a/mobile_app/assets/images/nike3.png b/mobile_app/assets/images/nike3.png old mode 100644 new mode 100755 diff --git a/mobile_app/assets/images/nike4.png b/mobile_app/assets/images/nike4.png old mode 100644 new mode 100755 diff --git a/mobile_app/assets/images/nom.png b/mobile_app/assets/images/nom.png old mode 100644 new mode 100755 diff --git a/mobile_app/assets/images/person01.png b/mobile_app/assets/images/person01.png old mode 100644 new mode 100755 diff --git a/mobile_app/assets/images/person02.png b/mobile_app/assets/images/person02.png old mode 100644 new mode 100755 diff --git a/mobile_app/assets/images/person03.png b/mobile_app/assets/images/person03.png old mode 100644 new mode 100755 diff --git a/mobile_app/assets/images/person04.png b/mobile_app/assets/images/person04.png old mode 100644 new mode 100755 diff --git a/mobile_app/assets/images/poids.png b/mobile_app/assets/images/poids.png old mode 100644 new mode 100755 diff --git a/mobile_app/assets/images/pointure.png b/mobile_app/assets/images/pointure.png old mode 100644 new mode 100755 diff --git a/mobile_app/assets/images/prenom.png b/mobile_app/assets/images/prenom.png old mode 100644 new mode 100755 diff --git a/mobile_app/assets/images/sex.png b/mobile_app/assets/images/sex.png old mode 100644 new mode 100755 diff --git a/mobile_app/assets/images/size.png b/mobile_app/assets/images/size.png old mode 100644 new mode 100755 diff --git a/mobile_app/assets/images/taille.png b/mobile_app/assets/images/taille.png old mode 100644 new mode 100755 diff --git a/mobile_app/assets/splash.png b/mobile_app/assets/splash.png old mode 100644 new mode 100755 diff --git a/mobile_app/components/AccountCard.js b/mobile_app/components/AccountCard.js deleted file mode 100644 index 98fefa088..000000000 --- a/mobile_app/components/AccountCard.js +++ /dev/null @@ -1,26 +0,0 @@ -import { View, Image, Text } from 'react-native' -import { useNavigation } from '@react-navigation/native' -import React from 'react' -import { assets, COLORS, SHADOWS, SIZES, } from '../constants' -import { CircleButton, RectButton } from './Button' -import { Title, AccountSize, AccountFootSize } from './SubInfo' - -const AccountCard = ({ data }) => { - const navigation = useNavigation(); - return ( - <View style={{width: "48%", backgroundColor: COLORS.white, borderRadius: SIZES.font, marginBottom: SIZES.extraLarge, margin: "1%", ...SHADOWS.dark}}> - <View style={{ width: "100%", padding: SIZES.base}}> - <Title title={data.Nom} subTitle={data.Mail} titleSize={SIZES.large} subTitleSize={SIZES.base}/> - </View> - <View style={{ marginTop: SIZES.font, flexDirection: "row", justifyContent: "space-between", alignItems: "center", paddingHorizontal: 10, paddingBottom: 10}}> - <View style={{ flexDirection: "row"}}> - <AccountSize size={data.Taille} /> - <AccountFootSize footSize={data.Pointure} /> - </View> - </View> - <RectButton minWidth={80} fontSize={SIZES.font} text="Voir détails" handlePress={() => {}}/> - </View> - ) -} - -export default AccountCard \ No newline at end of file diff --git a/mobile_app/components/AccountsHeader.js b/mobile_app/components/AccountsHeader.js deleted file mode 100644 index 259987074..000000000 --- a/mobile_app/components/AccountsHeader.js +++ /dev/null @@ -1,37 +0,0 @@ -import { View, Text, Image, TextInput } from 'react-native' -import { assets, COLORS, FONTS, SIZES, SHADOWS } from '../constants' -import { RectButtonWhite } from './Button' - -const AccountsHeader = ({ onSearch }) => { - return ( - <View style={{ backgroundColor: COLORS.primary, padding: SIZES.font}}> - <View style={{ flexDirection: 'row', justifyContent: "space-between", alignItems: "center"}}> - <View style={{ flexDirection: 'row', alignItems: "center"}}> - <Image source={assets.logo2} resizeMode="contain" style={{ width: 60, height: 50}}/> - <Text style={{fontFamily: FONTS.bold, fontSize: SIZES.extraLarge, color: COLORS.white, marginLeft: 10}}>RPG</Text> - </View> - - <View style={{ width: 45, height: 45}}> - <Image source={assets.person01} resizeMode="contain" style={{ width: "100%", height: '100%'}}/> - <Image source={assets.badge} resizeMode="contain" style={{ position: "absolute", width: 15, height: 15, bottom: 0, right: 0}}/> - </View> - </View> - <View style={{ marginVertical: SIZES.font}}> - <Text style={{ fontFamily: FONTS.bold, fontSize: SIZES.large, color: COLORS.white, marginTop: SIZES.base / 2}}> - Les comptes - </Text> - </View> - - <View style={{marginTop: SIZES.font }}> - <View style={{ width: "100%", borderRadius: SIZES.font, backgroundColor: COLORS.gray, flexDirection: "row", alignItems: "center", paddingHorizontal: SIZES.font, paddingVertical: SIZES.small - 2}} > - <Image source={assets.search} resizeMode="contain" style={{ width: 20, height: 20, marginRight: SIZES.base}}/> - <TextInput placeholder='Recherche Comptes' style={{flex: 1}} onChangeText={onSearch} /> - </View> - </View> - </View> - - - ) -} - -export default AccountsHeader \ No newline at end of file diff --git a/mobile_app/components/Button.js b/mobile_app/components/Button.js old mode 100644 new mode 100755 diff --git a/mobile_app/components/DetailsDesc.js b/mobile_app/components/DetailsDesc.js old mode 100644 new mode 100755 diff --git a/mobile_app/components/DetailsProduct.js b/mobile_app/components/DetailsProduct.js old mode 100644 new mode 100755 diff --git a/mobile_app/components/FocusedStatusBar.js b/mobile_app/components/FocusedStatusBar.js old mode 100644 new mode 100755 diff --git a/mobile_app/components/Forms.js b/mobile_app/components/Forms.js old mode 100644 new mode 100755 diff --git a/mobile_app/components/HomeHeader.js b/mobile_app/components/HomeHeader.js index 8b8e2b82b..a625aac6e 100644 --- a/mobile_app/components/HomeHeader.js +++ b/mobile_app/components/HomeHeader.js @@ -3,7 +3,7 @@ import { assets, COLORS, FONTS, SIZES, SHADOWS } from '../constants' import { RectButtonWhite } from './Button' import { useNavigation } from '@react-navigation/native' -const HomeHeader = ({ onSearch, route }) => { +const HomeHeader = ({route }) => { let handleModif = () => { const datas = { @@ -56,14 +56,6 @@ const HomeHeader = ({ onSearch, route }) => { <RectButtonWhite width={"48%"} fonSize={SIZES.large} text="Modifier des informations" handlePress={handleModif} {...SHADOWS.dark}/> <RectButtonWhite width={"48%"} fonSize={SIZES.large} text="Prendre un rendez-vous" handlePress={() => navigation.navigate("RdvScreen",{user : route.params.user})} {...SHADOWS.dark}/> </View> - - - <View style={{marginTop: SIZES.font }}> - <View style={{ width: "100%", borderRadius: SIZES.font, backgroundColor: COLORS.gray, flexDirection: "row", alignItems: "center", paddingHorizontal: SIZES.font, paddingVertical: SIZES.small - 2}} > - <Image source={assets.search} resizeMode="contain" style={{ width: 20, height: 20, marginRight: SIZES.base}}/> - <TextInput placeholder='Recherche RDV' style={{flex: 1}} onChangeText={onSearch} /> - </View> - </View> </View> diff --git a/mobile_app/components/RDVCard.js b/mobile_app/components/RDVCard.js old mode 100644 new mode 100755 index ddef85f94..6a2d7bb1e --- a/mobile_app/components/RDVCard.js +++ b/mobile_app/components/RDVCard.js @@ -15,7 +15,7 @@ const deleteRDV = (datas) => { idrdv : datas.id }; console.log(datas) - console.log(data) + //console.log(data) const options = { method: 'POST', @@ -29,7 +29,8 @@ const deleteRDV = (datas) => { var templateParams = { horaire: datas.hour, - date: datas.date + date: datas.date, + email: datas.email }; emailjs.send('service_kwla1nj', 'template_ijryses', templateParams, 'gkKZTWtimj8jnpE9G','sO7lpUxhWhb0UkdBEAd6F') @@ -43,7 +44,7 @@ const deleteRDV = (datas) => { } -const ConfirmDelete = (data) => { +const ConfirmDelete = (data, up) => { Popup.show({ type: 'confirm', title: 'Annulation de RDV', @@ -53,6 +54,7 @@ const ConfirmDelete = (data) => { callback: () => { deleteRDV(data) Popup.hide(); + setTimeout(up, 500); }, cancelCallback: () => { Popup.hide(); @@ -60,7 +62,7 @@ const ConfirmDelete = (data) => { }) } -const RDVCard = ({ data }) => { +const RDVCard = ({ data, up }) => { const navigation = useNavigation(); return ( <View style={{ backgroundColor: COLORS.white, borderRadius: SIZES.font, marginBottom: SIZES.extraLarge, margin: SIZES.base, ...SHADOWS.dark}}> @@ -80,7 +82,7 @@ const RDVCard = ({ data }) => { <View style={{ flexDirection: "row"}}> <RectButton minWidth={85} fontSize={SIZES.font} text="Détails" handlePress={() => navigation.navigate("Details", { data })}/> - <RectButton minWidth={85} fontSize={SIZES.font} text="Annuler" handlePress={() => ConfirmDelete(data)}/> + <RectButton minWidth={85} fontSize={SIZES.font} text="Annuler" handlePress={() => ConfirmDelete(data, up)}/> </View> </View> diff --git a/mobile_app/components/RDVHeader.js b/mobile_app/components/RDVHeader.js old mode 100644 new mode 100755 diff --git a/mobile_app/components/ShopCard.js b/mobile_app/components/ShopCard.js old mode 100644 new mode 100755 diff --git a/mobile_app/components/SubInfo.js b/mobile_app/components/SubInfo.js old mode 100644 new mode 100755 diff --git a/mobile_app/components/index.js b/mobile_app/components/index.js old mode 100644 new mode 100755 index d48a52aa5..9e213763e --- a/mobile_app/components/index.js +++ b/mobile_app/components/index.js @@ -5,12 +5,10 @@ import {CircleButton, RectButton, RectButtonSchedule} from "./Button"; import DetailsProduct from "./DetailsProduct"; import DetailsDesc from "./DetailsDesc"; import { SubInfo } from "./SubInfo"; -import AccountsHeader from "./AccountsHeader"; -import AccountCard from "./AccountCard"; import RDVHeader from "./RDVHeader"; import ShopCard from "./ShopCard"; import { Forms } from "./Forms"; export { - HomeHeader, AccountsHeader, AccountCard, FocusedStatusBar, RDVCard, CircleButton, RectButton, DetailsProduct, DetailsDesc, SubInfo, RDVHeader, ShopCard, RectButtonSchedule, Forms, + HomeHeader, FocusedStatusBar, RDVCard, CircleButton, RectButton, DetailsProduct, DetailsDesc, SubInfo, RDVHeader, ShopCard, RectButtonSchedule, Forms, } \ No newline at end of file diff --git a/mobile_app/screens/Accounts.js b/mobile_app/screens/Accounts.js deleted file mode 100644 index 81ceb57ba..000000000 --- a/mobile_app/screens/Accounts.js +++ /dev/null @@ -1,63 +0,0 @@ -import { useState} from 'react'; -import { View, SafeAreaView, FlatList } from 'react-native'; -import { useNavigation } from '@react-navigation/native' - -import { COLORS, SIZES, SHADOWS, AccountData } from '../constants'; -import { FocusedStatusBar, RectButton, AccountsHeader, AccountCard } from '../components'; -import { RectButtonWhite } from '../components/Button'; - -const Accounts = () => { - const navigation = useNavigation(); - - const [accountData, setAccountData] = useState(AccountData); - const handleSearch = (value) => { - if(!value.length) - { - return setAccountData; - } - - const filteredData = AccountData.filter((item) => item.Nom.toLowerCase().includes(value.toLowerCase())); - - if(filteredData.length) - { - setAccountData(filteredData); - } - else - { - setAccountData(AccountData); - } - } - - return ( - <SafeAreaView style={{ flex: 1}}> - <FocusedStatusBar barStyle="dark-content" backgroundColor="transparent" translucent={true} /> - - <View style={{ width: "100%", position: "absolute", bottom: 0, paddingVertical: SIZES.large, flexDirection: "row", justifyContent: "center", alignItems: "center", backgroundColor: "rgba(2555, 255, 255, 0.5)", zIndex: 1}}> - <RectButton fonSize={SIZES.large} text="Mon Compte" {...SHADOWS.dark} handlePress={() => navigation.goBack()}/> - <RectButton fonSize={SIZES.large} text="Liste des comptes" {...SHADOWS.dark} /> - </View> - - <View style={{ flex: 1}}> - <View style={{zIndex: 0 }}> - <FlatList data={accountData} - numColumns={2} - renderItem={({ item }) => <AccountCard data={item}/>} - keyExtractor={(item) => item.Id_Client} - showsVerticalScrollIndicator={false} - ListHeaderComponent={ - <AccountsHeader onSearch={handleSearch}/> - } - /> - </View> - - <View style={{ position: "absolute", top: 0, bottom: 0, right: 0, left: 0, zIndex: -1}}> - <View style={{ height: 300, backgroundColor: COLORS.primary }}/> - <View style={{ flex: 1, backgroundColor: COLORS.white }}/> - </View> - - </View> - </SafeAreaView> - ) -} - -export default Accounts \ No newline at end of file diff --git a/mobile_app/screens/Connexion.js b/mobile_app/screens/Connexion.js index 74d0c421c..c7b17a58a 100644 --- a/mobile_app/screens/Connexion.js +++ b/mobile_app/screens/Connexion.js @@ -11,8 +11,8 @@ import { DateForm, RadioGender, TextBox } from '../components/Forms'; const Subscription = () => { const navigation = useNavigation(); - const [mail,setMail] = useState("andre.gouveiad@etu.hesge.ch"); - const [mdp,setMdp] = useState("babalos"); + const [mail,setMail] = useState(); + const [mdp,setMdp] = useState(); const [client_id,setClientid] = useState(); let handleResponse = (response) => { @@ -109,4 +109,4 @@ const Subscription = () => { ) } -export default Subscription \ No newline at end of file +export default Subscription diff --git a/mobile_app/screens/Home.js b/mobile_app/screens/Home.js index 3d22f3729..0362c598c 100644 --- a/mobile_app/screens/Home.js +++ b/mobile_app/screens/Home.js @@ -37,14 +37,18 @@ const Home = ({ navigation, route }) => { description: item.description, image: images[n], - bids: [] + bids: [], + email: userData.Mail }) }) setRdvDatas(rdv_list) + console.log("TEST2") + console.log(rdvDatas) } let getRDV = () => { + console.log("TEST") const data = { client_id : route.params.user.Id_Client, @@ -73,57 +77,32 @@ const Home = ({ navigation, route }) => { // Call only when screen open or when back on screen if(isFocused){ setIdClient(route.params.user.Id_Client); - getRDV(); + setTimeout(getRDV, 500); } }, [isFocused]); - - - - - - const handleSearch = (value) => { - if(!value.length) - { - return setRdvData; - } - - const filteredData = RPGData.filter((item) => item.name.toLowerCase().includes(value.toLowerCase())); - - if(filteredData.length) - { - setRdvData(filteredData); - } - else - { - - setRdvData(RPGData); - } - } - return ( <Root> <SafeAreaView style={{ flex: 1 }}> <FocusedStatusBar background={COLORS.primary}/> <View style={{ width: "100%", position: "absolute", bottom: 0, paddingVertical: SIZES.large, flexDirection: "row", justifyContent: "center", alignItems: "center", backgroundColor: "rgba(2555, 255, 255, 0.5)", zIndex: 1}}> - <RectButton fonSize={SIZES.large} text="Mon Compte" {...SHADOWS.dark} /> - <RectButton fonSize={SIZES.large} text="Liste des comptes" handlePress={() => navigation.navigate("Accounts")} {...SHADOWS.dark} /> <RectButton fonSize={SIZES.large} text="Deconnexion" handlePress={() => navigation.navigate("Connexion")} {...SHADOWS.dark} /> </View> <View style={{ flex: 1 }}> <View style={{ zIndex: 0 }}> <FlatList data={rdvDatas} - renderItem={({ item }) => <RDVCard data={item}/>} + renderItem={({ item }) => <RDVCard data={item} up={getRDV}/>} keyExtractor={(item) => item.id} showsVerticalScrollIndicator={false} ListHeaderComponent={ - <HomeHeader onSearch={handleSearch} route={route}/> + <HomeHeader route={route}/> } ListFooterComponent={ <View style={{height: 50}}/> } + extraData={idclient} /> </View> -- GitLab