-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Changed the styling of pagination navigation buttons
- Loading branch information
Showing
2 changed files
with
57 additions
and
25 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
44 changes: 44 additions & 0 deletions
44
components/dashboard/src/Pagination/PaginationNavigationButton.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
/** | ||
* Copyright (c) 2022 Gitpod GmbH. All rights reserved. | ||
* Licensed under the GNU Affero General Public License (AGPL). | ||
* See License-AGPL.txt in the project root for license information. | ||
*/ | ||
|
||
import Arrow from "../components/Arrow"; | ||
|
||
interface PaginationNavigationButtonProps { | ||
isDisabled: boolean; | ||
label: string; | ||
arrowReversed: boolean; | ||
onClick: () => void; | ||
} | ||
|
||
function PaginationNavigationButton(props: PaginationNavigationButtonProps) { | ||
const activeArrowClass = props.isDisabled | ||
? undefined | ||
: "border-gray-500 dark:border-gray-400 group-hover:border-gray-600 dark:group-hover:border-gray-400"; | ||
|
||
return ( | ||
<li | ||
className={`font-semibold text-gray-300 ${ | ||
props.isDisabled ? "disabled dark:text-gray-500" : "cursor-pointer dark:text-gray-400 text-gray-500" | ||
}`} | ||
> | ||
<span onClick={props.onClick}> | ||
{props.arrowReversed ? ( | ||
<> | ||
{props.label} | ||
<Arrow direction={"right"} customBorderClasses={activeArrowClass} /> | ||
</> | ||
) : ( | ||
<> | ||
<Arrow direction={"left"} customBorderClasses={activeArrowClass} /> | ||
{props.label} | ||
</> | ||
)} | ||
</span> | ||
</li> | ||
); | ||
} | ||
|
||
export default PaginationNavigationButton; |