diff options
author | derek <wwsage@gmail.com> | 2020-07-14 01:13:43 -0400 |
---|---|---|
committer | derek <wwsage@gmail.com> | 2020-07-14 01:13:43 -0400 |
commit | ef62f4698a62e996bcd54faa1f360eff89b8ac4b (patch) | |
tree | ce5d6397d6ee1134fd58f23e2088b932da9ebfb0 /ui/src/components/communities.tsx | |
parent | 563a66b053dfbb189193f18775c15180eb36bd7d (diff) |
ui.components: fix ts types, move user pagination to user details
Diffstat (limited to 'ui/src/components/communities.tsx')
-rw-r--r-- | ui/src/components/communities.tsx | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/ui/src/components/communities.tsx b/ui/src/components/communities.tsx index 71ea878d..ba362acc 100644 --- a/ui/src/components/communities.tsx +++ b/ui/src/components/communities.tsx @@ -27,6 +27,10 @@ interface CommunitiesState { loading: boolean; } +interface CommunitiesProps { + page: number; +} + export class Communities extends Component<any, CommunitiesState> { private subscription: Subscription; private emptyState: CommunitiesState = { @@ -54,13 +58,13 @@ export class Communities extends Component<any, CommunitiesState> { this.subscription.unsubscribe(); } - static getDerivedStateFromProps(props) { + static getDerivedStateFromProps(props: any): CommunitiesProps { return { page: getPageFromProps(props), }; } - componentDidUpdate(_, lastState) { + componentDidUpdate(_: any, lastState: CommunitiesState) { if (lastState.page !== this.state.page) { this.setState({ loading: true }); this.refetch(); @@ -172,7 +176,7 @@ export class Communities extends Component<any, CommunitiesState> { ); } - updateUrl(paramUpdates: { page: number }) { + updateUrl(paramUpdates: CommunitiesProps) { const page = paramUpdates.page || this.state.page; this.props.history.push(`/communities/page/${page}`); } |