Skip to content
This repository has been archived by the owner on Aug 11, 2021. It is now read-only.

Commit

Permalink
Use proper icons for pagination buttons
Browse files Browse the repository at this point in the history
  • Loading branch information
vinceau committed Dec 5, 2019
1 parent 73f9bbb commit 41e4f0e
Show file tree
Hide file tree
Showing 5 changed files with 66 additions and 4 deletions.
12 changes: 8 additions & 4 deletions react-client/src/components/views/StatsView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -220,16 +220,20 @@ export const StatsView = ({ trades, cumulativeVolume, tokenCount, volumes, reser
const oldTrades: List<Trade> = tradesList.filter(trade => trade.timestamp < twoDaysAgo);
const maxPage = trades ? Math.floor(trades.size / itemsPerPage) : 0;

const startIcon = require("../../styles/images/icons/icon-start.svg");
const endIcon = require("../../styles/images/icons/icon-end.svg");
const nextIcon = require("../../styles/images/icons/icon-next.svg");
const prevIcon = require("../../styles/images/icons/icon-prev.svg");
const pagination = (
<div className="stats--pagination">
<div className="page--number">
Page {page + 1} of {maxPage + 1}
</div>
<div className="page--change">
<button disabled={page === 0} onClick={() => { setPage(0) }}>|&lt;</button>
<button disabled={page === 0} onClick={() => { setPage(Math.max(0, page - 1)) }}>&lt;</button>
<button disabled={page === maxPage} onClick={() => { setPage(Math.min(maxPage, page + 1)) }}>&gt;</button>
<button disabled={page === maxPage} onClick={() => { setPage(maxPage) }}>&gt;|</button>
<button disabled={page === 0} onClick={() => { setPage(0) }}><img src={startIcon} /></button>
<button disabled={page === 0} onClick={() => { setPage(Math.max(0, page - 1)) }}><img src={prevIcon} /></button>
<button disabled={page === maxPage} onClick={() => { setPage(Math.min(maxPage, page + 1)) }}><img src={nextIcon} /></button>
<button disabled={page === maxPage} onClick={() => { setPage(maxPage) }}><img src={endIcon} /></button>
</div>
</div>
);
Expand Down
16 changes: 16 additions & 0 deletions react-client/src/styles/images/icons/icon-end.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
13 changes: 13 additions & 0 deletions react-client/src/styles/images/icons/icon-next.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
13 changes: 13 additions & 0 deletions react-client/src/styles/images/icons/icon-prev.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
16 changes: 16 additions & 0 deletions react-client/src/styles/images/icons/icon-start.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 41e4f0e

Please sign in to comment.