Commit b827d9b8 authored by ivan minutillo's avatar ivan minutillo

sidebar without loadmore

parent f1bb35aa
import { useMemo } from 'react';
import * as GQL from './myFollowedCommunities.generated';
import { usePage } from 'fe/lib/helpers/usePage';
import { DEFAULT_PAGE_SIZE } from 'mn-constants';
// import { DEFAULT_PAGE_SIZE } from 'mn-constants';
export const useMyFollowedCommunities = () => {
const myFlwCommunitiesQ = GQL.useMyCommunityFollowsQuery({
variables: { limit: DEFAULT_PAGE_SIZE }
variables: { limit: 10 } // FIXME
});
const myCommunityFollowsPage = usePage(
myFlwCommunitiesQ.data?.me?.user.communityFollows,
({ cursor, update }) => {
return myFlwCommunitiesQ.fetchMore({
variables: { ...cursor, limit: DEFAULT_PAGE_SIZE },
variables: { ...cursor, limit: 10 }, // FIXME CONFIGURE
updateQuery: (prev, { fetchMoreResult }) => {
return fetchMoreResult?.me?.user?.communityFollows &&
prev.me?.user?.communityFollows
......
......@@ -12,7 +12,7 @@ import Avatar from 'ui/elements/Avatar';
import { my_timeline, logo_small_url } from '../../../mn-constants';
// const MnetLogo = require('static/img/logo-icon.png');
import { FormikHook } from 'ui/@types/types';
import { LoadMore } from 'ui/modules/Loadmore';
// import { LoadMore } from 'ui/modules/Loadmore';
export enum Status {
Loading,
......@@ -225,9 +225,9 @@ export const Sidebar: React.FC<Props> = props => {
</CommunityLink>
)
)}
{props.LoadMoreFormik && (
{/* {props.LoadMoreFormik && (
<LoadMore LoadMoreFormik={props.LoadMoreFormik} />
)}
)} */}
</Nav>
</>
</SidebarOverflow>
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment