mirror of
https://github.com/R0m1k3/Socialflow.git
synced 2026-10-21 14:08:10 +02:00
Update calendar and preview to show past scheduled posts
Refactor `RecentPublications` to filter and sort attempted posts using `scheduledAt` timestamp. Update `PreviewModal` and `CalendarView` to include a `readOnly` prop for the preview modal. 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/oa3970R
This commit is contained in:
1 parent
078301d353
commit
212ef049f7
4 files changed
+41
-21
No files matched your search
@@ -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<PreviewFormat>('facebook-feed');
|
||||
const [currentPhotoIndex, setCurrentPhotoIndex] = useState(0);
|
||||
@@ -311,22 +313,33 @@ export function PreviewModal({
|
||||
|
||||
{/* Actions */}
|
||||
<div className="flex justify-end gap-3">
|
||||
<Button
|
||||
variant="outline"
|
||||
onClick={() => onOpenChange(false)}
|
||||
data-testid="button-cancel-preview"
|
||||
>
|
||||
Annuler
|
||||
</Button>
|
||||
<Button
|
||||
onClick={onPublish}
|
||||
disabled={isPublishing}
|
||||
className="bg-gradient-to-r from-primary to-secondary hover:opacity-90"
|
||||
data-testid="button-publish-from-preview"
|
||||
>
|
||||
<Send className="w-4 h-4 mr-2" />
|
||||
{isPublishing ? 'Publication...' : 'Publier'}
|
||||
</Button>
|
||||
{readOnly ? (
|
||||
<Button
|
||||
onClick={() => onOpenChange(false)}
|
||||
data-testid="button-close-preview"
|
||||
>
|
||||
Fermer
|
||||
</Button>
|
||||
) : (
|
||||
<>
|
||||
<Button
|
||||
variant="outline"
|
||||
onClick={() => onOpenChange(false)}
|
||||
data-testid="button-cancel-preview"
|
||||
>
|
||||
Annuler
|
||||
</Button>
|
||||
<Button
|
||||
onClick={onPublish}
|
||||
disabled={isPublishing}
|
||||
className="bg-gradient-to-r from-primary to-secondary hover:opacity-90"
|
||||
data-testid="button-publish-from-preview"
|
||||
>
|
||||
<Send className="w-4 h-4 mr-2" />
|
||||
{isPublishing ? 'Publication...' : 'Publier'}
|
||||
</Button>
|
||||
</>
|
||||
)}
|
||||
</div>
|
||||
</div>
|
||||
</DialogContent>
|
||||
|
||||
Reference in new issue
Block a user