Skip to content

Commit

Permalink
refactor(RouteLayout): make click handler an event handler
Browse files Browse the repository at this point in the history
  • Loading branch information
philip-cline committed Oct 26, 2023
1 parent 9401ba4 commit d74ef3f
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions lib/manager/components/reporter/components/RouteLayout.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,9 @@ export default class RouteLayout extends Component<Props> {
fetchRouteDetails(version.namespace)
}

_onPaginationSelect = (value: number) => {
_onPaginationSelect = (e: SyntheticMouseEvent<HTMLSpanElement>) => {
const {routeOffsetChange, version} = this.props
const value = +e.currentTarget.textContent
routeOffsetChange({
namespace: version.namespace,
offset: (value - 1) * PAGE_SIZE
Expand Down Expand Up @@ -109,7 +110,7 @@ export default class RouteLayout extends Component<Props> {
<Pagination.Item
active={pageNum === activePage}
key={pageNum}
onClick={(e) => this._onPaginationSelect(+e.target.text)}
onClick={this._onPaginationSelect}
>
{pageNum}
</Pagination.Item>
Expand Down

0 comments on commit d74ef3f

Please sign in to comment.