Skip to content

Commit

Permalink
fix: refactor redundant use of variable
Browse files Browse the repository at this point in the history
  • Loading branch information
hamza14khan committed Nov 26, 2024
1 parent 8f30966 commit efe3d06
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions packages/react/ds/src/pagination/pagination.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ export const Pagination: React.FC<PaginationProps> = ({
const { breakpoint, width } = useBreakpoint();
const isCompactView = breakpoint === Breakpoint.XS;
const isSMWidth = width < 639;
const showLabel = isSMWidth;

const displayedPages = getDisplayPages(currentPage, totalPages, breakpoint);

Expand Down Expand Up @@ -63,7 +62,7 @@ export const Pagination: React.FC<PaginationProps> = ({
<React.Fragment key="previous-btn-pagination">
<Icon icon="arrow_left_alt" />
</React.Fragment>
{!showLabel && 'Previous'}
{!isSMWidth && 'Previous'}
</Button>

{isCompactView ? renderPaginationLabel() : renderPaginationBtns()}
Expand All @@ -76,7 +75,7 @@ export const Pagination: React.FC<PaginationProps> = ({
onClick={() => onPageChange(currentPage + 1)}
className={isSMWidth ? 'gi-icon-btn-large' : ''}
>
{!showLabel && 'Next'}
{!isSMWidth && 'Next'}
<React.Fragment key="next-btn-pagination">
<Icon icon="arrow_right_alt" />
</React.Fragment>
Expand Down

0 comments on commit efe3d06

Please sign in to comment.