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({