1
1
mirror of https://github.com/theoludwig/p61-project.git synced 2024-07-17 07:00:12 +02:00
p61-project/presentation/react/components/HabitCreateForm/HabitCreateForm.tsx

44 lines
1.0 KiB
TypeScript
Raw Normal View History

2024-04-04 12:31:56 +02:00
import { useForm } from "react-hook-form"
import { Appbar } from "react-native-paper"
import { SafeAreaView } from "react-native-safe-area-context"
import type { HabitCreateData } from "@/domain/entities/Habit"
import type { User } from "@/domain/entities/User"
export interface HabitCreateFormProps {
user: User
}
export const HabitCreateForm: React.FC<HabitCreateFormProps> = ({ user }) => {
useForm<HabitCreateData>({
// const { control, handleSubmit, setValue } = useForm<HabitCreateData>({
defaultValues: {
userId: user.id,
name: "",
color: "#006CFF",
icon: "lightbulb",
goal: {
frequency: "daily",
target: {
type: "boolean",
},
},
},
})
return (
<SafeAreaView>
<Appbar.Header>
<Appbar.Content
title="New Habit"
style={{
alignItems: "center",
justifyContent: "center",
}}
/>
</Appbar.Header>
{/* <Controller></Controller> */}
</SafeAreaView>
)
}