From 9b0a09614aa301641153899a780082c69334ff98 Mon Sep 17 00:00:00 2001 From: michaelschal <35957947-michaelschal@users.noreply.replit.com> Date: Fri, 11 Jul 2025 15:54:44 +0000 Subject: [PATCH] Improve camera support and photo capture, especially on tablets Enhance camera functionalities with improved constraints, fallbacks, UI, and error handling within CameraModal and useCamera hook. Replit-Commit-Author: Agent Replit-Commit-Session-Id: dec54137-d5a2-4406-8ad4-5f2f9fb110bf Replit-Commit-Screenshot-Url: https://storage.googleapis.com/screenshot-production-us-central1/0715008c-7244-40f4-befc-26c014852236/dcf949f8-2931-4556-aa3c-e4bf61346ee3.jpg --- client/src/components/CameraModal.tsx | 23 +++++++++++--- client/src/components/NewSaleForm.tsx | 10 ++++++ client/src/hooks/useCamera.tsx | 46 ++++++++++++++++++++++++--- replit.md | 12 +++++++ 4 files changed, 82 insertions(+), 9 deletions(-) diff --git a/client/src/components/CameraModal.tsx b/client/src/components/CameraModal.tsx index 9c5f29a..066874d 100644 --- a/client/src/components/CameraModal.tsx +++ b/client/src/components/CameraModal.tsx @@ -32,7 +32,7 @@ export default function CameraModal({ return ( - + Photo {photoType ? photoType.charAt(0).toUpperCase() + photoType.slice(1) : ''} @@ -46,20 +46,33 @@ export default function CameraModal({ autoPlay playsInline muted - className="w-full camera-preview" + className="w-full max-w-full h-auto camera-preview rounded-lg border" + style={{ + aspectRatio: '16/9', + objectFit: 'cover', + maxHeight: '400px' + }} /> + + {/* Overlay pour aider à cadrer la pièce d'identité */} +
+
+
+ Cadrez la pièce d'identité dans le rectangle +
+
-
-