From f5d2249633ab55225c6f840ca75676a35daef062 Mon Sep 17 00:00:00 2001 From: michaelschal <35957947-michaelschal@users.noreply.replit.com> Date: Tue, 14 Oct 2025 07:54:34 +0000 Subject: [PATCH] Adjust initial media display based on screen size Initialize `visibleMediaCount` state based on window width to display 6 media items on mobile and 12 on desktop. 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/F3F3s9V --- client/src/pages/new-post.tsx | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/client/src/pages/new-post.tsx b/client/src/pages/new-post.tsx index b8dd866..d3769d3 100644 --- a/client/src/pages/new-post.tsx +++ b/client/src/pages/new-post.tsx @@ -112,7 +112,10 @@ export default function NewPost() { const [postText, setPostText] = useState(''); const [postType, setPostType] = useState<'feed' | 'story' | 'both'>('feed'); const [previewModalOpen, setPreviewModalOpen] = useState(false); - const [visibleMediaCount, setVisibleMediaCount] = useState(12); + const [visibleMediaCount, setVisibleMediaCount] = useState(() => { + // Chargement initial adapté à la taille d'écran : 6 sur mobile, 12 sur desktop + return window.innerWidth < 768 ? 6 : 12; + }); const loadMoreMediaRef = useRef(null); const { data: pages = [] } = useQuery({