bonjour -> ouvriers

This commit is contained in:
trochas
2025-12-11 16:32:53 +01:00
parent 89c50827f8
commit 2be434e2cf
10 changed files with 90 additions and 81 deletions

View File

@@ -15,7 +15,7 @@ Différentes commandes a effectuer pour lancer le projet:
npm install firebase npm install firebase
npm install react-native-maps npm install react-native-maps
npx expo install react-native-maps npx expo install react-native-maps@1.9.0
npm install react-native-maps @react-navigation/native @react-navigation/bottom-tabs react-native-safe-area-context react-native-screens npm install react-native-maps @react-navigation/native @react-navigation/bottom-tabs react-native-safe-area-context react-native-screens
npx expo start npx expo start

View File

@@ -7,11 +7,13 @@ import { HapticTab } from '@/components/haptic-tab';
import { IconSymbol } from '@/components/ui/icon-symbol'; import { IconSymbol } from '@/components/ui/icon-symbol';
import { Colors } from '@/constants/theme'; import { Colors } from '@/constants/theme';
import { useColorScheme } from '@/hooks/use-color-scheme'; import { useColorScheme } from '@/hooks/use-color-scheme';
import BonjourScreen from './bonjourFL'; import AddChantier from './addChantier';
import GestionOuvrier from './gestion_ouvrier';
import ListMateriel from './gestionnaire_ressource'; import ListMateriel from './gestionnaire_ressource';
import Home from './home'; import Home from './home';
import MapScreen from './mapScreen'; import MapScreen from './mapScreen';
import AntDesign from '@expo/vector-icons/AntDesign'; import AntDesign from '@expo/vector-icons/AntDesign';
const Tabs = createBottomTabNavigator(); const Tabs = createBottomTabNavigator();
@@ -48,10 +50,10 @@ export default function TabLayout() {
}} }}
/> />
<Tabs.Screen <Tabs.Screen
name="bonjourFL" name="gestionnaire_ouvrier"
component={BonjourScreen} component={GestionOuvrier}
options={{ options={{
title: 'Bonjour', title: 'Ouvriers',
tabBarIcon: ({ color }) => <IconSymbol size={28} name="person.fill" color={color} />, tabBarIcon: ({ color }) => <IconSymbol size={28} name="person.fill" color={color} />,
}} }}
/> />
@@ -65,13 +67,11 @@ export default function TabLayout() {
> >
</Tabs.Screen> </Tabs.Screen>
<Tabs.Screen <Tabs.Screen
name="ajouterChantier" name="addChantier"
component={ListMateriel} component={AddChantier}
options={{ options={{
title: 'Ajouter', title: 'Ajouter',
tabBarIcon: ({ color }) => ( tabBarIcon: ({ color }) => (<AntDesign name="plus" size={28} color={color} />),
<AntDesign name="plus" size={24} color="black" />
),
}} }}
/> />

View File

@@ -0,0 +1,27 @@
import { ThemedText } from '@/components/themed-text';
import { ThemedView, } from '@/components/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 } from 'react-native';
export default function AddChantier() {
return(
<ThemedView lvl={3} style={styles.back}>
<View style={styles.container}>
<ThemedText>TODO</ThemedText>
</View>
</ThemedView>
)
}
const styles = StyleSheet.create({
back:{
height:"100%",
width:"100%",
},
container: {
flex: 1,
marginTop: Constants.statusBarHeight, //pour la barre menu du haut
},
});

View File

@@ -1,15 +0,0 @@
import ChantierSummary from '@/components/chantierSummary';
import SelectChantier from '@/components/selectChantier';
import SetStatus from '@/components/setStatus';
import { ThemedView, } from '@/components/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 } from 'react-native';
import { useChantier } from '../ContextChantier';
import { useRessources } from '../ContextRessource';
export default function ajouterChantier() {
const { chantier, setChantier } = useChantier();
//const { artisant, setArtisant } = useArtisant();
const { ressources, setRessources } = useRessources();
}

View File

@@ -1,4 +1,3 @@
import SelectChantier from "@/components/selectChantier";
import { ThemedText } from "@/components/themed-text"; import { ThemedText } from "@/components/themed-text";
import { ThemedTextInput } from "@/components/themed-textinput"; import { ThemedTextInput } from "@/components/themed-textinput";
import { ThemedView } from "@/components/themed-view"; import { ThemedView } from "@/components/themed-view";
@@ -21,7 +20,7 @@ type Concert = {
favorite: boolean; favorite: boolean;
}; };
export default function BonjourScreen() { export default function GestionOuvrier() {
const router = useRouter(); const router = useRouter();
const { nom, prenom } = useLocalSearchParams(); // Recup data ecran precedent const { nom, prenom } = useLocalSearchParams(); // Recup data ecran precedent
const [search, setSearch] = useState(""); const [search, setSearch] = useState("");
@@ -65,9 +64,6 @@ export default function BonjourScreen() {
contentContainerStyle={{ paddingBottom: 40 }} contentContainerStyle={{ paddingBottom: 40 }}
ListHeaderComponent={ ListHeaderComponent={
<ThemedView opacity="00" style={styles.header}> <ThemedView opacity="00" style={styles.header}>
<ThemedText style={styles.text}>
Bonjour {prenom} {nom} {chantier && chantier.chef.name}
</ThemedText>
<ThemedView style={styles.inputBack} shadow={true}> <ThemedView style={styles.inputBack} shadow={true}>
<ThemedTextInput <ThemedTextInput
@@ -85,15 +81,6 @@ export default function BonjourScreen() {
} }
/> />
<ThemedView
style={{
width: "100%",
position: "absolute",
backgroundColor: "transparent",
}}
>
<SelectChantier></SelectChantier>
</ThemedView>
</ThemedView> </ThemedView>
); );
} }

View File

@@ -1,6 +1,7 @@
import { useChantier } from "@/app/ContextChantier"; import { useChantier } from "@/app/ContextChantier";
import { Chantier } from "@/class/class"; import { Chantier } from "@/class/class";
import { getChantiers } from "@/services/ressourcesService"; import { getChantiers } from "@/services/ressourcesService";
import { useRouter } from "expo-router";
import { useEffect, useState } from "react"; import { useEffect, useState } from "react";
import { import {
Dimensions, Dimensions,
@@ -34,6 +35,7 @@ export default function SelectChantier() {
const [search, setSearch] = useState(""); const [search, setSearch] = useState("");
const [isOpen, setIsOpen] = useState(false); const [isOpen, setIsOpen] = useState(false);
const [chantiers, setChantiers] = useState<Chantier[]>([]); const [chantiers, setChantiers] = useState<Chantier[]>([]);
const router = useRouter();
const AnimatedThemedView = Animated.createAnimatedComponent(ThemedView); const AnimatedThemedView = Animated.createAnimatedComponent(ThemedView);
const AnimatedThemedText = Animated.createAnimatedComponent(ThemedText); const AnimatedThemedText = Animated.createAnimatedComponent(ThemedText);
@@ -50,7 +52,8 @@ export default function SelectChantier() {
} }
function onPressAddChantier(){ function onPressAddChantier(){
router.push("/(tabs)/addChantier")
setIsOpen(false)
} }
useEffect(() => { useEffect(() => {
@@ -214,5 +217,8 @@ const styles = StyleSheet.create({
buttonAdd:{ buttonAdd:{
borderRadius: 10, borderRadius: 10,
marginBottom: 10, marginBottom: 10,
height: 30,
alignItems: 'center',
justifyContent: 'center',
} }
}); });

View File

@@ -162,6 +162,7 @@ const styles = StyleSheet.create({
borderRadius: 15, borderRadius: 15,
padding: 10, padding: 10,
height:40, height:40,
justifyContent: 'center',
}, },
centeredText:{ centeredText:{
textAlign: 'center', textAlign: 'center',
@@ -188,6 +189,7 @@ const styles = StyleSheet.create({
padding: 10, padding: 10,
height:60, height:60,
alignItems: "center", alignItems: "center",
justifyContent: 'center',
}, },
}); });

73
package-lock.json generated
View File

@@ -9,9 +9,9 @@
"version": "1.0.0", "version": "1.0.0",
"dependencies": { "dependencies": {
"@expo/vector-icons": "^15.0.2", "@expo/vector-icons": "^15.0.2",
"@react-navigation/bottom-tabs": "^7.8.2", "@react-navigation/bottom-tabs": "^7.8.12",
"@react-navigation/elements": "^2.6.3", "@react-navigation/elements": "^2.6.3",
"@react-navigation/native": "^7.1.19", "@react-navigation/native": "^7.1.25",
"expo": "~54.0.13", "expo": "~54.0.13",
"expo-constants": "~18.0.9", "expo-constants": "~18.0.9",
"expo-font": "~14.0.9", "expo-font": "~14.0.9",
@@ -29,7 +29,7 @@
"react-dom": "19.1.0", "react-dom": "19.1.0",
"react-native": "0.81.4", "react-native": "0.81.4",
"react-native-gesture-handler": "~2.28.0", "react-native-gesture-handler": "~2.28.0",
"react-native-maps": "1.20.1", "react-native-maps": "1.9.0",
"react-native-reanimated": "~4.1.1", "react-native-reanimated": "~4.1.1",
"react-native-safe-area-context": "~5.6.0", "react-native-safe-area-context": "~5.6.0",
"react-native-screens": "~4.16.0", "react-native-screens": "~4.16.0",
@@ -38,6 +38,7 @@
}, },
"devDependencies": { "devDependencies": {
"@types/react": "~19.1.0", "@types/react": "~19.1.0",
"baseline-browser-mapping": "^2.9.6",
"eslint": "^9.25.0", "eslint": "^9.25.0",
"eslint-config-expo": "~10.0.0", "eslint-config-expo": "~10.0.0",
"typescript": "~5.9.2" "typescript": "~5.9.2"
@@ -2326,6 +2327,7 @@
"version": "0.14.6", "version": "0.14.6",
"resolved": "https://registry.npmjs.org/@firebase/app/-/app-0.14.6.tgz", "resolved": "https://registry.npmjs.org/@firebase/app/-/app-0.14.6.tgz",
"integrity": "sha512-4uyt8BOrBsSq6i4yiOV/gG6BnnrvTeyymlNcaN/dKvyU1GoolxAafvIvaNP1RCGPlNab3OuE4MKUQuv2lH+PLQ==", "integrity": "sha512-4uyt8BOrBsSq6i4yiOV/gG6BnnrvTeyymlNcaN/dKvyU1GoolxAafvIvaNP1RCGPlNab3OuE4MKUQuv2lH+PLQ==",
"peer": true,
"dependencies": { "dependencies": {
"@firebase/component": "0.7.0", "@firebase/component": "0.7.0",
"@firebase/logger": "0.5.0", "@firebase/logger": "0.5.0",
@@ -2391,6 +2393,7 @@
"version": "0.5.6", "version": "0.5.6",
"resolved": "https://registry.npmjs.org/@firebase/app-compat/-/app-compat-0.5.6.tgz", "resolved": "https://registry.npmjs.org/@firebase/app-compat/-/app-compat-0.5.6.tgz",
"integrity": "sha512-YYGARbutghQY4zZUWMYia0ib0Y/rb52y72/N0z3vglRHL7ii/AaK9SA7S/dzScVOlCdnbHXz+sc5Dq+r8fwFAg==", "integrity": "sha512-YYGARbutghQY4zZUWMYia0ib0Y/rb52y72/N0z3vglRHL7ii/AaK9SA7S/dzScVOlCdnbHXz+sc5Dq+r8fwFAg==",
"peer": true,
"dependencies": { "dependencies": {
"@firebase/app": "0.14.6", "@firebase/app": "0.14.6",
"@firebase/component": "0.7.0", "@firebase/component": "0.7.0",
@@ -3806,17 +3809,17 @@
"license": "MIT" "license": "MIT"
}, },
"node_modules/@react-navigation/bottom-tabs": { "node_modules/@react-navigation/bottom-tabs": {
"version": "7.8.2", "version": "7.8.12",
"resolved": "https://registry.npmjs.org/@react-navigation/bottom-tabs/-/bottom-tabs-7.8.2.tgz", "resolved": "https://registry.npmjs.org/@react-navigation/bottom-tabs/-/bottom-tabs-7.8.12.tgz",
"integrity": "sha512-QOcRZj6hA5QZg8PztlEaNOjbQRq75NKM26yTFXdL81OWM2qgry3tascIhBvLUak35NryG1iqQXzSpgn3I/86+g==", "integrity": "sha512-efVt5ydHK+b4ZtjmN81iduaO5dPCmzhLBFwjCR8pV4x4VzUfJmtUJizLqTXpT3WatHdeon2gDPwhhoelsvu/JA==",
"license": "MIT", "license": "MIT",
"dependencies": { "dependencies": {
"@react-navigation/elements": "^2.8.1", "@react-navigation/elements": "^2.9.2",
"color": "^4.2.3", "color": "^4.2.3",
"sf-symbols-typescript": "^2.1.0" "sf-symbols-typescript": "^2.1.0"
}, },
"peerDependencies": { "peerDependencies": {
"@react-navigation/native": "^7.1.19", "@react-navigation/native": "^7.1.25",
"react": ">= 18.2.0", "react": ">= 18.2.0",
"react-native": "*", "react-native": "*",
"react-native-safe-area-context": ">= 4.0.0", "react-native-safe-area-context": ">= 4.0.0",
@@ -3824,12 +3827,12 @@
} }
}, },
"node_modules/@react-navigation/core": { "node_modules/@react-navigation/core": {
"version": "7.13.0", "version": "7.13.6",
"resolved": "https://registry.npmjs.org/@react-navigation/core/-/core-7.13.0.tgz", "resolved": "https://registry.npmjs.org/@react-navigation/core/-/core-7.13.6.tgz",
"integrity": "sha512-Fc/SO23HnlGnkou/z8JQUzwEMvhxuUhr4rdPTIZp/c8q1atq3k632Nfh8fEiGtk+MP1wtIvXdN2a5hBIWpLq3g==", "integrity": "sha512-7QG29HAWOR8wYuPkfTN8L2Po+kE1xn3nsi2sS35sGngq8HYZRHfXvxrhrAZYfFnFq2hUtOhcXnSS6vEWU/5rmA==",
"license": "MIT", "license": "MIT",
"dependencies": { "dependencies": {
"@react-navigation/routers": "^7.5.1", "@react-navigation/routers": "^7.5.2",
"escape-string-regexp": "^4.0.0", "escape-string-regexp": "^4.0.0",
"fast-deep-equal": "^3.1.3", "fast-deep-equal": "^3.1.3",
"nanoid": "^3.3.11", "nanoid": "^3.3.11",
@@ -3843,9 +3846,9 @@
} }
}, },
"node_modules/@react-navigation/elements": { "node_modules/@react-navigation/elements": {
"version": "2.8.1", "version": "2.9.2",
"resolved": "https://registry.npmjs.org/@react-navigation/elements/-/elements-2.8.1.tgz", "resolved": "https://registry.npmjs.org/@react-navigation/elements/-/elements-2.9.2.tgz",
"integrity": "sha512-MLmuS5kPAeAFFOylw89WGjgEFBqGj/KBK6ZrFrAOqLnTqEzk52/SO1olb5GB00k6ZUCDZKJOp1BrLXslxE6TgQ==", "integrity": "sha512-J1GltOAGowNLznEphV/kr4zs0U7mUBO1wVA2CqpkN8ePBsoxrAmsd+T5sEYUCXN9KgTDFvc6IfcDqrGSQngd/g==",
"license": "MIT", "license": "MIT",
"dependencies": { "dependencies": {
"color": "^4.2.3", "color": "^4.2.3",
@@ -3854,7 +3857,7 @@
}, },
"peerDependencies": { "peerDependencies": {
"@react-native-masked-view/masked-view": ">= 0.2.0", "@react-native-masked-view/masked-view": ">= 0.2.0",
"@react-navigation/native": "^7.1.19", "@react-navigation/native": "^7.1.25",
"react": ">= 18.2.0", "react": ">= 18.2.0",
"react-native": "*", "react-native": "*",
"react-native-safe-area-context": ">= 4.0.0" "react-native-safe-area-context": ">= 4.0.0"
@@ -3866,13 +3869,13 @@
} }
}, },
"node_modules/@react-navigation/native": { "node_modules/@react-navigation/native": {
"version": "7.1.19", "version": "7.1.25",
"resolved": "https://registry.npmjs.org/@react-navigation/native/-/native-7.1.19.tgz", "resolved": "https://registry.npmjs.org/@react-navigation/native/-/native-7.1.25.tgz",
"integrity": "sha512-fM7q8di4Q8sp2WUhiUWOe7bEDRyRhbzsKQOd5N2k+lHeCx3UncsRYuw4Q/KN0EovM3wWKqMMmhy/YWuEO04kgw==", "integrity": "sha512-zQeWK9txDePWbYfqTs0C6jeRdJTm/7VhQtW/1IbJNDi9/rFIRzZule8bdQPAnf8QWUsNujRmi1J9OG/hhfbalg==",
"license": "MIT", "license": "MIT",
"peer": true, "peer": true,
"dependencies": { "dependencies": {
"@react-navigation/core": "^7.13.0", "@react-navigation/core": "^7.13.6",
"escape-string-regexp": "^4.0.0", "escape-string-regexp": "^4.0.0",
"fast-deep-equal": "^3.1.3", "fast-deep-equal": "^3.1.3",
"nanoid": "^3.3.11", "nanoid": "^3.3.11",
@@ -3901,9 +3904,9 @@
} }
}, },
"node_modules/@react-navigation/routers": { "node_modules/@react-navigation/routers": {
"version": "7.5.1", "version": "7.5.2",
"resolved": "https://registry.npmjs.org/@react-navigation/routers/-/routers-7.5.1.tgz", "resolved": "https://registry.npmjs.org/@react-navigation/routers/-/routers-7.5.2.tgz",
"integrity": "sha512-pxipMW/iEBSUrjxz2cDD7fNwkqR4xoi0E/PcfTQGCcdJwLoaxzab5kSadBLj1MTJyT0YRrOXL9umHpXtp+Dv4w==", "integrity": "sha512-kymreY5aeTz843E+iPAukrsOtc7nabAH6novtAPREmmGu77dQpfxPB2ZWpKb5nRErIRowp1kYRoN2Ckl+S6JYw==",
"license": "MIT", "license": "MIT",
"dependencies": { "dependencies": {
"nanoid": "^3.3.11" "nanoid": "^3.3.11"
@@ -5286,9 +5289,9 @@
"license": "MIT" "license": "MIT"
}, },
"node_modules/baseline-browser-mapping": { "node_modules/baseline-browser-mapping": {
"version": "2.8.15", "version": "2.9.6",
"resolved": "https://registry.npmjs.org/baseline-browser-mapping/-/baseline-browser-mapping-2.8.15.tgz", "resolved": "https://registry.npmjs.org/baseline-browser-mapping/-/baseline-browser-mapping-2.9.6.tgz",
"integrity": "sha512-qsJ8/X+UypqxHXN75M7dF88jNK37dLBRW7LeUzCPz+TNs37G8cfWy9nWzS+LS//g600zrt2le9KuXt0rWfDz5Q==", "integrity": "sha512-v9BVVpOTLB59C9E7aSnmIF8h7qRsFpx+A2nugVMTszEOMcfjlZMsXRm4LF23I3Z9AJxc8ANpIvzbzONoX9VJlg==",
"license": "Apache-2.0", "license": "Apache-2.0",
"bin": { "bin": {
"baseline-browser-mapping": "dist/cli.js" "baseline-browser-mapping": "dist/cli.js"
@@ -7909,6 +7912,7 @@
"version": "12.6.0", "version": "12.6.0",
"resolved": "https://registry.npmjs.org/firebase/-/firebase-12.6.0.tgz", "resolved": "https://registry.npmjs.org/firebase/-/firebase-12.6.0.tgz",
"integrity": "sha512-8ZD1Gcv916Qp8/nsFH2+QMIrfX/76ti6cJwxQUENLXXnKlOX/IJZaU2Y3bdYf5r1mbownrQKfnWtrt+MVgdwLA==", "integrity": "sha512-8ZD1Gcv916Qp8/nsFH2+QMIrfX/76ti6cJwxQUENLXXnKlOX/IJZaU2Y3bdYf5r1mbownrQKfnWtrt+MVgdwLA==",
"license": "Apache-2.0",
"dependencies": { "dependencies": {
"@firebase/ai": "2.6.0", "@firebase/ai": "2.6.0",
"@firebase/analytics": "0.10.19", "@firebase/analytics": "0.10.19",
@@ -11397,9 +11401,9 @@
} }
}, },
"node_modules/react-is": { "node_modules/react-is": {
"version": "19.2.0", "version": "19.2.1",
"resolved": "https://registry.npmjs.org/react-is/-/react-is-19.2.0.tgz", "resolved": "https://registry.npmjs.org/react-is/-/react-is-19.2.1.tgz",
"integrity": "sha512-x3Ax3kNSMIIkyVYhWPyO09bu0uttcAIoecO/um/rKGQ4EltYWVYtyiGkS/3xMynrbVQdS69Jhlv8FXUEZehlzA==", "integrity": "sha512-L7BnWgRbMwzMAubQcS7sXdPdNLmKlucPlopgAzx7FtYbksWZgEWiuYM5x9T6UqS2Ne0rsgQTq5kY2SGqpzUkYA==",
"license": "MIT" "license": "MIT"
}, },
"node_modules/react-native": { "node_modules/react-native": {
@@ -11487,15 +11491,12 @@
} }
}, },
"node_modules/react-native-maps": { "node_modules/react-native-maps": {
"version": "1.20.1", "version": "1.9.0",
"resolved": "https://registry.npmjs.org/react-native-maps/-/react-native-maps-1.20.1.tgz", "resolved": "https://registry.npmjs.org/react-native-maps/-/react-native-maps-1.9.0.tgz",
"integrity": "sha512-NZI3B5Z6kxAb8gzb2Wxzu/+P2SlFIg1waHGIpQmazDSCRkNoHNY4g96g+xS0QPSaG/9xRBbDNnd2f2/OW6t6LQ==", "integrity": "sha512-ZTMjwEP//M4e+3DA9vzL1tcEZpfHGw5FnejuEpauO8HK5542Der2Ux9mZEXZa5I5q3+B0wJKUzvUPRZxeImUHg==",
"license": "MIT", "license": "MIT",
"dependencies": { "dependencies": {
"@types/geojson": "^7946.0.13" "@types/geojson": "^7946.0.10"
},
"engines": {
"node": ">=18"
}, },
"peerDependencies": { "peerDependencies": {
"react": ">= 17.0.1", "react": ">= 17.0.1",

View File

@@ -12,9 +12,9 @@
}, },
"dependencies": { "dependencies": {
"@expo/vector-icons": "^15.0.2", "@expo/vector-icons": "^15.0.2",
"@react-navigation/bottom-tabs": "^7.8.2", "@react-navigation/bottom-tabs": "^7.8.12",
"@react-navigation/elements": "^2.6.3", "@react-navigation/elements": "^2.6.3",
"@react-navigation/native": "^7.1.19", "@react-navigation/native": "^7.1.25",
"expo": "~54.0.13", "expo": "~54.0.13",
"expo-constants": "~18.0.9", "expo-constants": "~18.0.9",
"expo-font": "~14.0.9", "expo-font": "~14.0.9",
@@ -32,7 +32,7 @@
"react-dom": "19.1.0", "react-dom": "19.1.0",
"react-native": "0.81.4", "react-native": "0.81.4",
"react-native-gesture-handler": "~2.28.0", "react-native-gesture-handler": "~2.28.0",
"react-native-maps": "1.20.1", "react-native-maps": "1.9.0",
"react-native-reanimated": "~4.1.1", "react-native-reanimated": "~4.1.1",
"react-native-safe-area-context": "~5.6.0", "react-native-safe-area-context": "~5.6.0",
"react-native-screens": "~4.16.0", "react-native-screens": "~4.16.0",
@@ -41,6 +41,7 @@
}, },
"devDependencies": { "devDependencies": {
"@types/react": "~19.1.0", "@types/react": "~19.1.0",
"baseline-browser-mapping": "^2.9.6",
"eslint": "^9.25.0", "eslint": "^9.25.0",
"eslint-config-expo": "~10.0.0", "eslint-config-expo": "~10.0.0",
"typescript": "~5.9.2" "typescript": "~5.9.2"