Skip to content

Commit

Permalink
Added total score, fading shots, and dueling tree shot record
Browse files Browse the repository at this point in the history
  • Loading branch information
dbecker1 committed Jul 5, 2020
1 parent 8baaa27 commit df83e5e
Show file tree
Hide file tree
Showing 3 changed files with 74 additions and 133 deletions.
153 changes: 52 additions & 101 deletions .idea/workspace.xml

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

11 changes: 10 additions & 1 deletion src/components/mainScreen/shooting/ShotRecord.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,16 @@ class ShotRecord extends React.Component {
}

renderCard(title, shots) {
const total = shots.reduce((acc, cur) => {
if (cur.hasOwnProperty("score") && !isNaN(cur.score.pointValue)) {
return acc + cur.score.pointValue
};
return acc
}, 0)
return (
<Card className={"text-center"} style={{marginBottom: "20px"}}>
<h4 style={{textDecoration: "underline"}}>{title}</h4>
<div style={{maxHeight: "150px", overflowY: "scroll"}}>
<div style={{height: "150px", overflowY: "scroll"}}>
<table style={{width: "100%", textAlign: "center"}}>
<thead style={{textDecoration: "underline"}}>
<tr>
Expand All @@ -54,6 +60,9 @@ class ShotRecord extends React.Component {
</tbody>
</table>
</div>
<div style={{paddingRight: "10px", paddingTop: "10px"}}>
<h6 className={"float-right"}>Total: {total}</h6>
</div>
<div id={"canvashere"}></div>
</Card>
);
Expand Down
Loading

0 comments on commit df83e5e

Please sign in to comment.