Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix for #13 #25

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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;