diff --git a/.replit b/.replit index fa8f8de..b321948 100644 --- a/.replit +++ b/.replit @@ -34,10 +34,18 @@ externalPort = 4200 localPort = 40537 externalPort = 3000 +[[ports]] +localPort = 42161 +externalPort = 6000 + [[ports]] localPort = 43245 externalPort = 3001 +[[ports]] +localPort = 45355 +externalPort = 6800 + [[ports]] localPort = 46681 externalPort = 5173 diff --git a/client/src/pages/new-post.tsx b/client/src/pages/new-post.tsx index c759abe..77f7ca5 100644 --- a/client/src/pages/new-post.tsx +++ b/client/src/pages/new-post.tsx @@ -1,7 +1,7 @@ -import { useState, useCallback } from "react"; +import { useState, useCallback, useRef } from "react"; import { useQuery, useMutation } from "@tanstack/react-query"; import { useLocation } from "wouter"; -import { Send, Sparkles, Image as ImageIcon, Calendar, Upload } from "lucide-react"; +import { Send, Sparkles, Image as ImageIcon, Calendar, Upload, Camera } from "lucide-react"; import { useDropzone } from "react-dropzone"; import Sidebar from "@/components/sidebar"; import TopBar from "@/components/topbar"; @@ -20,6 +20,7 @@ export default function NewPost() { const [sidebarOpen, setSidebarOpen] = useState(false); const [, navigate] = useLocation(); const { toast } = useToast(); + const cameraInputRef = useRef(null); const [productInfo, setProductInfo] = useState(''); const [selectedMedia, setSelectedMedia] = useState(null); @@ -189,6 +190,13 @@ export default function NewPost() { }); }; + const handleCameraCapture = (e: React.ChangeEvent) => { + const file = e.target.files?.[0]; + if (file) { + uploadMutation.mutate(file); + } + }; + return (
{sidebarOpen && ( @@ -218,6 +226,103 @@ export default function NewPost() {
+ + +
+
+ Média + Sélectionnez ou uploadez une image/vidéo +
+
+ + +
+
+
+ + +
+ + {mediaList.length === 0 ? ( +
+ +

+ {isDragActive ? "Déposez votre photo ici" : "Aucun média disponible"} +

+
+ + +
+
+ ) : ( +
+ {mediaList.map((media) => ( + + ))} +
+ )} +
+
+
+ Contenu @@ -297,70 +402,6 @@ export default function NewPost() { )} - - - -
-
- Média - Sélectionnez ou uploadez une image/vidéo -
- -
-
- -
- - {mediaList.length === 0 ? ( -
- -

- {isDragActive ? "Déposez votre photo ici" : "Aucun média disponible"} -

- -
- ) : ( -
- {mediaList.map((media) => ( - - ))} -
- )} -
-
-