From 40cc6cea25d048c2e77e11bbfea0cd1e5eb784f6 Mon Sep 17 00:00:00 2001 From: Enrique Pérez Pérez Date: Sun, 19 Apr 2026 19:32:09 +0200 Subject: Completado cambios pantalla oficinas y detalle de oficina #12 y #13 --- package-lock.json | 146 ++++++---- package.json | 2 +- src/app/(protected)/(tabs)/offices/index.tsx | 413 ++++++++++++++------------- src/app/(protected)/offices/[officeId].tsx | 408 ++++++++++++++------------ 4 files changed, 542 insertions(+), 427 deletions(-) diff --git a/package-lock.json b/package-lock.json index cf1dd15..09422eb 100644 --- a/package-lock.json +++ b/package-lock.json @@ -28,7 +28,7 @@ "expo-symbols": "~1.0.8", "expo-system-ui": "~6.0.9", "expo-web-browser": "~15.0.10", - "firebase": "^12.11.0", + "firebase": "^12.12.0", "react": "19.1.0", "react-dom": "19.1.0", "react-native": "0.81.5", @@ -94,6 +94,7 @@ "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.28.6.tgz", "integrity": "sha512-H3mcG6ZDLTlYfaSNi0iOKkigqMFvkTKlGUYlD8GW7nNOYRrevuA46iTypPyv+06V3fEmvvazfntkBU34L0azAw==", "license": "MIT", + "peer": true, "dependencies": { "@babel/code-frame": "^7.28.6", "@babel/generator": "^7.28.6", @@ -3125,9 +3126,9 @@ } }, "node_modules/@firebase/ai": { - "version": "2.10.0", - "resolved": "https://registry.npmjs.org/@firebase/ai/-/ai-2.10.0.tgz", - "integrity": "sha512-1lI6HomyoO/8RSJb6ItyHLpHnB2z27m5F4aX/Vpi1nhwWoxdNjkq+6UQOykHyCE0KairojOE5qQ20i1tnF0nNA==", + "version": "2.11.0", + "resolved": "https://registry.npmjs.org/@firebase/ai/-/ai-2.11.0.tgz", + "integrity": "sha512-+oqOne/h5J51LezazR+VyzKe3AK455W29JXnb4jOeVvQhC7FymledN5+XE+w5vEcMhRQ6n1f62fdGs4A44X32A==", "license": "Apache-2.0", "dependencies": { "@firebase/app-check-interop-types": "0.3.3", @@ -3183,10 +3184,11 @@ "license": "Apache-2.0" }, "node_modules/@firebase/app": { - "version": "0.14.10", - "resolved": "https://registry.npmjs.org/@firebase/app/-/app-0.14.10.tgz", - "integrity": "sha512-PlPhdtjgWUra+LImQTnXOUqUa/jcufZhizdR93ZjlQSS3ahCtDTG6pJw7j0OwFal18DQjICXfeVNsUUrcNisfA==", + "version": "0.14.11", + "resolved": "https://registry.npmjs.org/@firebase/app/-/app-0.14.11.tgz", + "integrity": "sha512-yxADFW35LYkP8oSGobGsYIrI42I+GPCvKTNHx4meT9Yq3C950IVz1eANoBk822I9tbKv1wyv9P4Bv1G5TpucFw==", "license": "Apache-2.0", + "peer": true, "dependencies": { "@firebase/component": "0.7.2", "@firebase/logger": "0.5.0", @@ -3249,12 +3251,13 @@ "license": "Apache-2.0" }, "node_modules/@firebase/app-compat": { - "version": "0.5.10", - "resolved": "https://registry.npmjs.org/@firebase/app-compat/-/app-compat-0.5.10.tgz", - "integrity": "sha512-tFmBuZL0/v1h6eyKRgWI58ucft6dEJmAi9nhPUXoAW4ZbPSTlnsh31AuEwUoRTz+wwRk9gmgss9GZV05ZM9Kug==", + "version": "0.5.11", + "resolved": "https://registry.npmjs.org/@firebase/app-compat/-/app-compat-0.5.11.tgz", + "integrity": "sha512-KaACDjXkK5VLpI01vEs592R7/8s5DjFdIXfKoR385ly1SmK3Tu+jMHCIB4MsiY5jsez6v7VlEX/3rJ90dVkHyA==", "license": "Apache-2.0", + "peer": true, "dependencies": { - "@firebase/app": "0.14.10", + "@firebase/app": "0.14.11", "@firebase/component": "0.7.2", "@firebase/logger": "0.5.0", "@firebase/util": "1.15.0", @@ -3265,15 +3268,19 @@ } }, "node_modules/@firebase/app-types": { - "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" + "version": "0.9.4", + "resolved": "https://registry.npmjs.org/@firebase/app-types/-/app-types-0.9.4.tgz", + "integrity": "sha512-crX9TA5SVYZwLPG7/R16IsH8FLlgkPXjJUVhsVpHVDSqJiq3D/NuFTM5ctxGTExXAOeIn//69tQw47CPerM8MQ==", + "license": "Apache-2.0", + "peer": true, + "dependencies": { + "@firebase/logger": "0.5.0" + } }, "node_modules/@firebase/auth": { - "version": "1.12.2", - "resolved": "https://registry.npmjs.org/@firebase/auth/-/auth-1.12.2.tgz", - "integrity": "sha512-CZJL8V10Vzibs+pDTXdQF+hot1IigIoqF4a4lA/qr5Deo1srcefiyIfgg28B67Lk7IxZhwfJMuI+1bu2xBmV0A==", + "version": "1.13.0", + "resolved": "https://registry.npmjs.org/@firebase/auth/-/auth-1.13.0.tgz", + "integrity": "sha512-mKkSLNym3UbnnZ06dAmtqzp5EpPGCANGCZDJbkoR135aoUdKG6Aizwcnp29RzsQpwH0nmy5nay17Sfbsh9oY8A==", "license": "Apache-2.0", "dependencies": { "@firebase/component": "0.7.2", @@ -3286,7 +3293,7 @@ }, "peerDependencies": { "@firebase/app": "0.x", - "@react-native-async-storage/async-storage": "^2.2.0" + "@react-native-async-storage/async-storage": "^2.2.0 || ^3.0.0" }, "peerDependenciesMeta": { "@react-native-async-storage/async-storage": { @@ -3295,12 +3302,12 @@ } }, "node_modules/@firebase/auth-compat": { - "version": "0.6.4", - "resolved": "https://registry.npmjs.org/@firebase/auth-compat/-/auth-compat-0.6.4.tgz", - "integrity": "sha512-2pj8m/hnqXvMLfC0Mk+fORVTM5DQPkS6l8JpMgtoAWGVgCmYnoWdFMaNWtKbmCxBEyvMA3FlnCJyzrUSMWTfuA==", + "version": "0.6.5", + "resolved": "https://registry.npmjs.org/@firebase/auth-compat/-/auth-compat-0.6.5.tgz", + "integrity": "sha512-IfVsafZ3QiXbsydXTP/XMI0wVYbJLI1rkb8Qqf03/h5FnL+upbbPOb+6Yj3RpcX+Y1iP5Uh18lxTHlXfbiyAow==", "license": "Apache-2.0", "dependencies": { - "@firebase/auth": "1.12.2", + "@firebase/auth": "1.13.0", "@firebase/auth-types": "0.13.0", "@firebase/component": "0.7.2", "@firebase/util": "1.15.0", @@ -3343,9 +3350,9 @@ } }, "node_modules/@firebase/data-connect": { - "version": "0.5.0", - "resolved": "https://registry.npmjs.org/@firebase/data-connect/-/data-connect-0.5.0.tgz", - "integrity": "sha512-G3GYHpWNJJ95502RQLApzw0jaG3pScHl+J/2MdxIuB51xtHnkRL6KvIAP3fFF1drUewWJHOnDA1U+q4Evf3KSw==", + "version": "0.6.0", + "resolved": "https://registry.npmjs.org/@firebase/data-connect/-/data-connect-0.6.0.tgz", + "integrity": "sha512-OiugPRcdlhqXF97oR9CjVObILmsWU0dFUS0gXNYEe4bDfpW8pZmQ5GqhIPPtLWbT/0W2lMJJD7VILFMk+xuHPg==", "license": "Apache-2.0", "dependencies": { "@firebase/auth-interop-types": "0.2.4", @@ -3377,14 +3384,14 @@ } }, "node_modules/@firebase/database-compat": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/@firebase/database-compat/-/database-compat-2.1.2.tgz", - "integrity": "sha512-j4A6IhVZbgxAzT6gJJC2PfOxYCK9SrDrUO7nTM4EscTYtKkAkzsbKoCnDdjFapQfnsncvPWjqVTr/0PffUwg3g==", + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/@firebase/database-compat/-/database-compat-2.1.3.tgz", + "integrity": "sha512-GMyfWjD8mehjg/QpNkY/tl9G/MoeugPeg91n9D0atggxbWuKF/2KhVPHZDH+XmoP0EKYqMWYTtKxBsaBaNKLYQ==", "license": "Apache-2.0", "dependencies": { "@firebase/component": "0.7.2", "@firebase/database": "1.1.2", - "@firebase/database-types": "1.0.18", + "@firebase/database-types": "1.0.19", "@firebase/logger": "0.5.0", "@firebase/util": "1.15.0", "tslib": "^2.1.0" @@ -3394,19 +3401,19 @@ } }, "node_modules/@firebase/database-types": { - "version": "1.0.18", - "resolved": "https://registry.npmjs.org/@firebase/database-types/-/database-types-1.0.18.tgz", - "integrity": "sha512-yOY8IC2go9lfbVDMiy2ATun4EB2AFwocPaQADwMN/RHRUAZSM4rlAV7PGbWPSG/YhkJ2A9xQAiAENgSua9G5Fg==", + "version": "1.0.19", + "resolved": "https://registry.npmjs.org/@firebase/database-types/-/database-types-1.0.19.tgz", + "integrity": "sha512-FqewjUZmV9LqFfuEnmgdcUpiOUz7qwLXxnm/H8BcMFEzQXtd1yyUDm8ex5VRad2nuTE+ahOuCjUAM/cyDncO+g==", "license": "Apache-2.0", "dependencies": { - "@firebase/app-types": "0.9.3", + "@firebase/app-types": "0.9.4", "@firebase/util": "1.15.0" } }, "node_modules/@firebase/firestore": { - "version": "4.13.0", - "resolved": "https://registry.npmjs.org/@firebase/firestore/-/firestore-4.13.0.tgz", - "integrity": "sha512-7i4cVNJXTMim7/P7UsNim0DwyLPk4QQ3y1oSNzv4l0ykJOKYCiFMOuEeUxUYvrReXDJxWHrT/4XMeVQm+13rRw==", + "version": "4.14.0", + "resolved": "https://registry.npmjs.org/@firebase/firestore/-/firestore-4.14.0.tgz", + "integrity": "sha512-bZc6YOjRkMBVA16527tgzi6iN9n//xRB3Mmx/R+Gr6UAP/+xrIKOejQIcn1hh+tCzNT8jO0jI+kWox5J4tB/qQ==", "license": "Apache-2.0", "dependencies": { "@firebase/component": "0.7.2", @@ -3425,13 +3432,13 @@ } }, "node_modules/@firebase/firestore-compat": { - "version": "0.4.7", - "resolved": "https://registry.npmjs.org/@firebase/firestore-compat/-/firestore-compat-0.4.7.tgz", - "integrity": "sha512-Et4XxtGnjp0Q9tmaEMETnY5GHJ8gQ9+RN6sSTT4ETWKmym2d6gIjarw0rCQcx+7BrWVYLEIOAXSXysl0b3xnUA==", + "version": "0.4.8", + "resolved": "https://registry.npmjs.org/@firebase/firestore-compat/-/firestore-compat-0.4.8.tgz", + "integrity": "sha512-WK9NJRpnosGD2nuyjdr7K+Ht7AxRYJlTF62myI4rRA7ibJOosbecvjacR5oirJ7s1BgNS6qzcBw7n4fD3a5w1w==", "license": "Apache-2.0", "dependencies": { "@firebase/component": "0.7.2", - "@firebase/firestore": "4.13.0", + "@firebase/firestore": "4.14.0", "@firebase/firestore-types": "3.0.3", "@firebase/util": "1.15.0", "tslib": "^2.1.0" @@ -3719,6 +3726,7 @@ "integrity": "sha512-AmWf3cHAOMbrCPG4xdPKQaj5iHnyYfyLKZxwz+Xf55bqKbpAmcYifB4jQinT2W9XhDRHISOoPyBOariJpCG6FA==", "hasInstallScript": true, "license": "Apache-2.0", + "peer": true, "dependencies": { "tslib": "^2.1.0" }, @@ -4686,6 +4694,7 @@ "resolved": "https://registry.npmjs.org/@react-native-async-storage/async-storage/-/async-storage-2.2.0.tgz", "integrity": "sha512-gvRvjR5JAaUZF8tv2Kcq/Gbt3JHwbKFYfmb445rhOj6NUMx3qPLixmDx5pZAyb9at1bYvJ4/eTUipU5aki45xw==", "license": "MIT", + "peer": true, "dependencies": { "merge-options": "^3.0.4" }, @@ -4987,6 +4996,7 @@ "resolved": "https://registry.npmjs.org/@react-navigation/native/-/native-7.1.28.tgz", "integrity": "sha512-d1QDn+KNHfHGt3UIwOZvupvdsDdiHYZBEj7+wL2yDVo3tMezamYy60H9s3EnNVE1Ae1ty0trc7F2OKqo/RmsdQ==", "license": "MIT", + "peer": true, "dependencies": { "@react-navigation/core": "^7.14.0", "escape-string-regexp": "^4.0.0", @@ -5332,6 +5342,7 @@ "integrity": "sha512-Qec1E3mhALmaspIrhWt9jkQMNdw6bReVu64mjvhbhq2NFPftLPVr+l1SZgmw/66WwBNpDh7ao5AT6gF5v41PFA==", "devOptional": true, "license": "MIT", + "peer": true, "dependencies": { "csstype": "^3.0.2" } @@ -5409,6 +5420,7 @@ "integrity": "sha512-nm3cvFN9SqZGXjmw5bZ6cGmvJSyJPn0wU9gHAZZHDnZl2wF9PhHv78Xf06E0MaNk4zLVHL8hb2/c32XvyJOLQg==", "dev": true, "license": "MIT", + "peer": true, "dependencies": { "@typescript-eslint/scope-manager": "8.53.1", "@typescript-eslint/types": "8.53.1", @@ -5978,6 +5990,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" }, @@ -6710,6 +6723,7 @@ } ], "license": "MIT", + "peer": true, "dependencies": { "baseline-browser-mapping": "^2.9.0", "caniuse-lite": "^1.0.30001759", @@ -8076,6 +8090,7 @@ "dev": true, "hasInstallScript": true, "license": "MIT", + "peer": true, "bin": { "esbuild": "bin/esbuild" }, @@ -8190,6 +8205,7 @@ "integrity": "sha512-LEyamqS7W5HB3ujJyvi0HQK/dtVINZvd5mAAp9eT5S/ujByGjiZLCzPcHVzuXbpJDJF/cxwHlfceVUDZ2lnSTw==", "dev": true, "license": "MIT", + "peer": true, "dependencies": { "@eslint-community/eslint-utils": "^4.8.0", "@eslint-community/regexpp": "^4.12.1", @@ -8386,6 +8402,7 @@ "integrity": "sha512-whOE1HFo/qJDyX4SnXzP4N6zOWn79WhnCUY/iDR0mPfQZO8wcYE4JClzI2oZrhBnnMUCBCHZhO6VQyoBU95mZA==", "dev": true, "license": "MIT", + "peer": true, "dependencies": { "@rtsao/scc": "^1.1.0", "array-includes": "^3.1.9", @@ -8700,6 +8717,7 @@ "resolved": "https://registry.npmjs.org/expo/-/expo-54.0.31.tgz", "integrity": "sha512-kQ3RDqA/a59I7y+oqQGyrPbbYlgPMUdKBOgvFLpoHbD2bCM+F75i4N0mUijy7dG5F/CUCu2qHmGGUCXBbMDkCg==", "license": "MIT", + "peer": true, "dependencies": { "@babel/runtime": "^7.20.0", "@expo/cli": "54.0.21", @@ -8767,6 +8785,7 @@ "resolved": "https://registry.npmjs.org/expo-constants/-/expo-constants-18.0.13.tgz", "integrity": "sha512-FnZn12E1dRYKDHlAdIyNFhBurKTS3F9CrfrBDJI5m3D7U17KBHMQ6JEfYlSj7LG7t+Ulr+IKaj58L1k5gBwTcQ==", "license": "MIT", + "peer": true, "dependencies": { "@expo/config": "~12.0.13", "@expo/env": "~2.0.8" @@ -8864,6 +8883,7 @@ "resolved": "https://registry.npmjs.org/expo-font/-/expo-font-14.0.10.tgz", "integrity": "sha512-UqyNaaLKRpj4pKAP4HZSLnuDQqueaO5tB1c/NWu5vh1/LF9ulItyyg2kF/IpeOp0DeOLk0GY0HrIXaKUMrwB+Q==", "license": "MIT", + "peer": true, "dependencies": { "fontfaceobserver": "^2.1.0" }, @@ -8920,6 +8940,7 @@ "resolved": "https://registry.npmjs.org/expo-linking/-/expo-linking-8.0.11.tgz", "integrity": "sha512-+VSaNL5om3kOp/SSKO5qe6cFgfSIWnnQDSbA7XLs3ECkYzXRquk5unxNS3pg7eK5kNUmQ4kgLI7MhTggAEUBLA==", "license": "MIT", + "peer": true, "dependencies": { "expo-constants": "~18.0.12", "invariant": "^2.2.4" @@ -9250,6 +9271,7 @@ "resolved": "https://registry.npmjs.org/expo-sqlite/-/expo-sqlite-16.0.10.tgz", "integrity": "sha512-tUOKxE9TpfneRG3eOfbNfhN9236SJ7IiUnP8gCqU7umd9DtgDGB/5PhYVVfl+U7KskgolgNoB9v9OZ9iwXN8Eg==", "license": "MIT", + "peer": true, "dependencies": { "await-lock": "^2.2.2" }, @@ -9671,26 +9693,26 @@ } }, "node_modules/firebase": { - "version": "12.11.0", - "resolved": "https://registry.npmjs.org/firebase/-/firebase-12.11.0.tgz", - "integrity": "sha512-W9f3Y+cgQYgF9gvCGxt0upec8zwAtiQVcHuU8MfzUIgVU/9fRQWtu48Geiv1lsigtBz9QHML++Km9xAKO5GB5Q==", + "version": "12.12.0", + "resolved": "https://registry.npmjs.org/firebase/-/firebase-12.12.0.tgz", + "integrity": "sha512-5Ap+pN5iEJUvBlQEZEmLuUm7Gvu6I5xv1jZ5SiSNyw4jrwlHo+4tmZv3OPPoKfN9eo1kBwyyBvi+pWHIPXwfYw==", "license": "Apache-2.0", "dependencies": { - "@firebase/ai": "2.10.0", + "@firebase/ai": "2.11.0", "@firebase/analytics": "0.10.21", "@firebase/analytics-compat": "0.2.27", - "@firebase/app": "0.14.10", + "@firebase/app": "0.14.11", "@firebase/app-check": "0.11.2", "@firebase/app-check-compat": "0.4.2", - "@firebase/app-compat": "0.5.10", - "@firebase/app-types": "0.9.3", - "@firebase/auth": "1.12.2", - "@firebase/auth-compat": "0.6.4", - "@firebase/data-connect": "0.5.0", + "@firebase/app-compat": "0.5.11", + "@firebase/app-types": "0.9.4", + "@firebase/auth": "1.13.0", + "@firebase/auth-compat": "0.6.5", + "@firebase/data-connect": "0.6.0", "@firebase/database": "1.1.2", - "@firebase/database-compat": "2.1.2", - "@firebase/firestore": "4.13.0", - "@firebase/firestore-compat": "0.4.7", + "@firebase/database-compat": "2.1.3", + "@firebase/firestore": "4.14.0", + "@firebase/firestore-compat": "0.4.8", "@firebase/functions": "0.13.3", "@firebase/functions-compat": "0.4.3", "@firebase/installations": "0.6.21", @@ -11141,6 +11163,7 @@ "integrity": "sha512-NIy3oAFp9shda19hy4HK0HRTWKtPJmGdnvywu01nOqNC2vZg+Z+fvJDxpMQA88eb2I9EcafcdjYgsDthnYTvGw==", "devOptional": true, "license": "MIT", + "peer": true, "dependencies": { "@jest/core": "^29.7.0", "@jest/types": "^29.6.3", @@ -14182,9 +14205,9 @@ "license": "MIT" }, "node_modules/protobufjs": { - "version": "7.5.4", - "resolved": "https://registry.npmjs.org/protobufjs/-/protobufjs-7.5.4.tgz", - "integrity": "sha512-CvexbZtbov6jW2eXAvLukXjXUW1TzFaivC46BpWc/3BpcCysb5Vffu+B3XHMm8lVEuy2Mm4XGex8hBSg1yapPg==", + "version": "7.5.5", + "resolved": "https://registry.npmjs.org/protobufjs/-/protobufjs-7.5.5.tgz", + "integrity": "sha512-3wY1AxV+VBNW8Yypfd1yQY9pXnqTAN+KwQxL8iYm3/BjKYMNg4i0owhEe26PWDOMaIrzeeF98Lqd5NGz4omiIg==", "hasInstallScript": true, "license": "BSD-3-Clause", "dependencies": { @@ -14343,6 +14366,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" }, @@ -14436,6 +14460,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", @@ -14489,6 +14514,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": "*" @@ -14499,6 +14525,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", @@ -14514,6 +14541,7 @@ "resolved": "https://registry.npmjs.org/react-native-web/-/react-native-web-0.21.2.tgz", "integrity": "sha512-SO2t9/17zM4iEnFvlu2DA9jqNbzNhoUP+AItkoCOyFmDMOhUnBBznBDCYN92fGdfAkfQlWzPoez6+zLxFNsZEg==", "license": "MIT", + "peer": true, "dependencies": { "@babel/runtime": "^7.18.6", "@react-native/normalize-colors": "^0.74.1", @@ -14656,6 +14684,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" } @@ -14735,6 +14764,7 @@ "integrity": "sha512-jXkSl3CpvPYEF+p/eGDLB4sPoDX8pKkYvRl9+rR8HxLY0X04vW7hCm1/0zHoUSjPZ3bDa+wXWNTDVIw/R8aDVw==", "devOptional": true, "license": "MIT", + "peer": true, "dependencies": { "react-is": "^19.1.0", "scheduler": "^0.26.0" @@ -16135,6 +16165,7 @@ "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-4.0.3.tgz", "integrity": "sha512-5gTmgEY/sqK6gFXLIsQNH19lWb4ebPDLA4SdLP7dsWkIXHWlG66oPuVvXSGFPppYZz8ZDZq0dYYrbHfBCVUb1Q==", "license": "MIT", + "peer": true, "engines": { "node": ">=12" }, @@ -16357,6 +16388,7 @@ "integrity": "sha512-jl1vZzPDinLr9eUt3J/t7V6FgNEw9QjvBPdysz9KfQDD41fQrC2Y4vKQdiaUpFT4bXlb1RHhLpp8wtm6M5TgSw==", "dev": true, "license": "Apache-2.0", + "peer": true, "bin": { "tsc": "bin/tsc", "tsserver": "bin/tsserver" diff --git a/package.json b/package.json index 821074f..f6fc449 100644 --- a/package.json +++ b/package.json @@ -35,7 +35,7 @@ "expo-symbols": "~1.0.8", "expo-system-ui": "~6.0.9", "expo-web-browser": "~15.0.10", - "firebase": "^12.11.0", + "firebase": "^12.12.0", "react": "19.1.0", "react-dom": "19.1.0", "react-native": "0.81.5", diff --git a/src/app/(protected)/(tabs)/offices/index.tsx b/src/app/(protected)/(tabs)/offices/index.tsx index 9040fbd..ee19917 100644 --- a/src/app/(protected)/(tabs)/offices/index.tsx +++ b/src/app/(protected)/(tabs)/offices/index.tsx @@ -9,53 +9,29 @@ import { TextInput, View, } from 'react-native'; + import { useOffices } from '@/features/offices/hooks/useOffices'; import { useFavoriteOffices } from '@/features/offices/hooks/useFavoriteOffices'; -import { StatusMessage } from '@/shared/ui/StatusMessage'; +import { Feather, MaterialIcons } from '@expo/vector-icons'; +import theme from '@/theme'; export default function OfficesScreen() { const { offices, loading, error, reload } = useOffices(); - const { - favoriteOfficeIdsSet, - isLoadingFavorites, - favoritesError, - pendingOfficeId, - toggleFavorite, - } = useFavoriteOffices(); + const { favoriteOfficeIdsSet, isLoadingFavorites } = useFavoriteOffices(); + const [search, setSearch] = useState(''); - const [minimumCapacity, setMinimumCapacity] = useState(''); - const [showFavoritesOnly, setShowFavoritesOnly] = useState(false); const filteredOffices = useMemo(() => { - const normalizedSearch = search.trim().toLowerCase(); - const parsedCapacity = Number(minimumCapacity); - const hasCapacityFilter = minimumCapacity.trim().length > 0 && !Number.isNaN(parsedCapacity); - - return offices.filter((office) => { - const matchesSearch = - normalizedSearch.length === 0 || - office.name.toLowerCase().includes(normalizedSearch); - - const matchesCapacity = - !hasCapacityFilter || office.capacity >= parsedCapacity; - - const matchesFavorites = - !showFavoritesOnly || favoriteOfficeIdsSet.has(office.id); - - return matchesSearch && matchesCapacity && matchesFavorites; - }); - }, [favoriteOfficeIdsSet, minimumCapacity, offices, search, showFavoritesOnly]); - - const clearFilters = () => { - setSearch(''); - setMinimumCapacity(''); - setShowFavoritesOnly(false); - }; + const normalized = search.toLowerCase(); + return offices.filter((o) => + o.name.toLowerCase().includes(normalized) + ); + }, [offices, search]); if (loading || isLoadingFavorites) { return ( - + ); } @@ -63,223 +39,278 @@ export default function OfficesScreen() { if (error) { return ( - {error} - - Reintentar + {error} + + Reintentar ); } return ( - - Espacios - - - Buscar y filtrar + + + {/* HEADER */} + + Espacios disponibles + {/* SEARCH */} - - setMinimumCapacity(value.replace(/\D/g, ''))} - keyboardType="number-pad" - /> - - - setShowFavoritesOnly((current) => !current)} - > - - {showFavoritesOnly ? 'Viendo favoritos' : 'Solo favoritos'} - - - - - Limpiar filtros - - - {favoritesError ? : null} + {/* COUNT */} + + {filteredOffices.length} espacio + {filteredOffices.length !== 1 ? 's' : ''} encontrados + + {/* LIST */} item.id} contentContainerStyle={styles.list} - ListEmptyComponent={ - - {offices.length === 0 - ? 'No hay espacios disponibles' - : showFavoritesOnly - ? 'No tienes oficinas favoritas que coincidan con los filtros' - : 'No hay espacios que coincidan con los filtros'} - - } - renderItem={({ item }) => ( - - - {item.name} - { - void toggleFavorite(item.id); - }} - disabled={pendingOfficeId === item.id} - > - - {pendingOfficeId === item.id - ? '...' - : favoriteOfficeIdsSet.has(item.id) - ? '★' - : '☆'} - - - + renderItem={({ item }) => { + const isFav = favoriteOfficeIdsSet.has(item.id); + return ( - - {item.location} - Capacidad: {item.capacity} - {item.description ? {item.description} : null} + + + {/* IMAGE PLACEHOLDER */} + {/* + 🏢 + */} + + + + {/* INFO */} + + + + {item.name} + + {item.location} + + + + › + + + + {item.capacity} personas + + + + {/* + {item.price ?? '—'} + */} + + + + {isFav ? 'Favorito' : 'Disponible'} + + + + + + ); + }} + ListEmptyComponent={ + + + No se encontraron espacios + - )} + } /> + ); } const styles = StyleSheet.create({ container: { flex: 1, - padding: 16, + backgroundColor: theme.colors.background, }, + +content: { + flex: 1, + width: '100%', + maxWidth: theme.layout.contentWidth, + alignSelf: 'center', +}, + center: { flex: 1, - alignItems: 'center', justifyContent: 'center', - padding: 24, - }, - title: { - fontSize: 28, - fontWeight: '700', - marginBottom: 16, + alignItems: 'center', }, - filtersBox: { - borderWidth: 1, - borderColor: '#d8e0ea', - backgroundColor: '#f7f9fc', - borderRadius: 12, - padding: 12, - gap: 10, - marginBottom: 16, + + header: { + backgroundColor: theme.colors.surface, + padding: theme.spacing.xl, + borderBottomWidth: 1, + borderColor: theme.colors.border, }, - filtersTitle: { - fontSize: 16, - fontWeight: '700', - color: '#22354a', + + title: { + fontSize: theme.typography.xxxl, + fontWeight: theme.fontWeight.semibold, + color: theme.colors.text, + marginBottom: theme.spacing.md, }, - input: { + + search: { + backgroundColor: theme.colors.white, borderWidth: 1, - borderColor: '#ccd5df', - borderRadius: 10, - paddingHorizontal: 14, - paddingVertical: 12, - backgroundColor: '#fff', + borderColor: theme.colors.border, + borderRadius: theme.radius.lg, + paddingHorizontal: theme.spacing.lg, + paddingVertical: theme.spacing.md, }, - filterActions: { - flexDirection: 'row', - gap: 10, + + resultText: { + fontSize: theme.typography.sm, + color: theme.colors.textSecondary, + paddingHorizontal: theme.spacing.xl, + paddingTop: theme.spacing.md, }, + list: { - gap: 12, + padding: theme.spacing.xl, + gap: theme.spacing.lg, }, + card: { + backgroundColor: theme.colors.surface, + borderRadius: theme.radius.lg, + padding: theme.spacing.lg, borderWidth: 1, - borderColor: '#ddd', - borderRadius: 12, - padding: 16, - gap: 10, + borderColor: theme.colors.border, + ...theme.shadows.card, }, - cardHeader: { + + cardContent: { flexDirection: 'row', + gap: theme.spacing.lg, + }, + + imageBox: { + width: 80, + height: 80, + borderRadius: theme.radius.lg, + backgroundColor: theme.colors.primarySoft, alignItems: 'center', + justifyContent: 'center', + }, + + imageIcon: { + fontSize: 28, + }, + + info: { + flex: 1, + gap: theme.spacing.sm, + }, + + rowBetween: { + flexDirection: 'row', justifyContent: 'space-between', - gap: 12, + alignItems: 'flex-start', }, + cardTitle: { - fontSize: 18, - fontWeight: '600', - flex: 1, + fontSize: theme.typography.lg, + fontWeight: theme.fontWeight.semibold, + color: theme.colors.text, }, - cardBody: { - gap: 6, + + cardSubtitle: { + fontSize: theme.typography.sm, + color: theme.colors.textSecondary, }, - error: { - color: 'red', - marginBottom: 12, + + chevron: { + fontSize: 18, + color: theme.colors.muted, }, - button: { - backgroundColor: '#1f6feb', - paddingHorizontal: 16, - paddingVertical: 12, - borderRadius: 10, + + capacity: { + fontSize: theme.typography.sm, + color: theme.colors.textSecondary, }, - secondaryButton: { - backgroundColor: '#5d6b79', - flex: 1, - paddingHorizontal: 16, - paddingVertical: 12, - borderRadius: 10, + + footer: { + flexDirection: 'row', + justifyContent: 'space-between', alignItems: 'center', }, - toggleButton: { - backgroundColor: '#1f6feb', - flex: 1, - paddingHorizontal: 16, - paddingVertical: 12, - borderRadius: 10, - alignItems: 'center', + + price: { + color: theme.colors.primary, + fontWeight: theme.fontWeight.medium, }, - toggleButtonActive: { - backgroundColor: '#174ea6', + + badge: { + backgroundColor: theme.colors.divider, + paddingHorizontal: theme.spacing.md, + paddingVertical: theme.spacing.xs, + borderRadius: theme.radius.sm, }, - favoriteButton: { - width: 40, - height: 40, - borderRadius: 20, - alignItems: 'center', - justifyContent: 'center', - backgroundColor: '#eef2f6', + + badgeActive: { + backgroundColor: theme.colors.successBg, + }, + + badgeText: { + fontSize: theme.typography.sm, + color: theme.colors.textSecondary, + }, + + badgeTextActive: { + color: theme.colors.successText, }, - favoriteButtonActive: { - backgroundColor: '#ffe8a3', + + emptyBox: { + alignItems: 'center', + padding: theme.spacing.xxxl, }, - favoriteButtonText: { - fontSize: 20, - color: '#8a6700', + + emptyText: { + color: theme.colors.textSecondary, }, - buttonText: { - color: '#fff', - fontWeight: '600', + + primaryButton: { + marginTop: theme.spacing.md, + backgroundColor: theme.colors.primary, + padding: theme.spacing.md, + borderRadius: theme.radius.md, }, - empty: { - color: '#666', + + primaryButtonText: { + color: theme.colors.white, + fontWeight: theme.fontWeight.semibold, }, -}); +}); \ No newline at end of file diff --git a/src/app/(protected)/offices/[officeId].tsx b/src/app/(protected)/offices/[officeId].tsx index c632490..fbcd9f8 100644 --- a/src/app/(protected)/offices/[officeId].tsx +++ b/src/app/(protected)/offices/[officeId].tsx @@ -5,37 +5,31 @@ import { ScrollView, StyleSheet, Text, - TextInput, View, } from 'react-native'; + import { useOffice } from '@/features/offices/hooks/useOffice'; import { useFavoriteOffices } from '@/features/offices/hooks/useFavoriteOffices'; -import { StatusMessage } from '@/shared/ui/StatusMessage'; -import { useOfficeAvailability } from '@/features/reservations/hooks/useOfficeAvailability'; + +import theme from '@/theme'; +import { Feather, MaterialIcons } from '@expo/vector-icons'; export default function OfficeDetailScreen() { const params = useLocalSearchParams<{ officeId: string }>(); - const officeId = typeof params.officeId === 'string' ? params.officeId : undefined; + const officeId = + typeof params.officeId === 'string' ? params.officeId : undefined; const { office, loading, error, reload } = useOffice(officeId); const { favoriteOfficeIdsSet, - favoritesError, pendingOfficeId, toggleFavorite, } = useFavoriteOffices(); - const { - selectedDate, - reservations, - loading: loadingAvailability, - error: availabilityError, - setSelectedDate, - } = useOfficeAvailability(officeId); if (loading) { return ( - + ); } @@ -43,230 +37,288 @@ export default function OfficeDetailScreen() { if (error || !office) { return ( - {error ?? 'No se pudo cargar la oficina'} + + {error ?? 'No se pudo cargar el espacio'} + - - Reintentar + + Reintentar - Volver a espacios + Volver ); } + const isFav = favoriteOfficeIdsSet.has(office.id); + return ( - - {office.name} + + {/* HEADER */} + + + ← Volver a espacios + + + + {/* IMAGE */} + {/* + 🏢 + */} + + + + + {/* TITLE */} + + + {office.name} + + {office.location ?? 'Sin ubicación'} + + + + + + {office.available ? 'Disponible' : 'Ocupado'} + + + + + {/* CAPACITY + PRICE */} + + + {office.capacity} personas + + + {/* + {office.price ?? '—'} + */} + + + {/* DESCRIPTION */} + {office.description && ( + + Descripción + {office.description} + + )} + + {/* FAVORITE */} { - void toggleFavorite(office.id); - }} + onPress={() => toggleFavorite(office.id)} disabled={pendingOfficeId === office.id} > - + {pendingOfficeId === office.id ? '...' - : favoriteOfficeIdsSet.has(office.id) - ? '★' - : '☆'} + : isFav + ? '★ Guardado' + : '☆ Guardar como favorito'} - - - {favoritesError ? : null} - {availabilityError ? : null} - - - Ubicación - {office.location} - Capacidad - {office.capacity} personas - - {office.description ? ( - <> - Descripción - {office.description} - - ) : null} - - - - Disponibilidad - - Fecha - - - Consulta los horarios ocupados para esa fecha - - {loadingAvailability ? ( - - ) : availabilityError ? null : reservations.length === 0 ? ( - No hay bloques ocupados para esta fecha - ) : ( - - {reservations.map((reservation) => ( - - - {reservation.startTime} - {reservation.endTime} - - Ocupado - - ))} - - )} + {/* RESERVE BUTTON */} + + + + Reservar ahora + + + - - - - Reservar este espacio - - - ); } const styles = StyleSheet.create({ container: { - flex: 1, - padding: 16, - gap: 16, + paddingVertical: theme.spacing.xl, + }, + + content: { + width: '100%', + maxWidth: theme.layout.contentWidth, + alignSelf: 'center', + paddingHorizontal: theme.spacing.xl, + gap: theme.spacing.xl, }, + center: { flex: 1, - alignItems: 'center', justifyContent: 'center', - padding: 24, - gap: 12, + alignItems: 'center', + padding: theme.spacing.xl, + gap: theme.spacing.md, }, - title: { - fontSize: 28, - fontWeight: '700', - flex: 1, + + back: { + color: theme.colors.textSecondary, + fontSize: theme.typography.md, }, - header: { - flexDirection: 'row', + + imageBox: { + width: '100%', + height: 180, + borderRadius: theme.radius.xl, + backgroundColor: theme.colors.primarySoft, alignItems: 'center', - gap: 12, - }, - card: { - borderWidth: 1, - borderColor: '#ddd', - borderRadius: 12, - padding: 16, - gap: 10, + justifyContent: 'center', }, - label: { - fontSize: 14, - fontWeight: '700', - color: '#444', + + imageIcon: { + fontSize: 48, }, - sectionTitle: { - fontSize: 20, - fontWeight: '700', - marginBottom: 4, + + titleRow: { + flexDirection: 'row', + justifyContent: 'space-between', + alignItems: 'flex-start', + gap: theme.spacing.md, }, - value: { - fontSize: 16, - color: '#111', + + title: { + fontSize: theme.typography.xxxl, + fontWeight: theme.fontWeight.semibold, + color: theme.colors.text, }, - input: { - borderWidth: 1, - borderColor: '#ccc', - borderRadius: 10, - paddingHorizontal: 14, - paddingVertical: 12, + + subtitle: { + color: theme.colors.textSecondary, marginTop: 4, }, - helper: { - color: '#666', - fontSize: 12, + + metaRow: { + flexDirection: 'row', + justifyContent: 'space-between', + alignItems: 'center', }, - availabilityList: { - gap: 10, - marginTop: 8, + + meta: { + color: theme.colors.textSecondary, + }, + + price: { + color: theme.colors.primary, + fontSize: theme.typography.xxl, + fontWeight: theme.fontWeight.semibold, }, - availabilityItem: { + + card: { + backgroundColor: theme.colors.surface, + borderRadius: theme.radius.lg, + padding: theme.spacing.lg, borderWidth: 1, - borderColor: '#d9e5d4', - backgroundColor: '#f3faf1', - borderRadius: 10, - padding: 12, - gap: 4, + borderColor: theme.colors.border, + ...theme.shadows.card, }, - availabilityTime: { - fontSize: 16, - fontWeight: '600', - color: '#1f3a1a', + + sectionTitle: { + fontSize: theme.typography.lg, + fontWeight: theme.fontWeight.semibold, + marginBottom: theme.spacing.sm, + color: theme.colors.text, }, - availabilityStatus: { - color: '#336b2f', - fontSize: 13, + + text: { + color: theme.colors.textSecondary, }, - availableText: { - color: '#2e7d32', - marginTop: 8, + + badge: { + backgroundColor: theme.colors.divider, + paddingHorizontal: theme.spacing.md, + paddingVertical: theme.spacing.xs, + borderRadius: theme.radius.sm, }, - button: { - backgroundColor: '#1f6feb', - paddingVertical: 14, - borderRadius: 10, - alignItems: 'center', + + badgeActive: { + backgroundColor: theme.colors.successBg, }, - secondaryButton: { - backgroundColor: '#555', - paddingVertical: 14, - paddingHorizontal: 16, - borderRadius: 10, - alignItems: 'center', + + badgeText: { + color: theme.colors.textSecondary, + fontSize: theme.typography.sm, }, + + badgeTextActive: { + color: theme.colors.successText, + }, + favoriteButton: { - width: 44, - height: 44, - borderRadius: 22, + padding: theme.spacing.md, + borderRadius: theme.radius.md, + backgroundColor: theme.colors.divider, alignItems: 'center', - justifyContent: 'center', - backgroundColor: '#eef2f6', }, + favoriteButtonActive: { backgroundColor: '#ffe8a3', }, - favoriteButtonText: { - fontSize: 22, - color: '#8a6700', + + favoriteText: { + fontWeight: theme.fontWeight.medium, + color: theme.colors.text, + }, + + reserveButton: { + backgroundColor: theme.colors.primary, + paddingVertical: theme.spacing.lg, + borderRadius: theme.radius.lg, + alignItems: 'center', }, - buttonText: { - color: '#fff', - fontWeight: '600', + + reserveText: { + color: theme.colors.white, + fontWeight: theme.fontWeight.semibold, + fontSize: theme.typography.lg, }, - error: { - color: 'red', - textAlign: 'center', + + primaryButton: { + backgroundColor: theme.colors.primary, + padding: theme.spacing.md, + borderRadius: theme.radius.md, + }, + + primaryButtonText: { + color: theme.colors.white, + fontWeight: theme.fontWeight.semibold, + }, + + secondaryButton: { + backgroundColor: theme.colors.muted, + padding: theme.spacing.md, + borderRadius: theme.radius.md, }, -}); +}); \ No newline at end of file -- cgit v1.2.3-54-g00ecf