From d9620547b6bbb0e4eb425caa95d4efdb9f8889e0 Mon Sep 17 00:00:00 2001 From: 1Copenut Date: Thu, 14 Sep 2023 08:20:29 -0500 Subject: [PATCH] Refactoring aria-current and icon to simpler ternary from util func. --- src/components/pagination/pagination_button.tsx | 1 - .../table/table_pagination/table_pagination.tsx | 13 +++++-------- 2 files changed, 5 insertions(+), 9 deletions(-) diff --git a/src/components/pagination/pagination_button.tsx b/src/components/pagination/pagination_button.tsx index cec5804c09a..a11d9a3456d 100644 --- a/src/components/pagination/pagination_button.tsx +++ b/src/components/pagination/pagination_button.tsx @@ -77,7 +77,6 @@ export const EuiPaginationButton: FunctionComponent = ({ {(shortPageString: string) => ( {pageNumber} diff --git a/src/components/table/table_pagination/table_pagination.tsx b/src/components/table/table_pagination/table_pagination.tsx index 3343a3974d5..9557e913f41 100644 --- a/src/components/table/table_pagination/table_pagination.tsx +++ b/src/components/table/table_pagination/table_pagination.tsx @@ -84,12 +84,6 @@ export const EuiTablePagination: FunctionComponent = ( setIsPopoverOpen(false); }, []); - const setActiveProps = (itemsPerPageOption: number) => { - return itemsPerPageOption === itemsPerPage - ? { icon: 'check', 'aria-current': 'true' as const } - : { icon: 'empty', 'aria-current': undefined }; - }; - const button = ( = ( () => itemsPerPageOptions.map((itemsPerPageOption) => ( { closePopover(); @@ -142,7 +139,7 @@ export const EuiTablePagination: FunctionComponent = ( )} )), - [itemsPerPageOptions, onChangeItemsPerPage, closePopover, setActiveProps] + [itemsPerPageOptions, itemsPerPage, onChangeItemsPerPage, closePopover] ); const itemsPerPagePopover = (