le8i2digy: Add a refresh button to the Home feed header and singularize one comment

This commit is contained in:
2026-10-20 08:08:38 -06:00
parent 3f0595ad55
commit 69a11436f5
7 changed files with 123 additions and 11 deletions
+10
View File
@@ -29,6 +29,7 @@ export function FeedPreview() {
// Fixture switches for the new-posts pill and the loading-more skeleton.
const [newCount, setNewCount] = useState(0);
const [loadingMore, setLoadingMore] = useState(false);
const [refreshing, setRefreshing] = useState(false);
const list = useRef<HTMLDivElement | null>(null);
// The comments calls answer from the fixtures; the preview never reaches the network.
@@ -99,6 +100,15 @@ export function FeedPreview() {
setNewCount(0);
list.current?.scrollTo({ top: 0, behavior: "smooth" });
}}
refreshing={refreshing}
onRefresh={() => {
list.current?.scrollTo({ top: 0, behavior: "smooth" });
setRefreshing(true);
window.setTimeout(() => {
setPosts(toCardPosts(FIXTURE_FEED_ITEMS));
setRefreshing(false);
}, 600);
}}
onToggleLike={toggleLike}
feedUserId={FIXTURE_PERSON.feedUserId}
onDelete={(post) => setPosts((cur) => cur.filter((p) => p.key !== post.key))}