Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Don't Merge Until Build] Update - Commented fill all shots button #335

Open
wants to merge 8 commits into
base: main
Choose a base branch
from
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 @@ -850,7 +850,7 @@
}
};

const handleSubmit = useCallback(

Check warning on line 853 in app/segments/drill/[id]/submission/input.js

View workflow job for this annotation

GitHub Actions / prettier-check

React Hook useCallback received a function whose dependencies are unknown. Pass an inline function instead
once(async () => {
setSubmitLoading(true);
const outputData = createOutputData(
Expand Down Expand Up @@ -1026,47 +1026,47 @@
</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
Loading