@@ -2,7 +2,6 @@ import React, { type JSX } from 'react'
22import classnames from 'classnames'
33import { Icon } from '../Icon/Icons'
44import { Link } from '../Link/Link'
5- import { Button } from '../Button/Button'
65
76export type PaginationProps = {
87 pathname : string // pathname of results page
@@ -34,24 +33,28 @@ const PaginationPage = ({
3433 const linkClasses = classnames ( 'usa-pagination__button' , {
3534 'usa-current' : isCurrent ,
3635 } )
36+ const buttonClasses = classnames (
37+ linkClasses ,
38+ 'bg-transparent' ,
39+ 'cursor-pointer'
40+ )
3741
3842 return (
3943 < li
4044 key = { `pagination_page_${ page } ` }
4145 className = "usa-pagination__item usa-pagination__page-no" >
4246 { onClickPageNumber ? (
43- < Button
47+ < button
4448 type = "button"
45- unstyled
4649 data-testid = "pagination-page-number"
47- className = { linkClasses }
50+ className = { buttonClasses }
4851 aria-label = { `Page ${ page } ` }
4952 aria-current = { isCurrent ? 'page' : undefined }
5053 onClick = { ( event ) => {
5154 onClickPageNumber ( event , page )
5255 } } >
5356 { page }
54- </ Button >
57+ </ button >
5558 ) : (
5659 < Link
5760 href = { `${ pathname } ?page=${ page } ` }
@@ -161,26 +164,48 @@ export const Pagination = ({
161164 const prevPage = ! isOnFirstPage && currentPage - 1
162165 const nextPage = ! isOnLastPage && currentPage + 1
163166
167+ const prevLinkClasses = classnames (
168+ 'usa-pagination__link' ,
169+ 'usa-pagination__previous-page'
170+ )
171+ const prevButtonClasses = classnames (
172+ prevLinkClasses ,
173+ 'border-0' ,
174+ 'padding-0' ,
175+ 'bg-transparent' ,
176+ 'cursor-pointer'
177+ )
178+ const nextLinkClasses = classnames (
179+ 'usa-pagination__link' ,
180+ 'usa-pagination__next-page'
181+ )
182+ const nextButtonClasses = classnames (
183+ nextLinkClasses ,
184+ 'border-0' ,
185+ 'padding-0' ,
186+ 'bg-transparent' ,
187+ 'cursor-pointer'
188+ )
189+
164190 return (
165191 < nav aria-label = "Pagination" className = { navClasses } { ...props } >
166192 < ul className = "usa-pagination__list" >
167193 { prevPage && (
168194 < li className = "usa-pagination__item usa-pagination__arrow" >
169195 { onClickPrevious ? (
170- < Button
196+ < button
171197 type = "button"
172- unstyled
173- className = "usa-pagination__link usa-pagination__previous-page"
198+ className = { prevButtonClasses }
174199 aria-label = "Previous page"
175200 data-testid = "pagination-previous"
176201 onClick = { onClickPrevious } >
177202 < Icon . NavigateBefore aria-hidden = { true } />
178203 < span className = "usa-pagination__link-text" > Previous</ span >
179- </ Button >
204+ </ button >
180205 ) : (
181206 < Link
182207 href = { `${ pathname } ?page=${ prevPage } ` }
183- className = "usa-pagination__link usa-pagination__previous-page"
208+ className = { prevLinkClasses }
184209 aria-label = "Previous page" >
185210 < Icon . NavigateBefore aria-hidden = { true } />
186211 < span className = "usa-pagination__link-text" > Previous</ span >
@@ -206,20 +231,19 @@ export const Pagination = ({
206231 { nextPage && (
207232 < li className = "usa-pagination__item usa-pagination__arrow" >
208233 { onClickNext ? (
209- < Button
234+ < button
210235 type = "button"
211- unstyled
212- className = "usa-pagination__link usa-pagination__next-page"
236+ className = { nextButtonClasses }
213237 aria-label = "Next page"
214238 data-testid = "pagination-next"
215239 onClick = { onClickNext } >
216240 < span className = "usa-pagination__link-text" > Next</ span >
217241 < Icon . NavigateNext aria-hidden = { true } />
218- </ Button >
242+ </ button >
219243 ) : (
220244 < Link
221245 href = { `${ pathname } ?page=${ nextPage } ` }
222- className = "usa-pagination__link usa-pagination__next-page"
246+ className = { nextLinkClasses }
223247 aria-label = "Next page" >
224248 < span className = "usa-pagination__link-text" > Next</ span >
225249 < Icon . NavigateNext aria-hidden = { true } />
0 commit comments