diff --git a/app/(tabs)/home.tsx b/app/(tabs)/home.tsx index bb9f432..a9af9b7 100644 --- a/app/(tabs)/home.tsx +++ b/app/(tabs)/home.tsx @@ -4,7 +4,7 @@ import SetStatus from '@/components/setStatus'; import { ThemedView, } from '@/components/theme/themed-view'; import Constants from 'expo-constants'; //pour connaître la taille de la barre menu de l'OS en haut import React from 'react'; -import { StyleSheet, View,Text } from 'react-native'; +import { StyleSheet, View,Text, ScrollView } from 'react-native'; import { useChantier } from '../ContextChantier'; import Anomaly from '@/components/anomaly'; @@ -26,9 +26,13 @@ export default function Home() { - - - {role === "chef"} + + + + + {role === "chef"} + + @@ -43,7 +47,6 @@ const styles = StyleSheet.create({ container: { flex: 1, marginTop: Constants.statusBarHeight, //pour la barre menu du haut - paddingTop : 60, }, header: { flex: 1, diff --git a/components/anomaly.tsx b/components/anomaly.tsx index e94187e..6d2be82 100644 --- a/components/anomaly.tsx +++ b/components/anomaly.tsx @@ -1,7 +1,7 @@ import { Chantier } from '@/class/class'; import { ThemedView } from '@/components/theme/themed-view'; import React, { use, useEffect, useState } from 'react'; -import { TouchableOpacity, StyleProp, StyleSheet, View, Image, ViewStyle,Text, TextInput } from 'react-native'; +import { TouchableOpacity, StyleProp, StyleSheet, View, Image, ViewStyle,Text, TextInput, ScrollView } from 'react-native'; import { ThemedText } from './theme/themed-text'; import { deleteAnomalie, addAnomalie, getChantiers } from '@/services/ressourcesService'; import { useChantier } from '@/app/ContextChantier'; @@ -63,31 +63,33 @@ export default function Anomaly({data,style}: Props) { {data.chantier ? ( Anomalies - {data.chantier.anomalies.length > 0 ? ( - data.chantier.anomalies.map((anomaly, index) => ( - - • {anomaly} - handleDelete(anomaly)} style={styles.deleteButton}> - + {/* Add Anomaly Section */} + + + + Ajouter - - )) - ) : ( - Aucune anomalie - ) } - {/* Add Anomaly Section */} - - - - Ajouter - - - Choisir une image - - {imageUri && ( - - )} - + + Choisir une image + + {imageUri && ( + + )} + + + + {data.chantier.anomalies.length > 0 ? ( + data.chantier.anomalies.map((anomaly, index) => ( + + • {anomaly} + handleDelete(anomaly)} style={styles.deleteButton}> + + + + )) + ) : ( + Aucune anomalie + ) } ): null} @@ -99,7 +101,6 @@ const styles = StyleSheet.create({ anomaliesContainer: { padding: 5, borderRadius: 10, - //height: 150, }, anomaliesTitle: { fontSize: 16, @@ -138,7 +139,6 @@ const styles = StyleSheet.create({ }, //add anomaly styles addContainer: { - marginTop: 10, marginLeft: 2, flexDirection: "row", alignItems: "center"