Submit weight after entering value

This commit is contained in:
Brandon Presley 2023-10-24 16:16:42 +13:00
parent 28250f1862
commit cb5aa72552
1 changed files with 4 additions and 4 deletions

View File

@ -39,7 +39,7 @@ export default function EditWeight() {
}, []) }, [])
); );
const handleSubmit = async () => { const submit = async () => {
if (!value) return; if (!value) return;
const newWeight: Partial<Weight> = { const newWeight: Partial<Weight> = {
@ -93,11 +93,11 @@ export default function EditWeight() {
<View style={{ padding: PADDING, flex: 1 }}> <View style={{ padding: PADDING, flex: 1 }}>
<AppInput <AppInput
label="Value" label="Weight"
value={value} value={value}
onChangeText={setValue} onChangeText={setValue}
keyboardType="numeric" keyboardType="numeric"
onSubmitEditing={() => unitRef.current?.focus()} onSubmitEditing={submit}
/> />
{settings.showUnit && ( {settings.showUnit && (
@ -124,7 +124,7 @@ export default function EditWeight() {
mode="outlined" mode="outlined"
icon="content-save" icon="content-save"
style={{ margin: MARGIN }} style={{ margin: MARGIN }}
onPress={handleSubmit} onPress={submit}
> >
Save Save
</Button> </Button>