aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIndrajith K L2019-12-12 21:13:25 +0530
committerIndrajith K L2019-12-12 21:13:25 +0530
commit1eb6d5f1865c80eb4e228e34774ce18743b97905 (patch)
tree481d1cd47a47c959fb740df03a77abf6cb1f5fe6
parent5e3d9da21510e1622bcf900a949c8506e4251bce (diff)
downloadreact-redux-saga-starter-master.tar.gz
react-redux-saga-starter-master.tar.bz2
react-redux-saga-starter-master.zip
* Fixes/Removed javascript:void(0) from links (Since React v16.9 unsafe script is not allowed) * Fixes Paginator callback null conditions
-rw-r--r--src/shared/paginator.component.js18
1 files changed, 12 insertions, 6 deletions
diff --git a/src/shared/paginator.component.js b/src/shared/paginator.component.js
index 9512d4e..928a89d 100644
--- a/src/shared/paginator.component.js
+++ b/src/shared/paginator.component.js
@@ -13,15 +13,21 @@ const Paginator = (props) => {
}
const onPrevious = ()=>{
- props.previousPage();
+ if(props.previousPage){
+ props.previousPage();
+ }
}
const onNext = ()=>{
- props.nextPage();
+ if(props.nextPage){
+ props.nextPage();
+ }
}
const onPageClick = (pageNum)=>{
- props.goToNextPage(pageNum)
+ if(props.goToNextPage){
+ props.goToNextPage(pageNum);
+ }
}
@@ -29,18 +35,18 @@ const Paginator = (props) => {
<nav>
<ul className="pagination">
<li className={previousItemStyle}>
- <a className="page-link" href="javascript:void(0)" onClick={onPrevious}>Previous</a>
+ <a className="page-link" href="#!" onClick={onPrevious}>Previous</a>
</li>
{pages.map(_page=>{
return(
<li key={_page} className={_page==currentPage ? "page-item active" : "page-item"}>
- <a className="page-link" href="javascript:void(0)" onClick={onPageClick.bind(this, _page)}>{_page}</a>
+ <a className="page-link" href="#!" onClick={onPageClick.bind(this, _page)}>{_page}</a>
</li>
)
})}
<li className={nextItemStyle}>
- <a className="page-link" href="#" onClick={onNext}>Next</a>
+ <a className="page-link" href="#!" onClick={onNext}>Next</a>
</li>
</ul>
</nav>