diff --git a/api/src/utils/notifications-catalog.js b/api/src/utils/notifications-catalog.js index 7f6e6077b..28ad93bcd 100644 --- a/api/src/utils/notifications-catalog.js +++ b/api/src/utils/notifications-catalog.js @@ -14,7 +14,7 @@ const NOTIFICATIONS_TYPES = { NOT_ACTIVATED_3_DAYS: { type: "NOT_ACTIVATED_3_DAYS", title: "Vous n'êtes pas resté longtemps", - body: "Nous aimerions savoir ce qui ne vous a pas plu pour améliorer l'application", + body: "Nous aimerions savoir ce qui vous ferait rester sur Oz", link: "oz://NOT_ACTIVATED_NPS_SCREEN", }, INACTIVITY_10_DAYS: { diff --git a/expo/src/scenes/NPS/Inactivity_NPSScreen.js b/expo/src/scenes/NPS/Inactivity_NPSScreen.js index ce63b953d..3fad64871 100644 --- a/expo/src/scenes/NPS/Inactivity_NPSScreen.js +++ b/expo/src/scenes/NPS/Inactivity_NPSScreen.js @@ -1,13 +1,12 @@ -import React, { useRef, useEffect, useState } from 'react'; -import { Platform, Text, View, KeyboardAvoidingView, TextInput, ScrollView, TouchableOpacity } from 'react-native'; -import { SafeAreaProvider } from 'react-native-safe-area-context'; -import pck from '../../../package.json'; -import Background from '../../components/Background'; -import ButtonPrimary from '../../components/ButtonPrimary'; -import { logEvent } from '../../services/logEventsWithMatomo'; -import { storage } from '../../services/storage'; -import BackButton from '../../components/BackButton'; -import { sendMail } from '../../services/mail'; +import React, { useRef, useEffect, useState } from "react"; +import { Platform, Text, View, KeyboardAvoidingView, TextInput, ScrollView, TouchableOpacity } from "react-native"; +import { SafeAreaProvider } from "react-native-safe-area-context"; +import pck from "../../../package.json"; +import Background from "../../components/Background"; +import ButtonPrimary from "../../components/ButtonPrimary"; +import { logEvent } from "../../services/logEventsWithMatomo"; +import { storage } from "../../services/storage"; +import { sendMail } from "../../services/mail"; const formatText = (answer, feedback, userId) => ` @@ -20,19 +19,19 @@ Qu'est-ce qui vous aurait fait rester ? : ${feedback} const Inactivity_NPSScreen = ({ navigation }) => { const [selectedAnswerKey, setSelectedAnswerKey] = useState(null); - const [feedback, setFeedback] = useState(''); - const [sendButton, setSendButton] = useState('Envoyer'); + const [feedback, setFeedback] = useState(""); + const [sendButton, setSendButton] = useState("Envoyer"); const answers = [ - { answerKey: 'OZ_HELPED', content: "Oz m'a aidé mais je n'en ai plus besoin", score: 0 }, - { answerKey: 'LAKE_FEATURES', content: 'Il manque des fonctionnalités', score: 1 }, - { answerKey: 'USING_OTHER_APP', content: 'Je préfère une autre application', score: 2 }, - { answerKey: 'OTHER', content: 'Autre', score: 3 }, + { answerKey: "OZ_HELPED", content: "Oz m'a aidé mais je n'en ai plus besoin", score: 0 }, + { answerKey: "LAKE_FEATURES", content: "Il manque des fonctionnalités", score: 1 }, + { answerKey: "USING_OTHER_APP", content: "Je préfère une autre application", score: 2 }, + { answerKey: "OTHER", content: "Autre", score: 3 }, ]; useEffect(() => { logEvent({ - category: 'INACTIVITY_NPS', - action: 'INACTIVITY_NPS_OPEN', + category: "INACTIVITY_NPS", + action: "INACTIVITY_NPS_OPEN", }); }, []); const onGoBackRequested = async () => { @@ -50,7 +49,7 @@ const Inactivity_NPSScreen = ({ navigation }) => { }; useEffect(() => { - const beforeRemoveListenerUnsbscribe = navigation.addListener('beforeRemove', handleBeforeRemove); + const beforeRemoveListenerUnsbscribe = navigation.addListener("beforeRemove", handleBeforeRemove); return () => { beforeRemoveListenerUnsbscribe(); }; @@ -60,23 +59,23 @@ const Inactivity_NPSScreen = ({ navigation }) => { const npsSent = useRef(false); const sendNPS = async () => { if (npsSent.current) return; - const userId = storage.getString('@UserIdv2'); - setSendButton('Merci !'); + const userId = storage.getString("@UserIdv2"); + setSendButton("Merci !"); logEvent({ - category: 'INACTIVITY_NPS', - action: 'INACTIVITY_NPS_SEND_ANSWER', + category: "INACTIVITY_NPS", + action: "INACTIVITY_NPS_SEND_ANSWER", value: answers.find(({ answerKey }) => answerKey === selectedAnswerKey)?.score, }); if (feedback) { logEvent({ - category: 'INACTIVITY_NPS', - action: 'INACTIVITY_NPS_SEND_FEEDBACK', + category: "INACTIVITY_NPS", + action: "INACTIVITY_NPS_SEND_FEEDBACK", }); } await sendMail({ - subject: 'Inactivity 10 days NPS Addicto', + subject: "Inactivity 10 days NPS Addicto", text: formatText(answers.find(({ answerKey }) => answerKey === selectedAnswerKey)?.content, feedback, userId), - }).catch((err) => console.log('sendNPS err', err)); + }).catch((err) => console.log("sendNPS err", err)); npsSent.current = true; navigation.goBack(); @@ -88,14 +87,15 @@ const Inactivity_NPSScreen = ({ navigation }) => { + behavior={Platform.select({ ios: "padding", android: null })} + keyboardVerticalOffset={Platform.select({ ios: 50, android: 250 })} + > - + keyboardDismissMode="none" + > Dites nous pourquoi vous êtes partis, ça nous aidera à améliorer l’application @@ -108,20 +108,22 @@ const Inactivity_NPSScreen = ({ navigation }) => { {answers.map(({ answerKey, content }, i) => ( { setSelectedAnswerKey(answerKey); - }}> + }} + > + className={["font-medium", answerKey === selectedAnswerKey ? "text-white" : "text-black"].join( + " " + )} + > {content} diff --git a/expo/src/scenes/NPS/not_activated_NPSScreen.js b/expo/src/scenes/NPS/not_activated_NPSScreen.js index e3407ce0a..e3a0b2801 100644 --- a/expo/src/scenes/NPS/not_activated_NPSScreen.js +++ b/expo/src/scenes/NPS/not_activated_NPSScreen.js @@ -6,7 +6,6 @@ import Background from "../../components/Background"; import ButtonPrimary from "../../components/ButtonPrimary"; import { logEvent } from "../../services/logEventsWithMatomo"; import { storage } from "../../services/storage"; -import BackButton from "../../components/BackButton"; import { sendMail } from "../../services/mail"; const formatText = (answer, feedback, userId, contact) => @@ -110,7 +109,6 @@ const Not_Activated_NPSScreen = ({ navigation }) => { keyboardShouldPersistTaps="never" keyboardDismissMode="none" > - Dites nous pourquoi vous n'êtes pas resté pour nous aider à améliorer l'application @@ -152,7 +150,7 @@ const Not_Activated_NPSScreen = ({ navigation }) => {