diff --git a/.replit b/.replit index 8bbc693..e11f87b 100644 --- a/.replit +++ b/.replit @@ -14,6 +14,10 @@ run = ["npm", "run", "start"] localPort = 5000 externalPort = 80 +[[ports]] +localPort = 33027 +externalPort = 8008 + [[ports]] localPort = 34045 externalPort = 3003 diff --git a/client/src/components/calendar-view.tsx b/client/src/components/calendar-view.tsx index 1466388..5d9fdfe 100644 --- a/client/src/components/calendar-view.tsx +++ b/client/src/components/calendar-view.tsx @@ -417,6 +417,7 @@ export default function CalendarView() { mediaList={previewData.allMedia} onPublish={() => {}} isPublishing={false} + readOnly={true} /> ); diff --git a/client/src/components/preview-modal.tsx b/client/src/components/preview-modal.tsx index 5e1f55a..9b796f9 100644 --- a/client/src/components/preview-modal.tsx +++ b/client/src/components/preview-modal.tsx @@ -13,6 +13,7 @@ interface PreviewModalProps { mediaList: Media[]; onPublish: () => void; isPublishing: boolean; + readOnly?: boolean; } type PreviewFormat = 'facebook-feed' | 'instagram-feed' | 'instagram-story'; @@ -24,7 +25,8 @@ export function PreviewModal({ selectedMedia, mediaList, onPublish, - isPublishing + isPublishing, + readOnly = false }: PreviewModalProps) { const [previewFormat, setPreviewFormat] = useState('facebook-feed'); const [currentPhotoIndex, setCurrentPhotoIndex] = useState(0); @@ -311,22 +313,33 @@ export function PreviewModal({ {/* Actions */}
- - + {readOnly ? ( + + ) : ( + <> + + + + )}
diff --git a/client/src/components/recent-publications.tsx b/client/src/components/recent-publications.tsx index 86808b4..550d0ab 100644 --- a/client/src/components/recent-publications.tsx +++ b/client/src/components/recent-publications.tsx @@ -23,10 +23,11 @@ export default function RecentPublications() { queryKey: ['/api/scheduled-posts'], }); - // Filter and sort published posts + // Filter and sort attempted posts (scheduled in the past) + const now = new Date(); const recentPublished = scheduledPosts - .filter(sp => sp.publishedAt) - .sort((a, b) => new Date(b.publishedAt!).getTime() - new Date(a.publishedAt!).getTime()) + .filter(sp => sp.scheduledAt && new Date(sp.scheduledAt) <= now) + .sort((a, b) => new Date(b.scheduledAt!).getTime() - new Date(a.scheduledAt!).getTime()) .slice(0, 10); const handlePreviewPost = async (scheduledPost: ScheduledPostWithRelations) => { @@ -141,7 +142,7 @@ export default function RecentPublications() { • - {format(new Date(scheduledPost.publishedAt!), "d MMM yyyy 'à' HH:mm", { locale: fr })} + {format(new Date(scheduledPost.scheduledAt!), "d MMM yyyy 'à' HH:mm", { locale: fr })} {scheduledPost.error && ( <> @@ -165,6 +166,7 @@ export default function RecentPublications() { mediaList={previewData.allMedia} onPublish={() => {}} isPublishing={false} + readOnly={true} /> );