mirror of
https://github.com/cheeaun/phanpy.git
synced 2025-01-05 00:57:19 +03:00
33 lines
814 B
React
33 lines
814 B
React
|
import { useRef } from 'preact/hooks';
|
||
|
import { useSnapshot } from 'valtio';
|
||
|
|
||
|
import Timeline from '../components/timeline';
|
||
|
import useTitle from '../utils/useTitle';
|
||
|
|
||
|
const LIMIT = 20;
|
||
|
|
||
|
function Following() {
|
||
|
useTitle('Following', '/l/f');
|
||
|
const snapStates = useSnapshot(states);
|
||
|
const homeIterator = useRef();
|
||
|
async function fetchHome(firstLoad) {
|
||
|
if (firstLoad || !homeIterator.current) {
|
||
|
homeIterator.current = masto.v1.timelines.listHome({ limit: LIMIT });
|
||
|
}
|
||
|
return await homeIterator.current.next();
|
||
|
}
|
||
|
|
||
|
return (
|
||
|
<Timeline
|
||
|
title="Following"
|
||
|
id="following"
|
||
|
emptyText="Nothing to see here."
|
||
|
errorText="Unable to load posts."
|
||
|
fetchItems={fetchHome}
|
||
|
boostsCarousel={snapStates.settings.boostsCarousel}
|
||
|
/>
|
||
|
);
|
||
|
}
|
||
|
|
||
|
export default Following;
|