Skip to content

Commit

Permalink
chore(pagination): 🏷️ update types
Browse files Browse the repository at this point in the history
  • Loading branch information
navin-moorthy committed Sep 9, 2020
1 parent bd60cb2 commit 4bfbb21
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 6 deletions.
3 changes: 1 addition & 2 deletions src/pagination/Pagination.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,8 @@ import { BoxHTMLProps, BoxOptions, useBox } from "reakit";
import { createComponent, createHook } from "reakit-system";

import { PAGINATION_KEYS } from "./__keys";
import { PaginationStateReturn } from "./PaginationState";

export type PaginationOptions = BoxOptions & PaginationStateReturn;
export type PaginationOptions = BoxOptions;

export type PaginationHTMLProps = BoxHTMLProps;

Expand Down
4 changes: 2 additions & 2 deletions src/pagination/PaginationItem.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { PAGINATION_ITEM_KEYS } from "./__keys";
import { PaginationStateReturn } from "./PaginationState";

export type PaginationItemOptions = ButtonOptions &
PaginationStateReturn & {
Pick<PaginationStateReturn, "currentPage" | "goTo"> & {
page: string | number;
getAriaLabel?: (page: string | number, isCurrent: boolean) => string;
};
Expand All @@ -26,7 +26,7 @@ export const usePaginationItem = createHook<
keys: PAGINATION_ITEM_KEYS,

useProps(
{ currentPage, page, goTo, getAriaLabel },
{ currentPage, goTo, page, getAriaLabel },
{ onClick: htmlOnClick, ...htmlProps },
) {
const isCurrent = currentPage === page;
Expand Down
3 changes: 2 additions & 1 deletion src/pagination/PaginationNext.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ import { ButtonHTMLProps, ButtonOptions, useButton } from "reakit";
import { PAGINATION_KEYS } from "./__keys";
import { PaginationStateReturn } from "./PaginationState";

export type PaginationNextOptions = ButtonOptions & PaginationStateReturn;
export type PaginationNextOptions = ButtonOptions &
Pick<PaginationStateReturn, "next" | "isAtMax">;

export type PaginationNextHTMLProps = ButtonHTMLProps;

Expand Down
3 changes: 2 additions & 1 deletion src/pagination/PaginationPrev.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ import { ButtonHTMLProps, ButtonOptions, useButton } from "reakit";
import { PAGINATION_KEYS } from "./__keys";
import { PaginationStateReturn } from "./PaginationState";

export type PaginationPrevOptions = ButtonOptions & PaginationStateReturn;
export type PaginationPrevOptions = ButtonOptions &
Pick<PaginationStateReturn, "isAtMin" | "prev">;

export type PaginationPrevHTMLProps = ButtonHTMLProps;

Expand Down

0 comments on commit 4bfbb21

Please sign in to comment.