Skip to content

Commit

Permalink
update - commented fill all shots button
Browse files Browse the repository at this point in the history
  • Loading branch information
Gehrkej committed Aug 21, 2024
1 parent 0878f5a commit 97d935b
Showing 1 changed file with 41 additions and 41 deletions.
82 changes: 41 additions & 41 deletions app/segments/drill/[id]/submission/input.js
Original file line number Diff line number Diff line change
Expand Up @@ -1026,47 +1026,47 @@ export default function Input({ setToggleResult, setOutputData }) {
</KeyboardAvoiderScrollView>
{/* Navigation */}
<View style={styles.navigationContainer}>
<Text
onPress={() => {
const newInputValues = Array.from(
{ length: attemptShots.length },
() => ({}),
);
for (let i = 0; i < attemptShots.length; i++) {
drillInfo.inputs.forEach((item) => {
switch (item.id) {
case "carry":
newInputValues[i][item.id] = Math.floor(
Math.random() *
attemptShots[displayedShot].items["target"] +
attemptShots[displayedShot].items["target"] / 2,
).toString();
break;
case "sideLanding":
newInputValues[i][item.id] = Math.floor(
Math.random() * 21 - 10,
).toString();
break;
case "strokes":
newInputValues[i][item.id] = Math.floor(
Math.random() * 2 + 1,
).toString();
break;
case "distance":
newInputValues[i][item.id] = Math.floor(
Math.random() * 35 + 5,
).toString();
break;
}
});
}
setInputValues(newInputValues);
setDisplayedShot(attemptShots.length - 1);
setCurrentShot(attemptShots.length - 1);
}}
>
Fill in all inputs
</Text>
{/*<Text*/}
{/* onPress={() => {*/}
{/* const newInputValues = Array.from(*/}
{/* { length: attemptShots.length },*/}
{/* () => ({}),*/}
{/* );*/}
{/* for (let i = 0; i < attemptShots.length; i++) {*/}
{/* drillInfo.inputs.forEach((item) => {*/}
{/* switch (item.id) {*/}
{/* case "carry":*/}
{/* newInputValues[i][item.id] = Math.floor(*/}
{/* Math.random() **/}
{/* attemptShots[displayedShot].items["target"] +*/}
{/* attemptShots[displayedShot].items["target"] / 2,*/}
{/* ).toString();*/}
{/* break;*/}
{/* case "sideLanding":*/}
{/* newInputValues[i][item.id] = Math.floor(*/}
{/* Math.random() * 21 - 10,*/}
{/* ).toString();*/}
{/* break;*/}
{/* case "strokes":*/}
{/* newInputValues[i][item.id] = Math.floor(*/}
{/* Math.random() * 2 + 1,*/}
{/* ).toString();*/}
{/* break;*/}
{/* case "distance":*/}
{/* newInputValues[i][item.id] = Math.floor(*/}
{/* Math.random() * 35 + 5,*/}
{/* ).toString();*/}
{/* break;*/}
{/* }*/}
{/* });*/}
{/* }*/}
{/* setInputValues(newInputValues);*/}
{/* setDisplayedShot(attemptShots.length - 1);*/}
{/* setCurrentShot(attemptShots.length - 1);*/}
{/* }}*/}
{/*>*/}
{/* Fill in all inputs*/}
{/*</Text>*/}
{buttonDisplayHandler()}

{drillInfo.reps > 1 && (
Expand Down

0 comments on commit 97d935b

Please sign in to comment.