xrdwb17xu: Add the full-screen snap feed with media and quote slides on phones
This commit is contained in:
@@ -8,6 +8,7 @@ import { PostError, publishAndConfirm } from "@/lib/post-client";
|
||||
import { DeleteError, sendDelete } from "@/lib/delete-client";
|
||||
import type { ComposerProps } from "./Composer";
|
||||
import { FeedView, type FeedStatus } from "./FeedView";
|
||||
import { useCompactLayout } from "./layout-context";
|
||||
|
||||
const POLL_MS = 45_000;
|
||||
|
||||
@@ -44,6 +45,9 @@ export function Feed({
|
||||
const list = useRef<HTMLDivElement | null>(null);
|
||||
const busy = useRef(false);
|
||||
const shown = useRef<Set<string>>(new Set());
|
||||
// The list element changes between the panel and the phone reel; the
|
||||
// infinite-scroll observer re-attaches to the new one.
|
||||
const compact = useCompactLayout();
|
||||
|
||||
useEffect(() => {
|
||||
shown.current = new Set(posts.map((p) => p.key));
|
||||
@@ -117,7 +121,7 @@ export function Feed({
|
||||
);
|
||||
io.observe(el);
|
||||
return () => io.disconnect();
|
||||
}, [nextCursor, status, loadMoreFailed, loadMore, posts.length]);
|
||||
}, [nextCursor, status, loadMoreFailed, loadMore, posts.length, compact]);
|
||||
|
||||
// Real-time: poll the first page while the tab is visible.
|
||||
useEffect(() => {
|
||||
@@ -276,6 +280,7 @@ export function Feed({
|
||||
deleteErrors={deleteErrors}
|
||||
onSignedOut={onSignedOut}
|
||||
composer={{ value: draft, busy: posting, error: postFailed, file, onChange: changeDraft, onFile: changeFile, onSubmit: () => void publish(), person }}
|
||||
hasMore={!!nextCursor}
|
||||
sentinelRef={sentinel}
|
||||
listRef={list}
|
||||
/>
|
||||
|
||||
Reference in New Issue
Block a user