Skip to content

Commit

Permalink
fix: change bootstrap styles to custom styles
Browse files Browse the repository at this point in the history
  • Loading branch information
remiilekun committed Aug 28, 2019
1 parent 0c8b5eb commit 031fc70
Show file tree
Hide file tree
Showing 7 changed files with 2,406 additions and 159 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ function App() {

return (
<div>
<Pagination
<Paginator
totalRecords={data.length}
pageLimit={4}
pageNeighbours={1}
Expand Down Expand Up @@ -89,7 +89,7 @@ function App() {
<li>{data}</li>
))}
</ul>
<Pagination
<Paginator
totalRecords={data.length}
pageLimit={pageLimit}
pageNeighbours={2}
Expand Down
2 changes: 1 addition & 1 deletion dist/index.js

Large diffs are not rendered by default.

94 changes: 11 additions & 83 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 0 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,6 @@
"email": "[email protected]"
},
"license": "MIT",
"dependencies": {
"bootstrap": "^4.3.1",
"reactstrap": "^7.1.0"
},
"scripts": {
"start": "react-scripts start",
"build": "webpack",
Expand Down
3 changes: 1 addition & 2 deletions src/lib/paginator.js
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,6 @@ function Paginator(props) {
className={`${props.pageItemClass} ${
currentPage === page ? props.pageActiveClass : null
}`}
active={currentPage === page}
key={index}
>
<a
Expand All @@ -192,7 +191,7 @@ function Paginator(props) {
}

Paginator.defaultProps = {
pageContainerClass: 'pagination',
pageContainerClass: 'react-hooks-paginator',
pageActiveClass: 'active',
pageItemClass: 'page-item',
pageLinkClass: 'page-link',
Expand Down
48 changes: 43 additions & 5 deletions src/lib/style/main.scss
Original file line number Diff line number Diff line change
@@ -1,5 +1,43 @@
@import '~bootstrap/scss/functions';
@import '~bootstrap/scss/variables';
@import '~bootstrap/scss/mixins';
@import '~bootstrap/scss/reboot';
@import '~bootstrap/scss/pagination';
.react-hooks-paginator {
align-items: center;
display: flex;
justify-content: center;
margin: 1rem 0;

.page-item {
list-style: none;
&:first-child {
.page-link {
margin-left: 0;
border-top-left-radius: 3px;
border-bottom-left-radius: 3px;
}
}

&:last-child {
.page-link {
border-top-right-radius: 3px;
border-bottom-right-radius: 3px;
}
}

&:hover,
&.active {
.page-link {
background-color: #3895d3;
border-color: #3895d3;
color: #fff;
}
}
}

.page-link {
border: 1px solid #dee2e6;
color: #4a4a4a;
margin-left: -1px;
outline: none;
padding: 0.5rem 0.75rem;
text-decoration: none;
transition: all 0.2s;
}
}
Loading

0 comments on commit 031fc70

Please sign in to comment.