feat: habit frequency & type labels

This commit is contained in:
Xc165543337 2024-04-04 17:33:51 +02:00
parent bc9d7ae1af
commit a2d187a27a

View File

@ -5,6 +5,7 @@ import {
Button,
HelperText,
SegmentedButtons,
Text,
TextInput,
} from "react-native-paper"
import { SafeAreaView } from "react-native-safe-area-context"
@ -14,11 +15,11 @@ import ColorPicker, {
Preview,
} from "reanimated-color-picker"
import type { GoalFrequency, GoalType } from "@/domain/entities/Goal"
import { GOAL_FREQUENCIES, GOAL_TYPES } from "@/domain/entities/Goal"
import type { HabitCreateData } from "@/domain/entities/Habit"
import { HabitCreateSchema } from "@/domain/entities/Habit"
import type { User } from "@/domain/entities/User"
import type { GoalFrequency, GoalType } from "@/domain/entities/Goal"
import { GOAL_FREQUENCIES, GOAL_TYPES } from "@/domain/entities/Goal"
import { capitalize } from "@/presentation/presenters/utils/strings"
export interface HabitCreateFormProps {
@ -154,6 +155,8 @@ export const HabitCreateForm: React.FC<HabitCreateFormProps> = ({ user }) => {
control={control}
render={({ field: { onChange, value } }) => {
return (
<>
<Text style={{ margin: 8 }}>Habit frequency</Text>
<SegmentedButtons
onValueChange={onChange}
value={value}
@ -165,6 +168,7 @@ export const HabitCreateForm: React.FC<HabitCreateFormProps> = ({ user }) => {
}
})}
/>
</>
)
}}
name="goal.frequency"
@ -174,6 +178,8 @@ export const HabitCreateForm: React.FC<HabitCreateFormProps> = ({ user }) => {
control={control}
render={({ field: { onChange, value } }) => {
return (
<>
<Text style={{ margin: 8 }}>Habit type</Text>
<SegmentedButtons
onValueChange={onChange}
value={value}
@ -185,6 +191,7 @@ export const HabitCreateForm: React.FC<HabitCreateFormProps> = ({ user }) => {
}
})}
/>
</>
)
}}
name="goal.target.type"