From 9f9a2b66b8dd07dac70fa95bb3f1e8a4a29142e3 Mon Sep 17 00:00:00 2001 From: Dessalines Date: Fri, 6 Oct 2023 08:52:38 -0400 Subject: [PATCH] Addressing PR comments. --- .../components/common/paginator-cursor.tsx | 28 +++++++++---------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/src/shared/components/common/paginator-cursor.tsx b/src/shared/components/common/paginator-cursor.tsx index a21f3521..46488b85 100644 --- a/src/shared/components/common/paginator-cursor.tsx +++ b/src/shared/components/common/paginator-cursor.tsx @@ -5,8 +5,18 @@ import { PaginationCursor } from "lemmy-js-client"; interface PaginatorCursorProps { prevPage?: PaginationCursor; nextPage?: PaginationCursor; - onNext(val: PaginationCursor): any; - onPrev(): any; + onNext(val: PaginationCursor): void; + onPrev(): void; +} + +function handlePrev(i: PaginatorCursor) { + i.props.onPrev(); +} + +function handleNext(i: PaginatorCursor) { + if (i.props.nextPage) { + i.props.onNext(i.props.nextPage); + } } export class PaginatorCursor extends Component { @@ -19,13 +29,13 @@ export class PaginatorCursor extends Component {