From f50f77922faed022e77b4e7a1eeb59adb628184a Mon Sep 17 00:00:00 2001 From: michaelschal <35957947-michaelschal@users.noreply.replit.com> Date: Wed, 1 Oct 2025 13:54:40 +0000 Subject: [PATCH] Add functionality to display scheduled posts and indicate upcoming features Implement a calendar view to display scheduled posts, and modify AI chat buttons to show "Coming Soon" notifications. Replit-Commit-Author: Agent Replit-Commit-Session-Id: ae4037a0-2a6f-4530-9bac-79b543286bda Replit-Commit-Checkpoint-Type: intermediate_checkpoint Replit-Commit-Screenshot-Url: https://storage.googleapis.com/screenshot-production-us-central1/397bca8c-984f-43ff-841a-10897aeb8140/ae4037a0-2a6f-4530-9bac-79b543286bda/vhNnBGJ --- client/src/components/ai-chat.tsx | 14 ++++- client/src/components/calendar-view.tsx | 74 +++++++++++++++---------- client/src/components/media-upload.tsx | 7 ++- 3 files changed, 63 insertions(+), 32 deletions(-) diff --git a/client/src/components/ai-chat.tsx b/client/src/components/ai-chat.tsx index 48427de..0ba4791 100644 --- a/client/src/components/ai-chat.tsx +++ b/client/src/components/ai-chat.tsx @@ -173,11 +173,21 @@ export default function AiChat() {
- - diff --git a/client/src/components/calendar-view.tsx b/client/src/components/calendar-view.tsx index 24fe602..7af2004 100644 --- a/client/src/components/calendar-view.tsx +++ b/client/src/components/calendar-view.tsx @@ -2,14 +2,23 @@ import { useState } from "react"; import { Button } from "@/components/ui/button"; import { ChevronLeft, ChevronRight } from "lucide-react"; import { useQuery } from "@tanstack/react-query"; +import type { ScheduledPost } from "@shared/schema"; export default function CalendarView() { const [currentDate, setCurrentDate] = useState(new Date()); - const { data: scheduledPosts } = useQuery({ + const { data: scheduledPosts = [] } = useQuery({ queryKey: ["/api/scheduled-posts"], }); + const getPostsForDate = (date: Date) => { + return (scheduledPosts || []).filter(post => { + if (!post.scheduledAt) return false; + const postDate = new Date(post.scheduledAt); + return postDate.toDateString() === date.toDateString(); + }); + }; + const goToPreviousMonth = () => { setCurrentDate(new Date(currentDate.getFullYear(), currentDate.getMonth() - 1, 1)); }; @@ -131,45 +140,54 @@ export default function CalendarView() { )}
- {/* Sample events - in real app, filter scheduledPosts by date */} - {day.isCurrentMonth && day.date.getDate() % 7 === 5 && ( -
-
- - 14h - Promo + {/* Real scheduled posts for this date */} + {(() => { + if (!day.isCurrentMonth) return null; + const postsForDay = getPostsForDate(day.date); + if (postsForDay.length === 0) return null; + + return ( +
+ {postsForDay.slice(0, 2).map((post, idx) => { + const time = post.scheduledAt ? new Date(post.scheduledAt).toLocaleTimeString('fr-FR', { hour: '2-digit', minute: '2-digit' }) : ''; + const isPending = !post.publishedAt; + const isPublished = !!post.publishedAt; + + return ( +
+ {time} - {post.postType || 'Post'} +
+ ); + })} + {postsForDay.length > 2 && ( +
+ +{postsForDay.length - 2} autre(s) +
+ )}
-
- )} - - {day.isCurrentMonth && day.date.getDate() % 7 === 0 && ( -
-
- - 10h - Story -
-
- )} + ); + })()}
))} {/* Legend */}
-
-
- Facebook -
-
-
- Instagram -
- Story + Programmé
- Vidéo + Publié
diff --git a/client/src/components/media-upload.tsx b/client/src/components/media-upload.tsx index 7c2bf09..f65dc9c 100644 --- a/client/src/components/media-upload.tsx +++ b/client/src/components/media-upload.tsx @@ -48,7 +48,7 @@ export default function MediaUpload() { } }, []); - const { getRootProps, getInputProps, isDragActive } = useDropzone({ + const { getRootProps, getInputProps, isDragActive, open } = useDropzone({ onDrop, accept: { "image/*": [".png", ".jpg", ".jpeg", ".gif"], @@ -76,7 +76,10 @@ export default function MediaUpload() { Ajoutez des photos ou vidéos, elles seront automatiquement recadrées pour Facebook et Instagram

-