Skip to content

Commit

Permalink
Merge pull request bruin-tennis-consulting#72 from awest25/test_branch
Browse files Browse the repository at this point in the history
Changed Pointlist.js
  • Loading branch information
jerryshi042003 authored Feb 7, 2024
2 parents 6446023 + cbfcf96 commit 6929b4d
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
12 changes: 7 additions & 5 deletions components/PointsList.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,17 @@ import React from 'react';
import styles from '../styles/PointsList.module.css';

const PointsList = ({ pointsData, onPointSelect }) => {
const calculateTotalSets = (setScore) => {
const scores = setScore.split('-').map(Number);
return scores.reduce((a, b) => a + b, 0) + 1;
}
// Switched for Point Title Calculated in Notebook
// const calculateTotalSets = (setScore) => {
// const scores = setScore.split('-').map(Number);
// return scores.reduce((a, b) => a + b, 0) + 1;
// }

return (
<ul className={styles.pointsList}>
{pointsData.map((point, index) => (
<li className={styles.pointsListItem} key={index} onClick={() => onPointSelect(point.Position)}>
{"Score: " + point.Name + " Games: " + point.gameScore + " Set: " + calculateTotalSets(point.setScore)}
{point.Name}
</li>
))}
</ul>
Expand Down
1 change: 0 additions & 1 deletion services/nameMap.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@

const nameMap = {
// New Player1 Focused Map
//Group 1: Serve
"player1ServePlacement" : 'Serve Placement',
"player1ServeResult" : 'Serve Result',

Expand Down

0 comments on commit 6929b4d

Please sign in to comment.