review comments

This commit is contained in:
Jonathan Rainville 2018-10-24 16:41:05 -04:00
parent 3d3ce559e9
commit 60c07072cf
4 changed files with 10 additions and 27 deletions

View File

@ -2,7 +2,7 @@ import React from 'react';
import {Link} from "react-router-dom";
import {Row, Col, Card, CardHeader, CardBody} from 'reactstrap';
import PropTypes from 'prop-types';
import Pages from './Pagination';
import Pagination from './Pagination';
import CardTitleIdenticon from './CardTitleIdenticon';
@ -37,7 +37,7 @@ const Blocks = ({blocks, changePage, currentPage, numberOfPages}) => (
</Row>
</div>
))}
<Pages changePage={changePage} currentPage={currentPage} numberOfPages={numberOfPages}/>
<Pagination changePage={changePage} currentPage={currentPage} numberOfPages={numberOfPages}/>
</CardBody>
</Card>
</Col>

View File

@ -1,17 +0,0 @@
import React from 'react';
import {Row, Col, Button} from 'reactstrap';
import PropTypes from 'prop-types';
const LoadMore = ({loadMore}) => (
<Row className="my-3">
<Col className="text-center">
<Button onClick={loadMore} icon="plus" outline color="primary">Load More</Button>
</Col>
</Row>
);
LoadMore.propTypes = {
loadMore: PropTypes.func
};
export default LoadMore;

View File

@ -1,10 +1,10 @@
import React from 'react';
import {Pagination, PaginationItem, PaginationLink} from 'reactstrap';
import {Pagination as RPagination, PaginationItem, PaginationLink} from 'reactstrap';
import PropTypes from 'prop-types';
const NB_PAGES_MAX = 8;
const Pages = ({currentPage, numberOfPages, changePage}) => {
const Pagination = ({currentPage, numberOfPages, changePage}) => {
let max = currentPage + NB_PAGES_MAX / 2;
if (max > numberOfPages) {
max = numberOfPages;
@ -22,7 +22,7 @@ const Pages = ({currentPage, numberOfPages, changePage}) => {
}
return (
<Pagination aria-label="Page navigation example" className="mt-4 mb-0 float-right">
<RPagination aria-label="Explorer navigation" className="mt-4 mb-0 float-right">
<PaginationItem disabled={currentPage <= 1}>
<PaginationLink previous href="#" onClick={(e) => {
e.preventDefault();
@ -43,14 +43,14 @@ const Pages = ({currentPage, numberOfPages, changePage}) => {
changePage(currentPage + 1);
}}/>
</PaginationItem>
</Pagination>
</RPagination>
);
};
Pages.propTypes = {
Pagination.propTypes = {
numberOfPages: PropTypes.number,
currentPage: PropTypes.number,
changePage: PropTypes.func
};
export default Pages;
export default Pagination;

View File

@ -4,7 +4,7 @@ import {Row, Col, Card, CardHeader, CardBody} from 'reactstrap';
import PropTypes from 'prop-types';
import CardTitleIdenticon from './CardTitleIdenticon';
import Pages from "./Pagination";
import Pagination from "./Pagination";
const Transactions = ({transactions, changePage, currentPage, numberOfPages}) => (
<Row>
@ -41,7 +41,7 @@ const Transactions = ({transactions, changePage, currentPage, numberOfPages}) =>
</Row>
</div>
))}
<Pages changePage={changePage} currentPage={currentPage} numberOfPages={numberOfPages}/>
<Pagination changePage={changePage} currentPage={currentPage} numberOfPages={numberOfPages}/>
</CardBody>
</Card>
</Col>