From 5b702122e21a29bfe2943a67223ac893f5191d79 Mon Sep 17 00:00:00 2001 From: trochas Date: Tue, 9 Dec 2025 11:15:06 +0100 Subject: [PATCH] img chantier --- app/(tabs)/bonjourFL.tsx | 7 +-- app/{Context.tsx => ContextChantier.tsx} | 0 app/_layout.tsx | 15 +++-- app/login/login.tsx | 18 +++--- class/class.tsx | 20 ++++++- components/selectChantier.tsx | 57 ++++++++++++------- ...ed-textinpute.tsx => themed-textinput.tsx} | 0 package-lock.json | 44 +++++++++----- package.json | 1 - 9 files changed, 102 insertions(+), 60 deletions(-) rename app/{Context.tsx => ContextChantier.tsx} (100%) rename components/{themed-textinpute.tsx => themed-textinput.tsx} (100%) diff --git a/app/(tabs)/bonjourFL.tsx b/app/(tabs)/bonjourFL.tsx index 914f809..0de1568 100644 --- a/app/(tabs)/bonjourFL.tsx +++ b/app/(tabs)/bonjourFL.tsx @@ -1,15 +1,14 @@ import SelectChantier from '@/components/selectChantier'; import { ThemedText } from '@/components/themed-text'; -import { ThemedTextInput } from '@/components/themed-textinpute'; +import { ThemedTextInput } from '@/components/themed-textinput'; 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 { useLocalSearchParams, useRouter } from 'expo-router'; import React, { useMemo, useState } from 'react'; import { Button, FlatList, Image, StyleSheet, Text } from 'react-native'; import rawConcerts from '../../data/concerts.json'; -import Constants from 'expo-constants' //pour connaître la taille de la barre menu de l'OS en haut -import Example from '@/components/example'; -import { useChantier } from '../Context'; +import { useChantier } from '../ContextChantier'; type Concert = { diff --git a/app/Context.tsx b/app/ContextChantier.tsx similarity index 100% rename from app/Context.tsx rename to app/ContextChantier.tsx diff --git a/app/_layout.tsx b/app/_layout.tsx index 7ff48f5..ccb215d 100644 --- a/app/_layout.tsx +++ b/app/_layout.tsx @@ -1,20 +1,19 @@ +import { useColorScheme } from "@/hooks/use-color-scheme"; import { DarkTheme, DefaultTheme, ThemeProvider, } from "@react-navigation/native"; -import { Stack } from "expo-router"; +import { Stack, useRouter } from "expo-router"; import { StatusBar } from "expo-status-bar"; -import "react-native-reanimated"; -import { useEffect, useState } from "react"; import { onAuthStateChanged, User } from "firebase/auth"; -import { auth, db } from "../firebase_config"; -import { useRouter } from "expo-router"; -import { useColorScheme } from "@/hooks/use-color-scheme"; import { doc, getDoc } from "firebase/firestore"; +import { useEffect, useState } from "react"; +import "react-native-reanimated"; +import { auth, db } from "../firebase_config"; -import { UIManager, Platform } from 'react-native'; -import { ChantierProvider } from "./Context"; +import { Platform, UIManager } from 'react-native'; +import { ChantierProvider } from "./ContextChantier"; export const unstable_settings = { diff --git a/app/login/login.tsx b/app/login/login.tsx index 1150585..8749b17 100644 --- a/app/login/login.tsx +++ b/app/login/login.tsx @@ -1,15 +1,13 @@ -import React, { useState } from "react"; -import { View, Text, TextInput, Button, StyleSheet } from "react-native"; -import { - signInWithEmailAndPassword, - createUserWithEmailAndPassword, -} from "firebase/auth"; -import { doc, setDoc } from "firebase/firestore"; -import { auth, db } from "../../firebase_config"; -import { router } from "expo-router"; -import { ThemedTextInput } from "@/components/themed-textinpute"; import { ThemedText } from "@/components/themed-text"; +import { ThemedTextInput } from "@/components/themed-textinput"; import { ThemedView } from "@/components/themed-view"; +import { router } from "expo-router"; +import { + signInWithEmailAndPassword +} from "firebase/auth"; +import React, { useState } from "react"; +import { Button, StyleSheet, View } from "react-native"; +import { auth } from "../../firebase_config"; const DEFAULT_ROLE = "resp"; diff --git a/class/class.tsx b/class/class.tsx index 24ff68a..98c3e8b 100644 --- a/class/class.tsx +++ b/class/class.tsx @@ -10,6 +10,7 @@ export class Chantier{ tempsEst : number; vehicules : Vehicule[]; anomalies : string[]; + urlImg : string; constructor( id: number, @@ -22,7 +23,8 @@ export class Chantier{ dateDep: string, tempsEst: number, vehicules: Vehicule[], - anomalies: string[] + anomalies: string[], + urlImg: string ) { this.id = id; this.adresse = adresse; @@ -35,6 +37,7 @@ export class Chantier{ this.tempsEst = tempsEst; this.vehicules = vehicules; this.anomalies = anomalies; + this.urlImg = urlImg; } } @@ -136,4 +139,17 @@ export class Vehicule { } -export const exempleChantier = new Chantier(1,"Rennes","en cours","contact",new Chef(1,"Chyeef","YEE",[]),[],[],"01/01/25",10,[],["YEE"]) +export const exempleChantier = new Chantier( + 1, + "Rennes", + "en cours", + "contact", + new Chef(1,"Chyeef","YEE",[]), + [], + [], + "01/01/25", + 10, + [], + ["YEE"], + "https://cdn.discordapp.com/attachments/1425108443571945644/1427207643180826757/raw.png?ex=69392bb2&is=6937da32&hm=dcc09e76d3dca89d2418947b46efbd38673b9dc559027724b2e51d493b173bc9&" +) diff --git a/components/selectChantier.tsx b/components/selectChantier.tsx index d486313..6b48b63 100644 --- a/components/selectChantier.tsx +++ b/components/selectChantier.tsx @@ -1,13 +1,12 @@ +import { useChantier } from '@/app/ContextChantier'; +import { Chantier, exempleChantier } from '@/class/class'; import { useState } from 'react'; -import { Button, GestureResponderEvent, Pressable, ScrollView, StyleSheet, View, LayoutAnimation } from 'react-native'; -import { ThemedTextInput } from './themed-textinpute'; -import { ThemedView } from "./themed-view"; -import { ThemedText } from './themed-text'; +import { Dimensions, Image, LayoutAnimation, Pressable, ScrollView, StyleSheet, View } from 'react-native'; +import Animated, { LinearTransition } from 'react-native-reanimated'; import { ThemedButton } from './themed-button'; -import { Chantier, Chef, exempleChantier } from '@/class/class'; -import { Dimensions } from "react-native"; -import Animated, { Layout,LinearTransition,Easing,runOnJS } from 'react-native-reanimated'; -import { useChantier } from '@/app/Context'; +import { ThemedText } from './themed-text'; +import { ThemedTextInput } from './themed-textinput'; +import { ThemedView } from "./themed-view"; const screenHeight = Dimensions.get("window").height; @@ -50,10 +49,16 @@ export default function SelectChantier() { return( selectChantier(chantier)}> - adresse: {chantier.adresse} - chef de chantier: {chantier.chef.prenom} {chantier.chef.nom} - date de début: {chantier.dateDep} - etat: {chantier.etat} + + + + + + Adresse: {chantier.adresse} + Chef de chantier: {chantier.chef.prenom} {chantier.chef.nom} + Date de début: {chantier.dateDep} + Etat: {chantier.etat} + ); @@ -80,15 +85,15 @@ export default function SelectChantier() { value={search} onChangeText={setSearch} /> - - - - {chantiers.map((chantier, index) => ( - renderChantier(chantier, index) - )) - } - - + + + + {chantiers.map((chantier, index) => ( + renderChantier(chantier, index) + )) + } + + } @@ -146,7 +151,15 @@ const styles = StyleSheet.create({ //margin:5, borderRadius:10, //borderWidth: 1, - + flexDirection: 'row', + height: 100, + }, + image:{ + margin:0, + width: 60, + height: 90, + borderRadius: 5, + marginRight: 10, }, input: { width: '100%', diff --git a/components/themed-textinpute.tsx b/components/themed-textinput.tsx similarity index 100% rename from components/themed-textinpute.tsx rename to components/themed-textinput.tsx diff --git a/package-lock.json b/package-lock.json index c07e9de..30cf17c 100644 --- a/package-lock.json +++ b/package-lock.json @@ -13,7 +13,6 @@ "@react-navigation/elements": "^2.6.3", "@react-navigation/native": "^7.1.19", "expo": "~54.0.13", - "expo-blur": "~15.0.7", "expo-constants": "~18.0.9", "expo-font": "~14.0.9", "expo-haptics": "~15.0.7", @@ -86,6 +85,7 @@ "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.28.4.tgz", "integrity": "sha512-2BCOP7TN8M+gVDj7/ht3hsaO/B/n5oDbiAyyvnRlNOs+u1o+JWNYTQrmpuNp1/Wq2gcFrI01JAW+paEKDMx/CA==", "license": "MIT", + "peer": true, "dependencies": { "@babel/code-frame": "^7.27.1", "@babel/generator": "^7.28.3", @@ -1467,6 +1467,7 @@ "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.28.4.tgz", "integrity": "sha512-Q/N6JNWvIvPnLDvjlE1OUBLPQHH6l3CltCEsHIujp45zQUSSh8K+gHnaEX45yAT1nyngnINhvWtzN+Nb9D8RAQ==", "license": "MIT", + "peer": true, "engines": { "node": ">=6.9.0" } @@ -2327,6 +2328,7 @@ "resolved": "https://registry.npmjs.org/@firebase/app/-/app-0.14.5.tgz", "integrity": "sha512-zyNY77xJOGwcuB+xCxF8z8lSiHvD4ox7BCsqLEHEvgqQoRjxFZ0fkROR6NV5QyXmCqRLodMM8J5d2EStOocWIw==", "license": "Apache-2.0", + "peer": true, "dependencies": { "@firebase/component": "0.7.0", "@firebase/logger": "0.5.0", @@ -2393,6 +2395,7 @@ "resolved": "https://registry.npmjs.org/@firebase/app-compat/-/app-compat-0.5.5.tgz", "integrity": "sha512-lVG/nRnXaot0rQSZazmTNqy83ti9O3+kdwoaE0d5wahRIWNoDirbIMcGVjDDgdmf4IE6FYreWOMh0L3DV1475w==", "license": "Apache-2.0", + "peer": true, "dependencies": { "@firebase/app": "0.14.5", "@firebase/component": "0.7.0", @@ -2408,7 +2411,8 @@ "version": "0.9.3", "resolved": "https://registry.npmjs.org/@firebase/app-types/-/app-types-0.9.3.tgz", "integrity": "sha512-kRVpIl4vVGJ4baogMDINbyrIOtOxqhkZQg4jTq3l8Lw6WSk0xfpEYzezFu+Kl4ve4fbPl79dvwRtaFqAC/ucCw==", - "license": "Apache-2.0" + "license": "Apache-2.0", + "peer": true }, "node_modules/@firebase/auth": { "version": "1.11.1", @@ -2859,6 +2863,7 @@ "integrity": "sha512-0AZUyYUfpMNcztR5l09izHwXkZpghLgCUaAGjtMwXnCg3bj4ml5VgiwqOMOxJ+Nw4qN/zJAaOQBcJ7KGkWStqQ==", "hasInstallScript": true, "license": "Apache-2.0", + "peer": true, "dependencies": { "tslib": "^2.1.0" }, @@ -3871,6 +3876,7 @@ "resolved": "https://registry.npmjs.org/@react-navigation/native/-/native-7.1.19.tgz", "integrity": "sha512-fM7q8di4Q8sp2WUhiUWOe7bEDRyRhbzsKQOd5N2k+lHeCx3UncsRYuw4Q/KN0EovM3wWKqMMmhy/YWuEO04kgw==", "license": "MIT", + "peer": true, "dependencies": { "@react-navigation/core": "^7.13.0", "escape-string-regexp": "^4.0.0", @@ -4073,6 +4079,7 @@ "integrity": "sha512-Qec1E3mhALmaspIrhWt9jkQMNdw6bReVu64mjvhbhq2NFPftLPVr+l1SZgmw/66WwBNpDh7ao5AT6gF5v41PFA==", "devOptional": true, "license": "MIT", + "peer": true, "dependencies": { "csstype": "^3.0.2" } @@ -4144,6 +4151,7 @@ "integrity": "sha512-n1H6IcDhmmUEG7TNVSspGmiHHutt7iVKtZwRppD7e04wha5MrkV1h3pti9xQLcCMt6YWsncpoT0HMjkH1FNwWQ==", "dev": true, "license": "MIT", + "peer": true, "dependencies": { "@typescript-eslint/scope-manager": "8.46.0", "@typescript-eslint/types": "8.46.0", @@ -4706,6 +4714,7 @@ "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.15.0.tgz", "integrity": "sha512-NZyJarBfL7nWwIq+FDL6Zp/yHEhePMNnnJ0y3qfieCrmNvYct8uvtiV41UvlSe6apAfk0fY1FbWx+NwfmpvtTg==", "license": "MIT", + "peer": true, "bin": { "acorn": "bin/acorn" }, @@ -5391,6 +5400,7 @@ } ], "license": "MIT", + "peer": true, "dependencies": { "baseline-browser-mapping": "^2.8.9", "caniuse-lite": "^1.0.30001746", @@ -6530,6 +6540,7 @@ "integrity": "sha512-XyLmROnACWqSxiGYArdef1fItQd47weqB7iwtfr9JHwRrqIXZdcFMvvEcL9xHCmL0SNsOvF0c42lWyM1U5dgig==", "dev": true, "license": "MIT", + "peer": true, "dependencies": { "@eslint-community/eslint-utils": "^4.8.0", "@eslint-community/regexpp": "^4.12.1", @@ -6727,6 +6738,7 @@ "integrity": "sha512-whOE1HFo/qJDyX4SnXzP4N6zOWn79WhnCUY/iDR0mPfQZO8wcYE4JClzI2oZrhBnnMUCBCHZhO6VQyoBU95mZA==", "dev": true, "license": "MIT", + "peer": true, "dependencies": { "@rtsao/scc": "^1.1.0", "array-includes": "^3.1.9", @@ -6965,6 +6977,7 @@ "resolved": "https://registry.npmjs.org/expo/-/expo-54.0.13.tgz", "integrity": "sha512-F1puKXzw8ESnsbvaKdXtcIiyYLQ2kUHqP8LuhgtJS1wm6w55VhtOPg8yl/0i8kPbTA0YfD+KYdXjSfhPXgUPxw==", "license": "MIT", + "peer": true, "dependencies": { "@babel/runtime": "^7.20.0", "@expo/cli": "54.0.11", @@ -7027,22 +7040,12 @@ "react-native": "*" } }, - "node_modules/expo-blur": { - "version": "15.0.7", - "resolved": "https://registry.npmjs.org/expo-blur/-/expo-blur-15.0.7.tgz", - "integrity": "sha512-SugQQbQd+zRPy8z2G5qDD4NqhcD7srBF7fN7O7yq6q7ZFK59VWvpDxtMoUkmSfdxgqONsrBN/rLdk00USADrMg==", - "license": "MIT", - "peerDependencies": { - "expo": "*", - "react": "*", - "react-native": "*" - } - }, "node_modules/expo-constants": { "version": "18.0.9", "resolved": "https://registry.npmjs.org/expo-constants/-/expo-constants-18.0.9.tgz", "integrity": "sha512-sqoXHAOGDcr+M9NlXzj1tGoZyd3zxYDy215W6E0Z0n8fgBaqce9FAYQE2bu5X4G629AYig5go7U6sQz7Pjcm8A==", "license": "MIT", + "peer": true, "dependencies": { "@expo/config": "~12.0.9", "@expo/env": "~2.0.7" @@ -7067,6 +7070,7 @@ "resolved": "https://registry.npmjs.org/expo-font/-/expo-font-14.0.9.tgz", "integrity": "sha512-xCoQbR/36qqB6tew/LQ6GWICpaBmHLhg/Loix5Rku/0ZtNaXMJv08M9o1AcrdiGTn/Xf/BnLu6DgS45cWQEHZg==", "license": "MIT", + "peer": true, "dependencies": { "fontfaceobserver": "^2.1.0" }, @@ -7117,6 +7121,7 @@ "resolved": "https://registry.npmjs.org/expo-linking/-/expo-linking-8.0.8.tgz", "integrity": "sha512-MyeMcbFDKhXh4sDD1EHwd0uxFQNAc6VCrwBkNvvvufUsTYFq3glTA9Y8a+x78CPpjNqwNAamu74yIaIz7IEJyg==", "license": "MIT", + "peer": true, "dependencies": { "expo-constants": "~18.0.8", "invariant": "^2.2.4" @@ -11352,6 +11357,7 @@ "resolved": "https://registry.npmjs.org/react/-/react-19.1.0.tgz", "integrity": "sha512-FS+XFBNvn3GTAWq26joslQgWNoFu08F4kl0J4CgdNKADkdSGXQyTCnKteIAJy96Br6YbpEU1LSzV5dYtjMkMDg==", "license": "MIT", + "peer": true, "engines": { "node": ">=0.10.0" } @@ -11371,6 +11377,7 @@ "resolved": "https://registry.npmjs.org/react-dom/-/react-dom-19.1.0.tgz", "integrity": "sha512-Xs1hdnE+DyKgeHJeJznQmYMIBG3TKIHJJT95Q58nHLSrElKlGQqDTR2HQ9fx5CN/Gk6Vh/kupBTDLU11/nDk/g==", "license": "MIT", + "peer": true, "dependencies": { "scheduler": "^0.26.0" }, @@ -11407,6 +11414,7 @@ "resolved": "https://registry.npmjs.org/react-native/-/react-native-0.81.4.tgz", "integrity": "sha512-bt5bz3A/+Cv46KcjV0VQa+fo7MKxs17RCcpzjftINlen4ZDUl0I6Ut+brQ2FToa5oD0IB0xvQHfmsg2EDqsZdQ==", "license": "MIT", + "peer": true, "dependencies": { "@jest/create-cache-key-function": "^29.7.0", "@react-native/assets-registry": "0.81.4", @@ -11464,6 +11472,7 @@ "resolved": "https://registry.npmjs.org/react-native-gesture-handler/-/react-native-gesture-handler-2.28.0.tgz", "integrity": "sha512-0msfJ1vRxXKVgTgvL+1ZOoYw3/0z1R+Ked0+udoJhyplC2jbVKIJ8Z1bzWdpQRCV3QcQ87Op0zJVE5DhKK2A0A==", "license": "MIT", + "peer": true, "dependencies": { "@egjs/hammerjs": "^2.0.17", "hoist-non-react-statics": "^3.3.0", @@ -11511,6 +11520,7 @@ "resolved": "https://registry.npmjs.org/react-native-reanimated/-/react-native-reanimated-4.1.3.tgz", "integrity": "sha512-GP8wsi1u3nqvC1fMab/m8gfFwFyldawElCcUSBJQgfrXeLmsPPUOpDw44lbLeCpcwUuLa05WTVePdTEwCLTUZg==", "license": "MIT", + "peer": true, "dependencies": { "react-native-is-edge-to-edge": "^1.2.1", "semver": "7.7.2" @@ -11539,6 +11549,7 @@ "resolved": "https://registry.npmjs.org/react-native-safe-area-context/-/react-native-safe-area-context-5.6.2.tgz", "integrity": "sha512-4XGqMNj5qjUTYywJqpdWZ9IG8jgkS3h06sfVjfw5yZQZfWnRFXczi0GnYyFyCc2EBps/qFmoCH8fez//WumdVg==", "license": "MIT", + "peer": true, "peerDependencies": { "react": "*", "react-native": "*" @@ -11549,6 +11560,7 @@ "resolved": "https://registry.npmjs.org/react-native-screens/-/react-native-screens-4.16.0.tgz", "integrity": "sha512-yIAyh7F/9uWkOzCi1/2FqvNvK6Wb9Y1+Kzn16SuGfN9YFJDTbwlzGRvePCNTOX0recpLQF3kc2FmvMUhyTCH1Q==", "license": "MIT", + "peer": true, "dependencies": { "react-freeze": "^1.0.0", "react-native-is-edge-to-edge": "^1.2.1", @@ -11564,6 +11576,7 @@ "resolved": "https://registry.npmjs.org/react-native-web/-/react-native-web-0.21.1.tgz", "integrity": "sha512-BeNsgwwe4AXUFPAoFU+DKjJ+CVQa3h54zYX77p7GVZrXiiNo3vl03WYDYVEy5R2J2HOPInXtQZB5gmj3vuzrKg==", "license": "MIT", + "peer": true, "dependencies": { "@babel/runtime": "^7.18.6", "@react-native/normalize-colors": "^0.74.1", @@ -11596,6 +11609,7 @@ "resolved": "https://registry.npmjs.org/react-native-worklets/-/react-native-worklets-0.5.1.tgz", "integrity": "sha512-lJG6Uk9YuojjEX/tQrCbcbmpdLCSFxDK1rJlkDhgqkVi1KZzG7cdcBFQRqyNOOzR9Y0CXNuldmtWTGOyM0k0+w==", "license": "MIT", + "peer": true, "dependencies": { "@babel/plugin-transform-arrow-functions": "^7.0.0-0", "@babel/plugin-transform-class-properties": "^7.0.0-0", @@ -11706,6 +11720,7 @@ "resolved": "https://registry.npmjs.org/react-refresh/-/react-refresh-0.14.2.tgz", "integrity": "sha512-jCvmsr+1IUSMUyzOkRcvnVbX3ZYC6g9TDrDbFuFmRDq7PD4yaGbLKNQL6k2jnArV8hjYxh7hVhAZB6s9HDGpZA==", "license": "MIT", + "peer": true, "engines": { "node": ">=0.10.0" } @@ -13128,6 +13143,7 @@ "integrity": "sha512-5gTmgEY/sqK6gFXLIsQNH19lWb4ebPDLA4SdLP7dsWkIXHWlG66oPuVvXSGFPppYZz8ZDZq0dYYrbHfBCVUb1Q==", "dev": true, "license": "MIT", + "peer": true, "engines": { "node": ">=12" }, @@ -13334,6 +13350,7 @@ "integrity": "sha512-jl1vZzPDinLr9eUt3J/t7V6FgNEw9QjvBPdysz9KfQDD41fQrC2Y4vKQdiaUpFT4bXlb1RHhLpp8wtm6M5TgSw==", "dev": true, "license": "Apache-2.0", + "peer": true, "bin": { "tsc": "bin/tsc", "tsserver": "bin/tsserver" @@ -14309,6 +14326,7 @@ "resolved": "https://registry.npmjs.org/zod/-/zod-3.25.76.tgz", "integrity": "sha512-gzUt/qt81nXsFGKIFcC3YnfEAx5NkunCfnDlvuBSSFS02bcXu4Lmea0AFIUwbLWxWPx3d9p8S5QoaujKcNQxcQ==", "license": "MIT", + "peer": true, "funding": { "url": "https://github.com/sponsors/colinhacks" } diff --git a/package.json b/package.json index 6f506cb..ee2cf16 100644 --- a/package.json +++ b/package.json @@ -16,7 +16,6 @@ "@react-navigation/elements": "^2.6.3", "@react-navigation/native": "^7.1.19", "expo": "~54.0.13", - "expo-blur": "~15.0.7", "expo-constants": "~18.0.9", "expo-font": "~14.0.9", "expo-haptics": "~15.0.7",