@@ -14,11 +14,8 @@ import {
14
14
Virus ,
15
15
} from "phosphor-react-native" ;
16
16
17
+ import { TrackableLogStep } from "~/components/app/trackableLogStep" ;
17
18
import { Text } from "~/components/ui/text" ;
18
- import { FoodDrinkStep } from "./logSteps/fooddrink" ;
19
- import { BloodStep , BodyStep , SymptomsStep } from "./logSteps/medical" ;
20
- import { ActivitiesStep , EnergyStep , SleepStep } from "./logSteps/physical" ;
21
- import { CyclesStep , MindStep , SupplementsStep } from "./logSteps/prevention" ;
22
19
23
20
// Button component for consistent styling and behavior
24
21
function LogButton ( {
@@ -43,26 +40,26 @@ function LogButton({
43
40
}
44
41
45
42
// Variant for the wider buttons
46
- function WideLogButton ( {
47
- icon,
48
- label,
49
- onPress,
50
- } : {
51
- icon : React . ReactNode ;
52
- label : string ;
53
- onPress : ( ) => void ;
54
- } ) {
55
- return (
56
- < Pressable
57
- className = "bg-sand-3 flex h-14 w-[48%] flex-row items-center justify-center gap-2 rounded-md"
58
- onPress = { onPress }
59
- android_ripple = { { color : "rgba(0, 0, 0, 0.1)" } }
60
- >
61
- { icon }
62
- < Text className = "text-sm" > { label } </ Text >
63
- </ Pressable >
64
- ) ;
65
- }
43
+ // function WideLogButton({
44
+ // icon,
45
+ // label,
46
+ // onPress,
47
+ // }: {
48
+ // icon: React.ReactNode;
49
+ // label: string;
50
+ // onPress: () => void;
51
+ // }) {
52
+ // return (
53
+ // <Pressable
54
+ // className="bg-sand-3 flex h-14 w-[48%] flex-row items-center justify-center gap-2 rounded-md"
55
+ // onPress={onPress}
56
+ // android_ripple={{ color: "rgba(0, 0, 0, 0.1)" }}
57
+ // >
58
+ // {icon}
59
+ // <Text className="text-sm">{label}</Text>
60
+ // </Pressable>
61
+ // );
62
+ // }
66
63
67
64
// Define step types for our state management
68
65
type StepType =
@@ -89,25 +86,85 @@ export default function Logger() {
89
86
const renderStep = ( ) => {
90
87
switch ( currentStep ) {
91
88
case "food" :
92
- return < FoodDrinkStep onBack = { handleBack } /> ;
89
+ return (
90
+ < TrackableLogStep
91
+ onBack = { handleBack }
92
+ trackableParentType = "consumption"
93
+ trackableSubType = "consumption.parent.food"
94
+ />
95
+ ) ;
93
96
case "activities" :
94
- return < ActivitiesStep onBack = { handleBack } /> ;
97
+ return (
98
+ < TrackableLogStep
99
+ onBack = { handleBack }
100
+ trackableParentType = "activity"
101
+ trackableSubType = "custom.generic"
102
+ />
103
+ ) ;
95
104
case "energy" :
96
- return < EnergyStep onBack = { handleBack } /> ;
105
+ return (
106
+ < TrackableLogStep
107
+ onBack = { handleBack }
108
+ trackableParentType = "energy"
109
+ trackableSubType = "energy.calories.net"
110
+ />
111
+ ) ;
97
112
case "sleep" :
98
- return < SleepStep onBack = { handleBack } /> ;
113
+ return (
114
+ < TrackableLogStep
115
+ onBack = { handleBack }
116
+ trackableParentType = "sleep"
117
+ trackableSubType = "custom.generic"
118
+ />
119
+ ) ;
99
120
case "supplements" :
100
- return < SupplementsStep onBack = { handleBack } /> ;
121
+ return (
122
+ < TrackableLogStep
123
+ onBack = { handleBack }
124
+ trackableParentType = "supplement"
125
+ trackableSubType = "supplement.generic"
126
+ />
127
+ ) ;
101
128
case "cycles" :
102
- return < CyclesStep onBack = { handleBack } /> ;
129
+ return (
130
+ < TrackableLogStep
131
+ onBack = { handleBack }
132
+ trackableParentType = "body"
133
+ trackableSubType = "body.generic"
134
+ />
135
+ ) ;
103
136
case "mind" :
104
- return < MindStep onBack = { handleBack } /> ;
137
+ return (
138
+ < TrackableLogStep
139
+ onBack = { handleBack }
140
+ trackableParentType = "mind"
141
+ trackableSubType = "custom.generic"
142
+ />
143
+ ) ;
105
144
case "symptoms" :
106
- return < SymptomsStep onBack = { handleBack } /> ;
145
+ return (
146
+ < TrackableLogStep
147
+ onBack = { handleBack }
148
+ trackableParentType = "symptom"
149
+ trackableSubType = "symptom.generic"
150
+ />
151
+ ) ;
107
152
case "blood" :
108
- return < BloodStep onBack = { handleBack } /> ;
153
+ return (
154
+ < TrackableLogStep
155
+ onBack = { handleBack }
156
+ trackableParentType = "blood"
157
+ trackableSubType = "blood.generic"
158
+ />
159
+ ) ;
109
160
case "body" :
110
- return < BodyStep onBack = { handleBack } /> ;
161
+ return (
162
+ < TrackableLogStep
163
+ onBack = { handleBack }
164
+ trackableParentType = "body"
165
+ trackableSubType = "body.generic"
166
+ />
167
+ ) ;
111
168
default :
112
169
return null ;
113
170
}
0 commit comments