Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
moodlenet
MoodleNet Frontend
Commits
b827d9b8
Commit
b827d9b8
authored
Jun 02, 2020
by
ivan minutillo
Browse files
sidebar without loadmore
parent
f1bb35aa
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/fe/community/myFollowed/myFollowedCommunities.ts
View file @
b827d9b8
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
...
...
src/ui/modules/Sidebar/index.tsx
View file @
b827d9b8
...
...
@@ -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
>
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment