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 {Link} from "react-router-dom";
import {Row, Col, Card, CardHeader, CardBody} from 'reactstrap'; import {Row, Col, Card, CardHeader, CardBody} from 'reactstrap';
import PropTypes from 'prop-types'; import PropTypes from 'prop-types';
import Pages from './Pagination'; import Pagination from './Pagination';
import CardTitleIdenticon from './CardTitleIdenticon'; import CardTitleIdenticon from './CardTitleIdenticon';
@ -37,7 +37,7 @@ const Blocks = ({blocks, changePage, currentPage, numberOfPages}) => (
</Row> </Row>
</div> </div>
))} ))}
<Pages changePage={changePage} currentPage={currentPage} numberOfPages={numberOfPages}/> <Pagination changePage={changePage} currentPage={currentPage} numberOfPages={numberOfPages}/>
</CardBody> </CardBody>
</Card> </Card>
</Col> </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 React from 'react';
import {Pagination, PaginationItem, PaginationLink} from 'reactstrap'; import {Pagination as RPagination, PaginationItem, PaginationLink} from 'reactstrap';
import PropTypes from 'prop-types'; import PropTypes from 'prop-types';
const NB_PAGES_MAX = 8; const NB_PAGES_MAX = 8;
const Pages = ({currentPage, numberOfPages, changePage}) => { const Pagination = ({currentPage, numberOfPages, changePage}) => {
let max = currentPage + NB_PAGES_MAX / 2; let max = currentPage + NB_PAGES_MAX / 2;
if (max > numberOfPages) { if (max > numberOfPages) {
max = numberOfPages; max = numberOfPages;
@ -22,7 +22,7 @@ const Pages = ({currentPage, numberOfPages, changePage}) => {
} }
return ( 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}> <PaginationItem disabled={currentPage <= 1}>
<PaginationLink previous href="#" onClick={(e) => { <PaginationLink previous href="#" onClick={(e) => {
e.preventDefault(); e.preventDefault();
@ -43,14 +43,14 @@ const Pages = ({currentPage, numberOfPages, changePage}) => {
changePage(currentPage + 1); changePage(currentPage + 1);
}}/> }}/>
</PaginationItem> </PaginationItem>
</Pagination> </RPagination>
); );
}; };
Pages.propTypes = { Pagination.propTypes = {
numberOfPages: PropTypes.number, numberOfPages: PropTypes.number,
currentPage: PropTypes.number, currentPage: PropTypes.number,
changePage: PropTypes.func 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 PropTypes from 'prop-types';
import CardTitleIdenticon from './CardTitleIdenticon'; import CardTitleIdenticon from './CardTitleIdenticon';
import Pages from "./Pagination"; import Pagination from "./Pagination";
const Transactions = ({transactions, changePage, currentPage, numberOfPages}) => ( const Transactions = ({transactions, changePage, currentPage, numberOfPages}) => (
<Row> <Row>
@ -41,7 +41,7 @@ const Transactions = ({transactions, changePage, currentPage, numberOfPages}) =>
</Row> </Row>
</div> </div>
))} ))}
<Pages changePage={changePage} currentPage={currentPage} numberOfPages={numberOfPages}/> <Pagination changePage={changePage} currentPage={currentPage} numberOfPages={numberOfPages}/>
</CardBody> </CardBody>
</Card> </Card>
</Col> </Col>