Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
kaipana committed Sep 1, 2020
1 parent d990c1d commit eb2e6c9
Showing 1 changed file with 31 additions and 38 deletions.
69 changes: 31 additions & 38 deletions src/js/components/FipIconContainer.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -119,15 +119,10 @@ class FipIconContainer extends React.PureComponent {

iconSet.forEach((value, index) => {
if (fuzzySearch(searchString, currentSearchSet[index])) {
if (!nIconSet.includes(value)) {
nIconSet.push(value);
}
if (!nSearchSet.includes(currentSearchSet[index])) {
nSearchSet.push(currentSearchSet[index]);
}
nIconSet.push(value);
nSearchSet.push(currentSearchSet[index]);
}
});

return {
activeIcons: nIconSet,
activeTitles: nSearchSet,
Expand Down Expand Up @@ -245,42 +240,40 @@ class FipIconContainer extends React.PureComponent {
if (this.state.totalPage < 1) {
return null;
}
const left =
this.props.currentPage > 0 ? (
const left = (
<span
className="rfipicons__left"
role="button"
tabIndex={0}
onKeyDown={event => this.handlePageKeyBoard(event, 'prev')}
onClick={event => this.handleChangePage(event, 'prev')}
>
<span
className="rfipicons__left"
role="button"
tabIndex={0}
onKeyDown={event => this.handlePageKeyBoard(event, 'prev')}
onClick={event => this.handleChangePage(event, 'prev')}
role="presentation"
className="rfipicons__label"
aria-label="Left"
>
<span
role="presentation"
className="rfipicons__label"
aria-label="Left"
>
<i className="fipicon-angle-left" />
</span>
<i className="fipicon-angle-left" />
</span>
) : null;
const right =
this.props.currentPage < this.state.totalPage - 1 ? (
</span>
);
const right = (
<span
className="rfipicons__right"
role="button"
tabIndex={0}
onKeyDown={event => this.handlePageKeyBoard(event, 'next')}
onClick={event => this.handleChangePage(event, 'next')}
>
<span
className="rfipicons__right"
role="button"
tabIndex={0}
onKeyDown={event => this.handlePageKeyBoard(event, 'next')}
onClick={event => this.handleChangePage(event, 'next')}
role="presentation"
className="rfipicons__label"
aria-label="Right"
>
<span
role="presentation"
className="rfipicons__label"
aria-label="Right"
>
<i className="fipicon-angle-right" />
</span>
<i className="fipicon-angle-right" />
</span>
) : null;
</span>
);
return (
<div className="rfipicons__pager">
<div className="rfipicons__num">
Expand Down Expand Up @@ -353,4 +346,4 @@ class FipIconContainer extends React.PureComponent {
}
}

export default FipIconContainer;
export default FipIconContainer;

0 comments on commit eb2e6c9

Please sign in to comment.