feat: add MeasurementForm and NewMeasurementScreen

This commit is contained in:
Eddy de Vink 2026-06-27 22:40:38 +02:00
commit 212bc700c3
2 changed files with 108 additions and 0 deletions

View file

@ -0,0 +1,21 @@
import React from 'react'
import { Alert } from 'react-native'
import MeasurementForm from '../components/MeasurementForm'
import { Measurement } from '../types'
import { initDatabase, insertMeasurement } from '../database/db'
type Props = {
navigation: any
}
export default function NewMeasurementScreen({ navigation }: Props) {
const handleSubmit = async (m: Measurement) => {
await initDatabase()
await insertMeasurement(m)
Alert.alert('Opgeslagen', 'Meting is opgeslagen', [
{ text: 'OK', onPress: () => navigation.goBack() },
])
}
return <MeasurementForm onSubmit={handleSubmit} />
}