Skip to content

Commit

Permalink
fix: urls in constants
Browse files Browse the repository at this point in the history
  • Loading branch information
Arnaud AMBROSELLI committed Jul 30, 2024
1 parent 0791fd4 commit aa93538
Show file tree
Hide file tree
Showing 9 changed files with 73 additions and 96 deletions.
9 changes: 5 additions & 4 deletions expo/src/components/InAppModal.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ import CravingIcon from "./illustrations/CravingIcon";
import StrategyIcon from "./illustrations/StrategyIcon";
import CupMotivation from "./illustrations/icons/CupMotivation";
import TransferModalIcon from "./illustrations/icons/TransferModalIcon";
import { APPSTORE_URL, PLAYSTORE_URL } from "../reference/urls";

/* example
{
Expand Down Expand Up @@ -56,8 +57,8 @@ const InAppModal = ({ navigation, route }) => {
} else {
Linking.openURL(
Platform.select({
ios: "https://apps.apple.com/us/app/oz-ensemble/id1498190343?ls=1",
android: "https://play.google.com/store/apps/details?id=com.addicto",
ios: APPSTORE_URL,
android: PLAYSTORE_URL,
})
);
}
Expand Down Expand Up @@ -90,8 +91,8 @@ const InAppModal = ({ navigation, route }) => {
} else {
Linking.openURL(
Platform.select({
ios: "https://apps.apple.com/us/app/oz-ensemble/id1498190343?ls=1",
android: "https://play.google.com/store/apps/details?id=com.addicto",
ios: APPSTORE_URL,
android: PLAYSTORE_URL,
})
);
}
Expand Down
9 changes: 9 additions & 0 deletions expo/src/reference/urls.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
export const PLAYSTORE_URL = "https://play.google.com/store/apps/details?id=com.addicto";
export const APPSTORE_URL = "https://apps.apple.com/us/app/oz-ensemble/id1498190343?ls=1";
export const OZ_LANDING_PAGE = "https://ozensemble.fabrique.social.gouv.fr/";
export const PRIVACY_POLICY_URL = "https://ozensemble.fabrique.social.gouv.fr/files/privacy_policy_app.html";
export const CGUS_URL = "https://ozensemble.fabrique.social.gouv.fr/files/CGU_app.html";
export const GERALDINE_URL = "https://www.linkedin.com/in/geraldine-talbot-13989b263";
export const DOCTOLIB_URL =
"https://www.doctolib.fr/addictologue/montreuil/ensemble-oz?utm_campaign=website-button&utm_source=ensemble-oz-website-button&utm_medium=referral&utm_content=option-1&utm_term=ensemble-oz";
export const CAPASSCITE = "https://www.capasscite.fr/";
22 changes: 7 additions & 15 deletions expo/src/scenes/Badges/BadgeModal.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,6 @@
import * as Linking from "expo-linking";
import React, { useEffect } from "react";
import {
InteractionManager,
Platform,
SafeAreaView,
Text,
TouchableOpacity,
View,
} from "react-native";
import { InteractionManager, Platform, SafeAreaView, Text, TouchableOpacity, View } from "react-native";
import InAppReview from "react-native-in-app-review";
import Svg, { Path } from "react-native-svg";
import { useSetRecoilState } from "recoil";
Expand All @@ -25,6 +18,7 @@ import { BadgeDrinks } from "./Svgs/BadgeDrinks";
import { BadgeGoals } from "./Svgs/BadgeGoals";
import { BadgeShare } from "./Svgs/BadgeShare";
import { LockedBadge } from "./Svgs/LockedBadge";
import { APPSTORE_URL, PLAYSTORE_URL } from "../../reference/urls";
/* example
{
category: 'drinks',
Expand Down Expand Up @@ -70,8 +64,8 @@ const BadgeModal = ({ navigation, route }) => {
} else {
Linking.openURL(
Platform.select({
ios: "https://apps.apple.com/us/app/oz-ensemble/id1498190343?ls=1",
android: "https://play.google.com/store/apps/details?id=com.addicto",
ios: APPSTORE_URL,
android: PLAYSTORE_URL,
})
);
}
Expand All @@ -97,8 +91,8 @@ const BadgeModal = ({ navigation, route }) => {
} else {
Linking.openURL(
Platform.select({
ios: "https://apps.apple.com/us/app/oz-ensemble/id1498190343?ls=1",
android: "https://play.google.com/store/apps/details?id=com.addicto",
ios: APPSTORE_URL,
android: PLAYSTORE_URL,
})
);
}
Expand Down Expand Up @@ -154,9 +148,7 @@ const BadgeModal = ({ navigation, route }) => {
)}
{!!badge?.secondaryButtonTitle?.length && (
<TouchableOpacity>
<Text
className="text-indigo-600 text-center underline text-base"
onPress={onSecondaryPress}>
<Text className="text-indigo-600 text-center underline text-base" onPress={onSecondaryPress}>
{badge?.secondaryButtonTitle}
</Text>
</TouchableOpacity>
Expand Down
17 changes: 9 additions & 8 deletions expo/src/scenes/Health/ContactForm.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import { logEvent } from "../../services/logEventsWithMatomo";
import { defaultPaddingFontScale, screenWidth } from "../../styles/theme";
import H2 from "../../components/H2";
import WrapperContainer from "../../components/WrapperContainer";
import { CAPASSCITE } from "../../reference/urls";

const ContactForm = ({ navigation }) => {
return (
Expand All @@ -16,11 +17,10 @@ const ContactForm = ({ navigation }) => {
<>
<TextStyled color="#4030a5">Échangez</TextStyled>
<TextStyled color="#de285e"> gratuitement </TextStyled>
<TextStyled color="#4030a5">
par téléphone avec un professionnel de l'addiction
</TextStyled>
<TextStyled color="#4030a5">par téléphone avec un professionnel de l'addiction</TextStyled>
</>
}>
}
>
<TopSubTitle>
<TextStyled color="#191919">Prenez un rendez-vous </TextStyled>
<TextStyled color="#4030a5">téléphonique </TextStyled>
Expand All @@ -44,8 +44,8 @@ const ContactForm = ({ navigation }) => {
</TopButtonContainer>
<Extra>
<TextStyled color="#191919">
Nos équipes sont des professionnels spécialisés en addictions et vous aideront à faire le
point ou répondront à vos questions. Nos locaux sont situés à Montreuil -{" "}
Nos équipes sont des professionnels spécialisés en addictions et vous aideront à faire le point ou répondront
à vos questions. Nos locaux sont situés à Montreuil -{" "}
</TextStyled>
<TextStyled
color="#4030a5"
Expand All @@ -54,8 +54,9 @@ const ContactForm = ({ navigation }) => {
category: "CONTACT",
action: "CONTACT_WEBSITE_OPEN",
});
Linking.openURL("https://www.capasscite.fr/");
}}>
Linking.openURL(CAPASSCITE);
}}
>
Qui sommes nous ?
</TextStyled>
</Extra>
Expand Down
9 changes: 3 additions & 6 deletions expo/src/scenes/Health/Doctolib.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import Background from "../../components/Background";
import BackButton from "../../components/BackButton";
import { logEvent } from "../../services/logEventsWithMatomo";
import { defaultPaddingFontScale } from "../../styles/theme";
import { DOCTOLIB_URL } from "../../reference/urls";

const Doctolib = ({ navigation }) => {
const [visible, setVisible] = useState(true);
Expand Down Expand Up @@ -56,11 +57,7 @@ const Doctolib = ({ navigation }) => {
};

return (
<Modal
visible={visible}
animationType="slide"
presentationStyle="formSheet"
onRequestClose={hide}>
<Modal visible={visible} animationType="slide" presentationStyle="formSheet" onRequestClose={hide}>
<SafeAreaProvider>
<Background color="#f9f9f9">
<Container>
Expand All @@ -70,7 +67,7 @@ const Doctolib = ({ navigation }) => {
<WebViewContainer>
<WebView
source={{
uri: "https://www.doctolib.fr/addictologue/montreuil/ensemble-oz?utm_campaign=website-button&amp;utm_source=ensemble-oz-website-button&amp;utm_medium=referral&amp;utm_content=option-1&amp;utm_term=ensemble-oz",
uri: DOCTOLIB_URL,
}}
renderLoading={Loading}
startInLoadingState
Expand Down
9 changes: 3 additions & 6 deletions expo/src/scenes/Infos/CGUs.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,20 +4,17 @@ import BackButton from "../../components/BackButton";
import { defaultPaddingFontScale } from "../../styles/theme";
import styled from "styled-components";
import WebView from "react-native-webview";

const htmlUrl = "https://ozensemble.fabrique.social.gouv.fr/files/CGU_app.html";
import { CGUS_URL } from "../../reference/urls";

const CGUs = ({ onClose }) => (
<View className="flex-1 justify-start items-center mt-6">
<View
className="flex flex-row w-full mb-4"
style={{ paddingHorizontal: defaultPaddingFontScale() }}>
<View className="flex flex-row w-full mb-4" style={{ paddingHorizontal: defaultPaddingFontScale() }}>
<BackButton onPress={onClose} />
</View>
<WebViewContainer>
<WebView
source={{
uri: htmlUrl,
uri: CGUS_URL,
}}
/>
</WebViewContainer>
Expand Down
42 changes: 12 additions & 30 deletions expo/src/scenes/Infos/Official.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,34 +6,32 @@ import WrapperContainer from "../../components/WrapperContainer";
import TextStyled from "../../components/TextStyled";
import H1 from "../../components/H1";
import Background from "../../components/Background";
import { GERALDINE_URL } from "../../reference/urls";

const Official = ({ onClose }) => (
<Background color="#39cec0" withSwiperContainer neverBottom>
<WrapperContainer onPressBackButton={onClose}>
<View className="items-center">
<Image
className="rounded-full w-[100px] h-[100px]"
source={require("../../assets/images/Icon.png")}
/>
<Image className="rounded-full w-[100px] h-[100px]" source={require("../../assets/images/Icon.png")} />
</View>
<Spacer size={30} />
<H1>Oz Ensemble, l’application des Ministères Sociaux</H1>
<Spacer size={30} />

<P>
Oz est un service publique numérique anonyme et gratuit développé par la Fabrique Numérique,
incubateur des Ministères Sociaux et financé par l’Agence Régionale de Santé d’Ile de France
et de la MILDECA (Mission Interministérielle de Lutte Contre les Drogues et les Conduites
Addictives)
Oz est un service publique numérique anonyme et gratuit développé par la Fabrique Numérique, incubateur des
Ministères Sociaux et financé par l’Agence Régionale de Santé d’Ile de France et de la MILDECA (Mission
Interministérielle de Lutte Contre les Drogues et les Conduites Addictives)
</P>
<View className="flex flex-row basis-11/12">
<P noMarginBottom>
Le créateur du service est le{" "}
<Text
className="text-indigo-700"
onPress={() => {
Linking.openURL("https://www.linkedin.com/in/geraldine-talbot-13989b263");
}}>
Linking.openURL(GERALDINE_URL);
}}
>
Docteur Géraldine Talbot
</Text>
, médecin addictologue de l’association CaPASSCité.
Expand All @@ -42,28 +40,12 @@ const Official = ({ onClose }) => (

{/* */}
<View className="flex-row items-center justify-between">
<Image
className="w-[45%]"
source={require("../../assets/images/MIN_SOCIAUX.png")}
resizeMode="contain"
/>
<Image
className="w-[45%]"
resizeMode="contain"
source={require("../../assets/images/Logo_ARS.png")}
/>
<Image className="w-[45%]" source={require("../../assets/images/MIN_SOCIAUX.png")} resizeMode="contain" />
<Image className="w-[45%]" resizeMode="contain" source={require("../../assets/images/Logo_ARS.png")} />
</View>
<View className="flex-row items-center justify-between">
<Image
className="w-[45%]"
resizeMode="contain"
source={require("../../assets/images/logo_MILDECA.png")}
/>
<Image
className="w-[45%]"
resizeMode="contain"
source={require("../../assets/images/CaPASSCite.png")}
/>
<Image className="w-[45%]" resizeMode="contain" source={require("../../assets/images/logo_MILDECA.png")} />
<Image className="w-[45%]" resizeMode="contain" source={require("../../assets/images/CaPASSCite.png")} />
</View>
</WrapperContainer>
</Background>
Expand Down
9 changes: 3 additions & 6 deletions expo/src/scenes/Infos/PrivacyPolicy.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,20 +4,17 @@ import BackButton from "../../components/BackButton";
import { defaultPaddingFontScale } from "../../styles/theme";
import { WebView } from "react-native-webview";
import styled from "styled-components";

const htmlUrl = "https://ozensemble.fabrique.social.gouv.fr/files/privacy_policy_app.html";
import { PRIVACY_POLICY_URL } from "../../reference/urls";

const PrivacyPolicy = ({ onClose }) => (
<View className="flex-1 justify-start items-center mt-6">
<View
className="flex flex-row w-full mb-4"
style={{ paddingHorizontal: defaultPaddingFontScale() }}>
<View className="flex flex-row w-full mb-4" style={{ paddingHorizontal: defaultPaddingFontScale() }}>
<BackButton onPress={onClose} />
</View>
<WebViewContainer>
<WebView
source={{
uri: htmlUrl,
uri: PRIVACY_POLICY_URL,
}}
/>
</WebViewContainer>
Expand Down
43 changes: 22 additions & 21 deletions expo/src/services/shareApp.js
Original file line number Diff line number Diff line change
@@ -1,52 +1,53 @@
import { Share, Platform } from 'react-native';
import { logEvent } from './logEventsWithMatomo';
import { capture } from './sentry';
import API from './api';
import { storage } from './storage';
import { Share, Platform } from "react-native";
import { logEvent } from "./logEventsWithMatomo";
import { capture } from "./sentry";
import API from "./api";
import { storage } from "./storage";
import { OZ_LANDING_PAGE } from "../reference/urls";

export const shareApp = async () => {
const url = 'https://ozensemble.fabrique.social.gouv.fr/';
const url = OZ_LANDING_PAGE;
try {
logEvent({
category: 'SHARE_APP',
action: 'PRESSED',
category: "SHARE_APP",
action: "PRESSED",
});
const result = await Share.share({
message:
"Bonjour, je te recommande l'application gratuite et totalement anonyme Oz Ensemble qui aide à maitriser sa consommation d'alcool. Bonne découverte !" +
(Platform.OS === 'android' ? '\n' + url : ''),
url: Platform.OS === 'ios' && url,
(Platform.OS === "android" ? "\n" + url : ""),
url: Platform.OS === "ios" && url,
});
if (result?.action === Share.sharedAction) {
API.post({
path: '/badge/shares',
path: "/badge/shares",
body: {
matomoId: storage.getString('@UserIdv2'),
matomoId: storage.getString("@UserIdv2"),
},
});
if (result?.activityType) {
logEvent({
category: 'SHARE_APP',
action: 'SHARED',
category: "SHARE_APP",
action: "SHARED",
name: result?.activityType,
});
} else {
logEvent({
category: 'SHARE_APP',
action: 'SHARED',
category: "SHARE_APP",
action: "SHARED",
});
}
} else if (result.action === Share.dismissedAction) {
logEvent({
category: 'SHARE_APP',
action: 'DISMISSED',
category: "SHARE_APP",
action: "DISMISSED",
});
}
} catch (error) {
capture('share app failure ' + error);
capture("share app failure " + error);
logEvent({
category: 'SHARE_APP',
action: 'ERROR',
category: "SHARE_APP",
action: "ERROR",
});
}
};

0 comments on commit aa93538

Please sign in to comment.