chore: move typings

This commit is contained in:
Arvid Norlin
2024-08-20 09:30:03 +02:00
parent 0453728696
commit 7e719bc475
3 changed files with 24 additions and 11 deletions

View File

@@ -2,16 +2,17 @@ import { ChevronRightIcon } from "@/components/Icons"
import styles from "./pagination.module.css" import styles from "./pagination.module.css"
import {
PaginationButtonProps,
PaginationProps,
} from "@/types/components/myPages/myPage/earnAndBurn"
function PaginationButton({ function PaginationButton({
children, children,
isActive, isActive,
handleClick, handleClick,
disabled, disabled,
}: React.PropsWithChildren<{ }: React.PropsWithChildren<PaginationButtonProps>) {
disabled: boolean
isActive?: boolean
handleClick: () => void
}>) {
return ( return (
<button <button
type={"button"} type={"button"}
@@ -29,12 +30,7 @@ export default function Pagination({
isFetching, isFetching,
handlePageChange, handlePageChange,
currentPage, currentPage,
}: { }: PaginationProps) {
pageCount: number
isFetching: boolean
handlePageChange: (page: number) => void
currentPage: number
}) {
const isOnFirstPage = currentPage === 1 const isOnFirstPage = currentPage === 1
const isOnLastPage = currentPage === pageCount const isOnLastPage = currentPage === pageCount
return ( return (

View File

@@ -13,6 +13,7 @@
.paginationButton { .paginationButton {
background-color: transparent; background-color: transparent;
border: none; border: none;
cursor: pointer;
height: 32px; height: 32px;
width: 32px; width: 32px;
font-size: var(--typography-Body-Bold-fontSize); font-size: var(--typography-Body-Bold-fontSize);
@@ -24,6 +25,9 @@
flex-shrink: 0; flex-shrink: 0;
} }
.paginationButton[disabled] {
cursor: not-allowed;
}
.chevronLeft { .chevronLeft {
transform: rotate(180deg); transform: rotate(180deg);
height: 100%; height: 100%;

View File

@@ -31,6 +31,19 @@ export interface RowProps {
transaction: Transaction transaction: Transaction
} }
export interface PaginationProps {
pageCount: number
isFetching: boolean
handlePageChange: (page: number) => void
currentPage: number
}
export interface PaginationButtonProps {
disabled: boolean
isActive?: boolean
handleClick: () => void
}
export interface AwardPointsProps extends Pick<Transaction, "awardPoints"> {} export interface AwardPointsProps extends Pick<Transaction, "awardPoints"> {}
export interface AwardPointsVariantProps export interface AwardPointsVariantProps