Skip to content

Commit ebe7c0f

Browse files
committed
Update pagination buttons
1 parent 2fbeb68 commit ebe7c0f

File tree

3 files changed

+8
-35
lines changed

3 files changed

+8
-35
lines changed

site/src/components/PaginationWidget/PageButtons.tsx

Lines changed: 3 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,9 @@
1-
import { useTheme } from "@emotion/react";
21
import { Button } from "components/Button/Button";
32
import type { FC, ReactNode } from "react";
4-
import { cn } from "utils/cn";
53

64
type NumberedPageButtonProps = {
75
pageNumber: number;
86
totalPages: number;
9-
107
onClick?: () => void;
118
highlighted?: boolean;
129
disabled?: boolean;
@@ -69,27 +66,10 @@ const BasePageButton: FC<BasePageButtonProps> = ({
6966
highlighted = false,
7067
disabled = false,
7168
}) => {
72-
const theme = useTheme();
73-
7469
return (
7570
<Button
76-
variant="outline"
77-
size="sm"
78-
style={
79-
highlighted ? {
80-
borderColor: theme.roles.active.outline,
81-
backgroundColor: theme.roles.active.background,
82-
// Define CSS variables to use in hover styles
83-
"--active-border-color": theme.roles.active.outline,
84-
"--active-bg-color": theme.roles.active.background,
85-
} : undefined
86-
}
87-
className={
88-
highlighted ? cn(
89-
// Override default hover styles for highlighted buttons
90-
"hover:!border-[color:var(--active-border-color)] hover:!bg-[color:var(--active-bg-color)]"
91-
) : undefined
92-
}
71+
variant={highlighted ? "default" : "outline"}
72+
size="icon"
9373
aria-label={ariaLabel}
9474
name={name}
9575
disabled={disabled}
@@ -118,4 +98,4 @@ function getNumberedButtonLabel(
11898
}
11999

120100
return `Page ${page}`;
121-
}
101+
}

site/src/components/PaginationWidget/PaginationNavButton.tsx

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -62,16 +62,9 @@ function PaginationNavButtonCore({
6262
*/}
6363
<Button
6464
variant="outline"
65-
size="sm"
66-
aria-disabled={disabled}
67-
className={disabled ? "cursor-default" : undefined}
68-
onClick={() => {
69-
if (disabled) {
70-
setShowDisabledMessage(true);
71-
} else {
72-
onClick();
73-
}
74-
}}
65+
size="icon"
66+
disabled={disabled}
67+
onClick={onClick}
7568
{...delegatedProps}
7669
/>
7770
</Tooltip>

site/src/components/PaginationWidget/PaginationWidgetBase.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ export const PaginationWidgetBase: FC<PaginationWidgetBaseProps> = ({
5959
}
6060
}}
6161
>
62-
<ChevronLeftIcon className="size-icon-sm" />
62+
<ChevronLeftIcon />
6363
</PaginationNavButton>
6464

6565
{isMobile ? (
@@ -86,7 +86,7 @@ export const PaginationWidgetBase: FC<PaginationWidgetBaseProps> = ({
8686
}
8787
}}
8888
>
89-
<ChevronRightIcon className="size-icon-sm" />
89+
<ChevronRightIcon />
9090
</PaginationNavButton>
9191
</div>
9292
);

0 commit comments

Comments
 (0)