Skip to content

Commit

Permalink
fix: logevent
Browse files Browse the repository at this point in the history
  • Loading branch information
YoanRos committed Dec 21, 2023
1 parent 14e5924 commit 5978cac
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
5 changes: 5 additions & 0 deletions api/src/controllers/appMilestone.js
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,11 @@ router.post(
"Si vous avez choisi d'être abstinent, vous pouvez désormais voir votre nombre de jours consécutifs sans avoir consommé d'alcool. Rendez-vous dans l'onglet calendrier !",
CTATitle: "Découvrir",
CTANavigation: ["ABSTINENCE_SELECTION"],
CTAEvent: {
category: "ABSTINENCE_SELECTION",
action: "PRESSED_FROM_NEW_FEATURE_MODAL",
name: "FROM_NEW_FEATURE",
},
},
});
}
Expand Down
10 changes: 9 additions & 1 deletion app/src/scenes/Gains/AbstinenceSelection.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React from 'react';
import { View, Text, SafeAreaView, TouchableOpacity, Dimensions } from 'react-native';

import { logEvent } from '../../services/logEventsWithMatomo';
import { storage } from '../../services/storage';

const AbstinenceSelection = ({ navigation, route }) => {
Expand Down Expand Up @@ -39,6 +39,10 @@ const AbstinenceSelection = ({ navigation, route }) => {
onPress={() => {
onClose();
storage.set('@isAbstinent', true);
logEvent({
category: 'ABSTINENCE_SELECTION',
action: 'ABSTINENCE_SELECTION_YES',
});
}}>
<Text className="text-xl color-white font-extrabold">Oui</Text>
</TouchableOpacity>
Expand All @@ -47,6 +51,10 @@ const AbstinenceSelection = ({ navigation, route }) => {
onPress={() => {
onClose();
storage.set('@isAbstinent', false);
logEvent({
category: 'ABSTINENCE_SELECTION',
action: 'ABSTINENCE_SELECTION_NO',
});
}}>
<Text className="text-xl color-white font-extrabold">Non</Text>
</TouchableOpacity>
Expand Down

0 comments on commit 5978cac

Please sign in to comment.