Skip to content

Commit

Permalink
refactor(docs): pagination dx
Browse files Browse the repository at this point in the history
  • Loading branch information
wingkwong committed Nov 18, 2024
1 parent 6af4955 commit ffc211d
Show file tree
Hide file tree
Showing 2 changed files with 44 additions and 40 deletions.
42 changes: 22 additions & 20 deletions apps/docs/content/components/pagination/custom-impl.raw.jsx
Original file line number Diff line number Diff line change
@@ -1,25 +1,27 @@
import {usePagination, PaginationItemType} from "@nextui-org/react";

export const ChevronIcon = (props) => (
<svg
aria-hidden="true"
fill="none"
focusable="false"
height="1em"
role="presentation"
viewBox="0 0 24 24"
width="1em"
{...props}
>
<path
d="M15.5 19l-7-7 7-7"
stroke="currentColor"
strokeLinecap="round"
strokeLinejoin="round"
strokeWidth="1.5"
/>
</svg>
);
export const ChevronIcon = (props) => {
return (
<svg
aria-hidden="true"
fill="none"
focusable="false"
height="1em"
role="presentation"
viewBox="0 0 24 24"
width="1em"
{...props}
>
<path
d="M15.5 19l-7-7 7-7"
stroke="currentColor"
strokeLinecap="round"
strokeLinejoin="round"
strokeWidth="1.5"
/>
</svg>
);
};

export default function App() {
const {activePage, range, setPage, onNext, onPrevious} = usePagination({
Expand Down
42 changes: 22 additions & 20 deletions apps/docs/content/components/pagination/custom-items.raw.jsx
Original file line number Diff line number Diff line change
@@ -1,25 +1,27 @@
import {Pagination, PaginationItemType} from "@nextui-org/react";

export const ChevronIcon = (props) => (
<svg
aria-hidden="true"
fill="none"
focusable="false"
height="1em"
role="presentation"
viewBox="0 0 24 24"
width="1em"
{...props}
>
<path
d="M15.5 19l-7-7 7-7"
stroke="currentColor"
strokeLinecap="round"
strokeLinejoin="round"
strokeWidth="1.5"
/>
</svg>
);
export const ChevronIcon = (props) => {
return (
<svg
aria-hidden="true"
fill="none"
focusable="false"
height="1em"
role="presentation"
viewBox="0 0 24 24"
width="1em"
{...props}
>
<path
d="M15.5 19l-7-7 7-7"
stroke="currentColor"
strokeLinecap="round"
strokeLinejoin="round"
strokeWidth="1.5"
/>
</svg>
);
};

export default function App() {
const renderItem = ({ref, key, value, isActive, onNext, onPrevious, setPage, className}) => {
Expand Down

0 comments on commit ffc211d

Please sign in to comment.