Hey is a decentralized and permissionless social media app built with Lens Protocol 🌿

refactor: rename onEndReached handlers (#5800)

authored by yoginth.com and committed by

GitHub cdf249f5 0318ca41

+50 -50
+2 -2
apps/web/src/components/Account/AccountFeed.tsx
··· 81 81 const pageInfo = data?.posts?.pageInfo; 82 82 const hasMore = pageInfo?.next; 83 83 84 - const onEndReached = async () => { 84 + const handleEndReached = async () => { 85 85 if (hasMore) { 86 86 await fetchMore({ 87 87 variables: { request: { ...request, cursor: pageInfo?.next } } ··· 95 95 loading={loading} 96 96 error={error} 97 97 hasMore={hasMore} 98 - onEndReached={onEndReached} 98 + onEndReached={handleEndReached} 99 99 emptyIcon={<ChatBubbleBottomCenterIcon className="size-8" />} 100 100 emptyMessage={ 101 101 <div>
+2 -2
apps/web/src/components/Bookmarks/BookmarksFeed.tsx
··· 26 26 const pageInfo = data?.postBookmarks?.pageInfo; 27 27 const hasMore = pageInfo?.next; 28 28 29 - const onEndReached = async () => { 29 + const handleEndReached = async () => { 30 30 if (hasMore) { 31 31 await fetchMore({ 32 32 variables: { request: { ...request, cursor: pageInfo?.next } } ··· 39 39 loading={loading} 40 40 error={error} 41 41 hasMore={hasMore} 42 - onEndReached={onEndReached} 42 + onEndReached={handleEndReached} 43 43 emptyIcon={<BookmarkIcon className="size-8" />} 44 44 emptyMessage="No bookmarks yet!" 45 45 errorTitle="Failed to load bookmark feed"
+2 -2
apps/web/src/components/Comment/CommentFeed.tsx
··· 39 39 const pageInfo = data?.postReferences?.pageInfo; 40 40 const hasMore = pageInfo?.next; 41 41 42 - const onEndReached = async () => { 42 + const handleEndReached = async () => { 43 43 if (hasMore) { 44 44 await fetchMore({ 45 45 variables: { request: { ...request, cursor: pageInfo?.next } } ··· 61 61 loading={loading} 62 62 error={error} 63 63 hasMore={hasMore} 64 - onEndReached={onEndReached} 64 + onEndReached={handleEndReached} 65 65 emptyIcon={<ChatBubbleLeftIcon className="size-8" />} 66 66 emptyMessage="Be the first one to comment!" 67 67 errorTitle="Failed to load comment feed"
+2 -2
apps/web/src/components/Comment/NoneRelevantFeed.tsx
··· 45 45 const hasMore = pageInfo?.next; 46 46 const totalComments = comments?.length; 47 47 48 - const onEndReached = async () => { 48 + const handleEndReached = async () => { 49 49 if (hasMore) { 50 50 await fetchMore({ 51 51 variables: { request: { ...request, cursor: pageInfo?.next } } ··· 88 88 <PostFeed 89 89 items={filteredComments} 90 90 hasMore={hasMore} 91 - onEndReached={onEndReached} 91 + onEndReached={handleEndReached} 92 92 emptyIcon={null} 93 93 emptyMessage="" 94 94 errorTitle="Failed to load comments"
+2 -2
apps/web/src/components/Explore/ExploreFeed.tsx
··· 28 28 const pageInfo = data?.mlPostsExplore?.pageInfo; 29 29 const hasMore = pageInfo?.next; 30 30 31 - const onEndReached = async () => { 31 + const handleEndReached = async () => { 32 32 if (hasMore) { 33 33 await fetchMore({ 34 34 variables: { request: { ...request, cursor: pageInfo?.next } } ··· 49 49 loading={loading} 50 50 error={error} 51 51 hasMore={hasMore} 52 - onEndReached={onEndReached} 52 + onEndReached={handleEndReached} 53 53 emptyIcon={<ChatBubbleBottomCenterIcon className="size-8" />} 54 54 emptyMessage="No posts yet!" 55 55 errorTitle="Failed to load explore feed"
+2 -2
apps/web/src/components/Group/GroupFeed.tsx
··· 22 22 const pageInfo = data?.posts?.pageInfo; 23 23 const hasMore = pageInfo?.next; 24 24 25 - const onEndReached = async () => { 25 + const handleEndReached = async () => { 26 26 if (hasMore) { 27 27 await fetchMore({ 28 28 variables: { request: { ...request, cursor: pageInfo?.next } } ··· 42 42 loading={loading} 43 43 error={error} 44 44 hasMore={hasMore} 45 - onEndReached={onEndReached} 45 + onEndReached={handleEndReached} 46 46 emptyIcon={<ChatBubbleBottomCenterIcon className="size-8" />} 47 47 emptyMessage="Group has no posts yet!" 48 48 errorTitle="Failed to load group feed"
+2 -2
apps/web/src/components/Groups/List.tsx
··· 41 41 const pageInfo = data?.groups?.pageInfo; 42 42 const hasMore = pageInfo?.next; 43 43 44 - const onEndReached = async () => { 44 + const handleEndReached = async () => { 45 45 if (hasMore) { 46 46 await fetchMore({ 47 47 variables: { request: { ...request, cursor: pageInfo?.next } } ··· 49 49 } 50 50 }; 51 51 52 - const loadMoreRef = useLoadMoreOnIntersect(onEndReached); 52 + const loadMoreRef = useLoadMoreOnIntersect(handleEndReached); 53 53 54 54 if (loading) { 55 55 return <GroupListShimmer />;
+2 -2
apps/web/src/components/Home/ForYou.tsx
··· 26 26 const pageInfo = data?.mlPostsForYou.pageInfo; 27 27 const hasMore = pageInfo?.next; 28 28 29 - const onEndReached = async () => { 29 + const handleEndReached = async () => { 30 30 if (hasMore) { 31 31 await fetchMore({ 32 32 variables: { request: { ...request, cursor: pageInfo?.next } } ··· 49 49 loading={loading} 50 50 error={error} 51 51 hasMore={hasMore} 52 - onEndReached={onEndReached} 52 + onEndReached={handleEndReached} 53 53 emptyIcon={<LightBulbIcon className="size-8" />} 54 54 emptyMessage="No posts yet!" 55 55 errorTitle="Failed to load for you"
+2 -2
apps/web/src/components/Home/Highlights.tsx
··· 24 24 const pageInfo = data?.timelineHighlights.pageInfo; 25 25 const hasMore = pageInfo?.next; 26 26 27 - const onEndReached = async () => { 27 + const handleEndReached = async () => { 28 28 if (hasMore) { 29 29 await fetchMore({ 30 30 variables: { request: { ...request, cursor: pageInfo?.next } } ··· 45 45 loading={loading} 46 46 error={error} 47 47 hasMore={hasMore} 48 - onEndReached={onEndReached} 48 + onEndReached={handleEndReached} 49 49 emptyIcon={<LightBulbIcon className="size-8" />} 50 50 emptyMessage="No posts yet!" 51 51 errorTitle="Failed to load highlights"
+2 -2
apps/web/src/components/Home/Timeline/index.tsx
··· 30 30 const pageInfo = data?.timeline?.pageInfo; 31 31 const hasMore = pageInfo?.next; 32 32 33 - const onEndReached = async () => { 33 + const handleEndReached = async () => { 34 34 if (hasMore) { 35 35 await fetchMore({ 36 36 variables: { request: { ...request, cursor: pageInfo?.next } } ··· 51 51 loading={loading} 52 52 error={error} 53 53 hasMore={hasMore} 54 - onEndReached={onEndReached} 54 + onEndReached={handleEndReached} 55 55 emptyIcon={<UserGroupIcon className="size-8" />} 56 56 emptyMessage="No posts yet!" 57 57 errorTitle="Failed to load timeline"
+2 -2
apps/web/src/components/Notification/List.tsx
··· 70 70 const pageInfo = data?.notifications?.pageInfo; 71 71 const hasMore = !!pageInfo?.next; 72 72 73 - const onEndReached = async () => { 73 + const handleEndReached = async () => { 74 74 if (hasMore) { 75 75 await fetchMore({ 76 76 variables: { request: { ...request, cursor: pageInfo.next } } ··· 78 78 } 79 79 }; 80 80 81 - const loadMoreRef = useLoadMoreOnIntersect(onEndReached); 81 + const loadMoreRef = useLoadMoreOnIntersect(handleEndReached); 82 82 83 83 if (loading) { 84 84 return (
+2 -2
apps/web/src/components/Post/Quotes.tsx
··· 38 38 const pageInfo = data?.postReferences?.pageInfo; 39 39 const hasMore = pageInfo?.next; 40 40 41 - const onEndReached = async () => { 41 + const handleEndReached = async () => { 42 42 if (hasMore) { 43 43 await fetchMore({ 44 44 variables: { request: { ...request, cursor: pageInfo?.next } } ··· 46 46 } 47 47 }; 48 48 49 - const loadMoreRef = useLoadMoreOnIntersect(onEndReached); 49 + const loadMoreRef = useLoadMoreOnIntersect(handleEndReached); 50 50 51 51 if (error) { 52 52 return <ErrorMessage error={error} title="Failed to load comment feed" />;
+2 -2
apps/web/src/components/Search/Accounts.tsx
··· 31 31 const pageInfo = data?.accounts?.pageInfo; 32 32 const hasMore = pageInfo?.next; 33 33 34 - const onEndReached = async () => { 34 + const handleEndReached = async () => { 35 35 if (hasMore) { 36 36 await fetchMore({ 37 37 variables: { request: { ...request, cursor: pageInfo?.next } } ··· 39 39 } 40 40 }; 41 41 42 - const loadMoreRef = useLoadMoreOnIntersect(onEndReached); 42 + const loadMoreRef = useLoadMoreOnIntersect(handleEndReached); 43 43 44 44 if (loading) { 45 45 return <SingleAccountsShimmer isBig />;
+2 -2
apps/web/src/components/Search/Posts.tsx
··· 21 21 const pageInfo = data?.posts?.pageInfo; 22 22 const hasMore = pageInfo?.next; 23 23 24 - const onEndReached = async () => { 24 + const handleEndReached = async () => { 25 25 if (hasMore) { 26 26 await fetchMore({ 27 27 variables: { request: { ...request, cursor: pageInfo?.next } } ··· 35 35 loading={loading} 36 36 error={error} 37 37 hasMore={hasMore} 38 - onEndReached={onEndReached} 38 + onEndReached={handleEndReached} 39 39 emptyIcon={<ChatBubbleBottomCenterIcon className="size-8" />} 40 40 emptyMessage={ 41 41 <span>
+2 -2
apps/web/src/components/Settings/Blocked/List.tsx
··· 26 26 const pageInfo = data?.accountsBlocked?.pageInfo; 27 27 const hasMore = pageInfo?.next; 28 28 29 - const onEndReached = async () => { 29 + const handleEndReached = async () => { 30 30 if (hasMore) { 31 31 await fetchMore({ 32 32 variables: { request: { ...request, cursor: pageInfo?.next } } ··· 34 34 } 35 35 }; 36 36 37 - const loadMoreRef = useLoadMoreOnIntersect(onEndReached); 37 + const loadMoreRef = useLoadMoreOnIntersect(handleEndReached); 38 38 39 39 if (loading) { 40 40 return <Loader className="my-10" />;
+2 -2
apps/web/src/components/Settings/Manager/AccountManager/Management/List.tsx
··· 54 54 const pageInfo = data?.accountsAvailable?.pageInfo; 55 55 const hasMore = pageInfo?.next; 56 56 57 - const onEndReached = async () => { 57 + const handleEndReached = async () => { 58 58 if (hasMore) { 59 59 await fetchMore({ 60 60 variables: { ··· 68 68 } 69 69 }; 70 70 71 - const loadMoreRef = useLoadMoreOnIntersect(onEndReached); 71 + const loadMoreRef = useLoadMoreOnIntersect(handleEndReached); 72 72 73 73 if (loading) { 74 74 return <Loader className="my-10" />;
+2 -2
apps/web/src/components/Settings/Manager/AccountManager/Managers/List.tsx
··· 81 81 const pageInfo = data?.accountManagers?.pageInfo; 82 82 const hasMore = pageInfo?.next; 83 83 84 - const onEndReached = async () => { 84 + const handleEndReached = async () => { 85 85 if (hasMore) { 86 86 await fetchMore({ 87 87 variables: { request: { ...request, cursor: pageInfo?.next } } ··· 89 89 } 90 90 }; 91 91 92 - const loadMoreRef = useLoadMoreOnIntersect(onEndReached); 92 + const loadMoreRef = useLoadMoreOnIntersect(handleEndReached); 93 93 94 94 if (loading) { 95 95 return <Loader className="my-10" />;
+2 -2
apps/web/src/components/Settings/Sessions/List.tsx
··· 62 62 const pageInfo = data?.authenticatedSessions?.pageInfo; 63 63 const hasMore = pageInfo?.next; 64 64 65 - const onEndReached = async () => { 65 + const handleEndReached = async () => { 66 66 if (hasMore) { 67 67 await fetchMore({ 68 68 variables: { request: { ...request, cursor: pageInfo?.next } } ··· 70 70 } 71 71 }; 72 72 73 - const loadMoreRef = useLoadMoreOnIntersect(onEndReached); 73 + const loadMoreRef = useLoadMoreOnIntersect(handleEndReached); 74 74 75 75 if (loading) { 76 76 return <Loader className="my-10" />;
+2 -2
apps/web/src/components/Shared/Modal/Followers.tsx
··· 33 33 const pageInfo = data?.followers?.pageInfo; 34 34 const hasMore = pageInfo?.next; 35 35 36 - const onEndReached = async () => { 36 + const handleEndReached = async () => { 37 37 if (hasMore) { 38 38 await fetchMore({ 39 39 variables: { request: { ...request, cursor: pageInfo?.next } } ··· 41 41 } 42 42 }; 43 43 44 - const loadMoreRef = useLoadMoreOnIntersect(onEndReached); 44 + const loadMoreRef = useLoadMoreOnIntersect(handleEndReached); 45 45 46 46 if (loading) { 47 47 return <AccountListShimmer />;
+2 -2
apps/web/src/components/Shared/Modal/FollowersYouKnow.tsx
··· 35 35 const pageInfo = data?.followersYouKnow?.pageInfo; 36 36 const hasMore = pageInfo?.next; 37 37 38 - const onEndReached = async () => { 38 + const handleEndReached = async () => { 39 39 if (hasMore) { 40 40 await fetchMore({ 41 41 variables: { request: { ...request, cursor: pageInfo?.next } } ··· 43 43 } 44 44 }; 45 45 46 - const loadMoreRef = useLoadMoreOnIntersect(onEndReached); 46 + const loadMoreRef = useLoadMoreOnIntersect(handleEndReached); 47 47 48 48 if (loading) { 49 49 return <AccountListShimmer />;
+2 -2
apps/web/src/components/Shared/Modal/Following.tsx
··· 33 33 const pageInfo = data?.following?.pageInfo; 34 34 const hasMore = pageInfo?.next; 35 35 36 - const onEndReached = async () => { 36 + const handleEndReached = async () => { 37 37 if (hasMore) { 38 38 await fetchMore({ 39 39 variables: { request: { ...request, cursor: pageInfo?.next } } ··· 41 41 } 42 42 }; 43 43 44 - const loadMoreRef = useLoadMoreOnIntersect(onEndReached); 44 + const loadMoreRef = useLoadMoreOnIntersect(handleEndReached); 45 45 46 46 if (loading) { 47 47 return <AccountListShimmer />;
+2 -2
apps/web/src/components/Shared/Modal/Likes.tsx
··· 35 35 const pageInfo = data?.postReactions?.pageInfo; 36 36 const hasMore = pageInfo?.next; 37 37 38 - const onEndReached = async () => { 38 + const handleEndReached = async () => { 39 39 if (hasMore) { 40 40 await fetchMore({ 41 41 variables: { request: { ...request, cursor: pageInfo?.next } } ··· 43 43 } 44 44 }; 45 45 46 - const loadMoreRef = useLoadMoreOnIntersect(onEndReached); 46 + const loadMoreRef = useLoadMoreOnIntersect(handleEndReached); 47 47 48 48 if (loading) { 49 49 return <AccountListShimmer />;
+2 -2
apps/web/src/components/Shared/Modal/Members/index.tsx
··· 36 36 const pageInfo = data?.groupMembers?.pageInfo; 37 37 const hasMore = pageInfo?.next; 38 38 39 - const onEndReached = async () => { 39 + const handleEndReached = async () => { 40 40 if (hasMore) { 41 41 await fetchMore({ 42 42 variables: { request: { ...request, cursor: pageInfo?.next } } ··· 44 44 } 45 45 }; 46 46 47 - const loadMoreRef = useLoadMoreOnIntersect(onEndReached); 47 + const loadMoreRef = useLoadMoreOnIntersect(handleEndReached); 48 48 49 49 if (loading) { 50 50 return <AccountListShimmer />;
+2 -2
apps/web/src/components/Shared/Modal/PostExecutors.tsx
··· 36 36 const pageInfo = data?.whoExecutedActionOnPost?.pageInfo; 37 37 const hasMore = pageInfo?.next; 38 38 39 - const onEndReached = async () => { 39 + const handleEndReached = async () => { 40 40 if (hasMore) { 41 41 await fetchMore({ 42 42 variables: { request: { ...request, cursor: pageInfo?.next } } ··· 44 44 } 45 45 }; 46 46 47 - const loadMoreRef = useLoadMoreOnIntersect(onEndReached); 47 + const loadMoreRef = useLoadMoreOnIntersect(handleEndReached); 48 48 49 49 if (loading) { 50 50 return <AccountListShimmer />;
+2 -2
apps/web/src/components/Shared/Modal/Reposts.tsx
··· 37 37 const pageInfo = data?.whoReferencedPost?.pageInfo; 38 38 const hasMore = pageInfo?.next; 39 39 40 - const onEndReached = async () => { 40 + const handleEndReached = async () => { 41 41 if (hasMore) { 42 42 await fetchMore({ 43 43 variables: { request: { ...request, cursor: pageInfo?.next } } ··· 45 45 } 46 46 }; 47 47 48 - const loadMoreRef = useLoadMoreOnIntersect(onEndReached); 48 + const loadMoreRef = useLoadMoreOnIntersect(handleEndReached); 49 49 50 50 if (loading) { 51 51 return <AccountListShimmer />;