Skip to content

Commit

Permalink
minor improvement: hides the navigation arrow to the next/previous bu…
Browse files Browse the repository at this point in the history
…ild when it is currently at the last/first build.
  • Loading branch information
mbehzad committed Oct 27, 2017
1 parent ac5dcbd commit 6746889
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 1 deletion.
7 changes: 7 additions & 0 deletions build/css/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -353,6 +353,13 @@ a:hover {
cursor: pointer;
}

/* hide the arrow but allow it to take its space in the layout */
.arrow.inactive {
opacity: 0;
pointer-events: none;
cursor: default;
}

/* SPINNER */
.loader,
.loader:after {
Expand Down
10 changes: 9 additions & 1 deletion client/views/cards/Cards.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,15 @@ class Cards extends React.Component {
if (totalSize.toString().length > 3 && totalSize.toString().length < 7) totalSize = `${Math.floor(totalSize / 1000)}KB`;
if (totalSize.toString().length > 6) totalSize = `${(totalSize / 1000000).toFixed(2)}MB`;

const indexData = <span><span onClick={this.props.handleDecrement} className="arrow">&#9666;</span>{index + 1}<span onClick={this.props.handleIncrement} className="arrow">&#9656;</span></span>;
// arrows to the next/prev build,
// hide arrow(s) if it is currently at the last/first build therefore no navigation posibility
const indexData = (
<span>
<span onClick={this.props.handleDecrement} className={"arrow " + (this.props.activeBuild === 0 ? "inactive" : "")}>&#9666;</span>
{index + 1}
<span onClick={this.props.handleIncrement} className={"arrow " + (this.props.activeBuild === this.props.build.length - 1 ? "inactive" : "")}>&#9656;</span>
</span>
);

const cardData = [totalSize, chunksTotal, modulesTotal, assetsTotal, errorsTotal, indexData];

Expand Down

0 comments on commit 6746889

Please sign in to comment.