Skip to content

Commit

Permalink
fix: logevents + typo
Browse files Browse the repository at this point in the history
  • Loading branch information
YoanRos committed May 1, 2024
1 parent d4c5064 commit d7149c1
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 11 deletions.
2 changes: 1 addition & 1 deletion app/src/components/VideoPlayer.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ const VideoPlayer = ({ route, navigation }) => {
logEvent({
category: 'VIDEOS',
action: 'VIDEO_ENDED',
name: category + videoId,
name: category + ' ' + videoId,
});
} else if (state === 'unstarted') {
logEvent({
Expand Down
8 changes: 6 additions & 2 deletions app/src/scenes/Craving/CravingBreath.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,17 @@ const CravingBreath = () => {
setTimeOnComponent((prevTime) => prevTime + 1);
if (timeOnComponent >= 90) {
navigation.goBack();
logEvent({
category: 'CRAVING',
action: 'BREATH_LEAVE',
value: timeOnComponent,
});
}
}, 1000);
return () => {
clearInterval(timer);
};
}, []);
}, [timeOnComponent]);

useEffect(() => {
Animated.loop(
Expand Down Expand Up @@ -103,7 +108,6 @@ const CravingBreath = () => {
category: 'CRAVING',
action: 'BREATH_LEAVE',
value: timeOnComponent,
name: 'CRAVING_BREATH',
});
navigation.goBack();
}}
Expand Down
2 changes: 1 addition & 1 deletion app/src/scenes/Craving/CravingIndex.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ const CravingIndex = ({ navigation }) => {
<TouchableOpacity
className="flex-1 rounded-md shadow-md overflow-hidden"
onPress={() => {
navigation.navigate('CRAVING_ADVICE');
navigation.navigate('HYDRATION_ADVICE');
}}>
<ImageBackground className="w-full h-full" source={require('../../assets/images/BackGroundAdvices.png')}>
<View className="flex items-center h-full justify-between py-6 ">
Expand Down
2 changes: 1 addition & 1 deletion app/src/scenes/Craving/CravingNavigator.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ const CravingNavigator = () => {
<CravingStack.Screen name="EXERCISES_VIDEOS_INDEX" component={ExercicesVideosIndex} />
<CravingStack.Screen name="ENTERTAINMENT_VIDEOS_INDEX" component={EntertainmentVideosIndex} />
<CravingStack.Screen name="VIDEO_PLAYER" component={VideoPlayer} />
<CravingStack.Screen name="CRAVING_ADVICE" component={Advice} />
<CravingStack.Screen name="HYDRATION_ADVICE" component={Advice} />
</CravingStack.Navigator>
</Background>
);
Expand Down
12 changes: 6 additions & 6 deletions app/src/scenes/Craving/ExercicesVideosIndex.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,13 @@ const ExercicesVideosIndex = ({ navigation }) => {
onPress={() => {
navigation.navigate('VIDEO_PLAYER', {
videoIds: ['aFEkeYEb4SY', 'bmgbJ0WIV2k', 'XNbim0qOtMw', 'yUzzYkFT33k', 'y92jlo50EBw', 'ZMDIJC3ZMm8'],
category: 'TCC',
title: 'Vidéos de TCC',
category: 'RESSENTI',
title: 'Vidéos de ressenti',
});
logEvent({
category: 'NAVIGATION',
action: 'TCC_VIDEOS',
name: 'EXERCIICES_VIDEOS_INDEX',
action: 'RESSENTI_VIDEOS',
name: 'EXERCICES_VIDEOS_INDEX',
});
}}>
<View className="w-full h-full flex-row flex justify-between ">
Expand Down Expand Up @@ -55,7 +55,7 @@ const ExercicesVideosIndex = ({ navigation }) => {
logEvent({
category: 'NAVIGATION',
action: 'MEDITATION_VIDEOS',
name: 'EXERCIICES_VIDEOS_INDEX',
name: 'EXERCICES_VIDEOS_INDEX',
});
}}>
<View className="w-full h-full flex-row flex justify-between ">
Expand All @@ -76,7 +76,7 @@ const ExercicesVideosIndex = ({ navigation }) => {
logEvent({
category: 'NAVIGATION',
action: 'SOPHROLOGY_VIDEOS',
name: 'EXERCIICES_VIDEOS_INDEX',
name: 'EXERCICES_VIDEOS_INDEX',
});
}}>
<View className="w-full flex-row flex justify-between">
Expand Down

0 comments on commit d7149c1

Please sign in to comment.