Skip to content

Commit

Permalink
fix: craving recette (#572)
Browse files Browse the repository at this point in the history
  • Loading branch information
YoanRos authored May 1, 2024
1 parent ea38f8d commit 5c83482
Show file tree
Hide file tree
Showing 52 changed files with 5,805 additions and 711 deletions.
2 changes: 1 addition & 1 deletion api/src/controllers/appMilestone.js
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ router.post(
content:
"Oz vous propose des conseils et activités afin de vous accompagner face à un craving (une envie irrépressible de consommer). \n Nous vous proposons des conseils, des exercices de respiration ou encore une sélection de vidéos afin de surmonter ces moments difficiles à gérer.",
CTATitle: "Découvrir",
CTANavigation: ["HEALTH", { screen: "CRAVING_INDEX" }],
CTANavigation: ["CRAVING"],
CTAEvent: {
category: "CRAVING",
action: "PRESSED_FROM_NEW_FEATURE_MODAL",
Expand Down
4 changes: 2 additions & 2 deletions app/android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -99,8 +99,8 @@ android {
minSdkVersion rootProject.ext.minSdkVersion
targetSdkVersion rootProject.ext.targetSdkVersion
multiDexEnabled true
versionCode 258
versionName "1.23.9"
versionCode 260
versionName "1.24.0"
}

signingConfigs {
Expand Down
4 changes: 2 additions & 2 deletions app/app.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
"name": "oz_ensemble",
"displayName": "Oz Ensemble",
"version": {
"buildNumber": 258,
"buildName": "1.23.9"
"buildNumber": 260,
"buildName": "1.24.0"

}
}
8 changes: 4 additions & 4 deletions app/ios/oz_ensemble.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -506,7 +506,7 @@
CODE_SIGN_ENTITLEMENTS = oz_ensemble/oz_ensemble.entitlements;
CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 258;
CURRENT_PROJECT_VERSION = 260;
DEVELOPMENT_TEAM = 76GBKHVK25;
ENABLE_BITCODE = NO;
INFOPLIST_FILE = oz_ensemble/Info.plist;
Expand All @@ -515,7 +515,7 @@
"$(inherited)",
"@executable_path/Frameworks",
);
MARKETING_VERSION = 1.23.9;
MARKETING_VERSION = 1.24.0;
OTHER_LDFLAGS = (
"$(inherited)",
"-ObjC",
Expand All @@ -540,7 +540,7 @@
CODE_SIGN_IDENTITY = "Apple Development";
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Distribution";
CODE_SIGN_STYLE = Manual;
CURRENT_PROJECT_VERSION = 258;
CURRENT_PROJECT_VERSION = 260;
DEVELOPMENT_TEAM = "";
"DEVELOPMENT_TEAM[sdk=iphoneos*]" = 76GBKHVK25;
INFOPLIST_FILE = oz_ensemble/Info.plist;
Expand All @@ -549,7 +549,7 @@
"$(inherited)",
"@executable_path/Frameworks",
);
MARKETING_VERSION = 1.23.9;
MARKETING_VERSION = 1.24.0;
OTHER_LDFLAGS = (
"$(inherited)",
"-ObjC",
Expand Down
2 changes: 1 addition & 1 deletion app/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "oz_ensemble",
"version": "1.23.9",
"version": "1.24.0",
"private": true,
"scripts": {
"get-ip": "./get-ip.sh && echo \"this script updates the API IP to your own IP, because that's what Android Emulator needs to work. It's based on your wifi IP, if you need ethernet it won't work (needs en1 instead of en0)\"",
Expand Down
13 changes: 7 additions & 6 deletions app/src/Router.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import { useRecoilValue } from 'recoil';
import RNBootSplash from 'react-native-bootsplash';
import { enableScreens } from 'react-native-screens';
import { createNativeStackNavigator } from '@react-navigation/native-stack';
import Activities from './components/illustrations/Activities';
import FollowUpIcon from './components/illustrations/FollowUpIcon';
import GuidanceIcon from './components/illustrations/GuidanceIcon';
import InfosIcon from './components/illustrations/Infos';
Expand All @@ -25,7 +24,7 @@ import TextStyled from './components/TextStyled';
import CustomBootsplash, { showBootSplashState } from './components/CustomBootsplash';
import CalendarIcon from './components/illustrations/CalendarIcon';
import API from './services/api';
import DefisNavigator from './scenes/Defis/DefisNavigator';
import CravingNavigator from './scenes/Craving/CravingNavigator';
import NewFeaturePopupDisplay from './services/NewFeaturePopup';
import { deepLinkingConfig } from './services/deepLink';
import EnvironmentIndicator from './components/EnvironmentIndicator';
Expand All @@ -44,6 +43,7 @@ import UserSurvey from './scenes/Quizzs/UserSurvey';
import UserSurveyStart from './scenes/Quizzs/UserSurvey/UserSurveyStart';
import UserSurveyNotif from './scenes/Quizzs/UserSurvey/UserSurveyNotif';
import BadgesList from './scenes/Badges/BadgesList';
import CravingIcon from './components/illustrations/CravingIcon';

const Label = ({ children, focused, color }) => (
<LabelStyled focused={focused} color={color}>
Expand Down Expand Up @@ -85,12 +85,12 @@ const TabsNavigator = ({ navigation }) => {
component={GainsNavigator}
/>
<Tabs.Screen
name="DEFI"
name="CRAVING"
options={{
tabBarLabel: (props) => <Label {...props}>Activités</Label>,
tabBarIcon: ({ size, color }) => <Activities size={size} color={color} />,
tabBarLabel: (props) => <Label {...props}>Craving</Label>,
tabBarIcon: ({ size, color }) => <CravingIcon size={size} color={color} />,
}}
component={DefisNavigator}
component={CravingNavigator}
/>
<Tabs.Screen
name="CONSO_FOLLOW_UP_NAVIGATOR"
Expand Down Expand Up @@ -166,6 +166,7 @@ const Root = () => {
<RootStack.Screen name="GAINS_ESTIMATE_PREVIOUS_CONSUMPTION" component={GainsPreviousConsumption} />
<RootStack.Screen name="GAINS_MY_OBJECTIVE" component={Goal} />
<RootStack.Screen name="GAINS_REMINDER" component={GainsReminder} />

<RootStack.Screen
name="GAINS_SEVRAGE"
component={Sevrage}
Expand Down
Binary file removed app/src/assets/images/AdviceVideosIcon.png
Binary file not shown.
Binary file removed app/src/assets/images/HydratationAdvice.png
Binary file not shown.
Binary file removed app/src/assets/images/MusicAdvice.png
Binary file not shown.
Binary file removed app/src/assets/images/ReadingAdvice.png
Binary file not shown.
Binary file removed app/src/assets/images/ShowerAdvice.png
Binary file not shown.
Binary file removed app/src/assets/images/ThinkVideosIcon.png
Binary file not shown.
Binary file removed app/src/assets/images/WalkAdvice.png
Binary file not shown.
68 changes: 45 additions & 23 deletions app/src/components/ModalCraving.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,14 @@ import Modal from './Modal';
import { hitSlop } from '../styles/theme';
import CravingIcon from './illustrations/CravingIcon';
import ButtonPrimary from './ButtonPrimary';
import TipIcon from './illustrations/TipIcon';
import { ScrollView } from 'react-native-gesture-handler';

const ModalCraving = ({ firstTimeOnCraving, onClose }) => {
return (
<Modal visible={firstTimeOnCraving} animationType="fade" withBackground hideOnTouch>
<View className="bg-white rounded-xl p-2">
<View className="h-5 flex flex-row justify-end">
<Modal visible={firstTimeOnCraving} animationType="fade" withBackground hideOnTouch safeAreaView>
<ScrollView className="h-full p-1 gap-4">
<View className="h-5 flex flex-row justify-end ">
<TouchableOpacity onPress={onClose} hitSlop={hitSlop(15)}>
<Svg fill="none" viewBox="0 0 24 24" className="h-5 w-5">
<Path
Expand All @@ -23,30 +25,50 @@ const ModalCraving = ({ firstTimeOnCraving, onClose }) => {
</Svg>
</TouchableOpacity>
</View>

<View className="mb-4">
<CravingIcon size={70} className="m-auto mb-4 " />
<Text color="#000" className="text-start text-xl font-extrabold text-[#DE285E] mb-4">
M'aider avec mon craving
</Text>
<Text className="text-start text-black text-base">
Vous êtes dans un moment de craving, et nous sommes là pour vous aider !{'\n'}
</Text>
<Text className="text-start text-[#4030A5] font-bold text-base">
Sachez qu’un moment de craving n’est pas eternel, et dure généralement entre 5 et 20 minutes.{'\n'}
<View className="items-center">
<CravingIcon size={70} className="-mt-6" />
</View>
<Text color="#000" className="text-start text-xl font-extrabold text-[#FF0000] ">
M'aider avec mon craving
</Text>
<View className="flex flex-row ">
<TipIcon size={20} className="mt-1 -mr-4 " />
<Text className="text-start text-black text-lg">
{' '}
Vous êtes dans un moment de craving, et nous sommes là pour vous aider !
</Text>
<Text className="text-start text-black text-base">
Le craving peut être intense et difficile à gérer, mais il existe des moyens de le surmonter.
{'\n'}
{'\n'} Oz vous propose divers conseils et activités afin de vous accompagner dans ces moments délicats.
{'\n'}
{'\n'} Cliquez sur “Commencer” pour accéder dès maintenant aux activités !
</View>
<Text className="text-start text-black text-lg">
Le craving est un désir intense de consommer une substance addictive, comme l'alcool.
</Text>
<Text className="text-start text-[#4030A5] font-bold text-lg">
Sachez qu’un moment de craving n’est pas éternel, et dure généralement entre 5 et 20 minutes.
</Text>
<View className="flex flex-col ">
<Text className="text-start text-black text-lg">Oz vous accompagne dans ces moments délicats, avec : </Text>
<Text className="text-start text-black text-lg">
{`\u2022`} des <Text className="font-bold">conseils</Text> rapides, à appliquer immédiatement,
{`\n`} {`\u2022`} des <Text className="font-bold">exercices de respiration</Text>, à adapter selon vos
besoins,
{`\n`}
{`\u2022`} un catalogue varié de <Text className="font-bold">vidéos</Text>, avec plusieurs catégories.
</Text>
</View>
<View className="flex items-center mb-4">
<ButtonPrimary content="Commencer" className="" onPress={onClose} />

<Text className="text-start text-black text-lg">
Cliquez sur “Commencer” pour accéder dès maintenant aux activités !
</Text>

<View className="flex flex-row justify-center mb-2">
<ButtonPrimary
content="Commencer"
onPress={() => {
onClose();
}}
className=""
/>
</View>
</View>
</ScrollView>
</Modal>
);
};
Expand Down
6 changes: 3 additions & 3 deletions app/src/components/VideoPlayer.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,9 @@ const VideoPlayer = ({ route, navigation }) => {
<SafeAreaProvider>
<Background color="#f9f9f9">
<View className="h-full w-screen">
<ScrollView showsVerticalScrollIndicator={false} className="mx-4 mt-3 flex ">
<BackButton content="< Retour" bold onPress={navigation.goBack} marginTop marginBottom />
<Text className="text-[#4030A5] text-3xl font-bold mt-3">{title}</Text>
<ScrollView showsVerticalScrollIndicator={false} className="mx-4 flex ">
<BackButton content="< Retour" bold onPress={navigation.goBack} marginTop />
<Text className="text-[#4030A5] text-2xl font-extrabold mt-3">{title}</Text>
<View className=" justify-between gap-2 items-center mt-8">
{videoIds.map((videoId, index) => (
<YoutubePlayer
Expand Down
4 changes: 2 additions & 2 deletions app/src/components/illustrations/AdviceVideos.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions app/src/components/illustrations/AdvicesICon.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ import styled from 'styled-components';
const StyledSvg = styled(Svg)``;

const AdvicesIcon = ({ size, ...props }) => (
<StyledSvg width={size} height={size} viewBox="0 0 80 80" {...props}>
<Circle cx="40" cy="40" r="38.5" stroke="white" stroke-width="5" fill="none" />
<StyledSvg width={size} height={size} viewBox="0 0 85 85" {...props}>
<Circle cx="40" cy="40" r="38.5" stroke="white" strokeWidth={'3'} fill="none" />
<Path
d="M40 26.25C39.3125 26.25 38.75 25.6875 38.75 25V21.25C38.75 20.5625 39.3125 20 40 20C40.6875 20 41.25 20.5625 41.25 21.25V25C41.25 25.6875 40.6875 26.25 40 26.25Z"
fill="white"
Expand Down
4 changes: 2 additions & 2 deletions app/src/components/illustrations/BreathingIcon.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions app/src/components/illustrations/CravingIcon.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,21 +4,21 @@ import styled from 'styled-components';

const StyledSvg = styled(Svg)``;

const CravingIcon = ({ size, ...props }) => (
const CravingIcon = ({ size, color = '#FF0000', ...props }) => (
<StyledSvg width={size} height={size} viewBox="0 0 80 70" {...props}>
<Path
d="M15.4869 4.5523C16.5284 3.51083 16.5284 1.82243 15.4869 0.7811C14.4456 -0.260367 12.7571 -0.260367 11.7157 0.7811C-3.90524 16.402 -3.90525 41.7286 11.7157 57.3496C12.7571 58.391 14.4456 58.391 15.4869 57.3496C16.5284 56.3082 16.5284 54.6198 15.4869 53.5783C1.94879 40.0402 1.94879 18.0904 15.4869 4.5523Z"
fill="#FF0000"
fill={color}
/>
<Path
d="M68.2842 0.7811C67.2429 -0.260367 65.5544 -0.260367 64.513 0.7811C63.4716 1.82243 63.4716 3.51083 64.513 4.5523C78.0512 18.0904 78.0512 40.0402 64.513 53.5783C63.4716 54.6198 63.4716 56.3082 64.513 57.3496C65.5544 58.391 67.2429 58.391 68.2842 57.3496C83.9052 41.7286 83.9052 16.402 68.2842 0.7811Z"
fill="#FF0000"
fill={color}
/>
<Path
fill-rule="evenodd"
clip-rule="evenodd"
d="M40 1.0647C24.536 1.0647 12 13.6007 12 29.0647C12 44.5286 24.536 57.0647 40 57.0647C55.464 57.0647 68 44.5286 68 29.0647C68 13.6007 55.464 1.0647 40 1.0647ZM40 14.399C41.4728 14.399 42.6667 15.5928 42.6667 17.0656V33.0656C42.6667 34.5384 41.4728 35.7323 40 35.7323C38.5272 35.7323 37.3333 34.5384 37.3333 33.0656V17.0656C37.3333 15.5928 38.5272 14.399 40 14.399ZM42.6667 39.7323C42.6667 41.2051 41.4728 42.399 40 42.399C38.5272 42.399 37.3333 41.2051 37.3333 39.7323C37.3333 38.2595 38.5272 37.0656 40 37.0656C41.4728 37.0656 42.6667 38.2595 42.6667 39.7323Z"
fill="#FF0000"
fill={color}
/>
</StyledSvg>
);
Expand Down
2 changes: 1 addition & 1 deletion app/src/components/illustrations/FunIcon.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 5c83482

Please sign in to comment.