Commit e65a7da8 authored by Adrien Risser's avatar Adrien Risser
Browse files

Revert "feat: parenthèque (#677)"

This reverts commit bce73e0f.

Conflicts:
	front/package.json
parent 6eef2025
This source diff could not be displayed because it is too large. You can view the blob instead.
<svg width="32" height="39" viewBox="0 0 32 39" fill="none" xmlns="http://www.w3.org/2000/svg">
<path fill-rule="evenodd" clip-rule="evenodd" d="M18.1464 4.64645C18.3417 4.45118 18.6583 4.45118 18.8536 4.64645L26.3536 12.1464C26.5488 12.3417 26.5488 12.6583 26.3536 12.8536C26.1583 13.0488 25.8417 13.0488 25.6464 12.8536L18.1464 5.35355C17.9512 5.15829 17.9512 4.84171 18.1464 4.64645Z" fill="#5770BE"/>
<path fill-rule="evenodd" clip-rule="evenodd" d="M3.71698 18.5233C3.71698 18.2472 3.94084 18.0233 4.21698 18.0233H23.2736C23.5497 18.0233 23.7736 18.2472 23.7736 18.5233C23.7736 18.7994 23.5497 19.0233 23.2736 19.0233H4.21698C3.94084 19.0233 3.71698 18.7994 3.71698 18.5233ZM3.71698 22.5596C3.71698 22.2834 3.94084 22.0596 4.21698 22.0596H23.2736C23.5497 22.0596 23.7736 22.2834 23.7736 22.5596C23.7736 22.8357 23.5497 23.0596 23.2736 23.0596H4.21698C3.94084 23.0596 3.71698 22.8357 3.71698 22.5596ZM3.71698 26.6943C3.71698 26.4181 3.94084 26.1943 4.21698 26.1943H23.2736C23.5497 26.1943 23.7736 26.4181 23.7736 26.6943C23.7736 26.9704 23.5497 27.1943 23.2736 27.1943H4.21698C3.94084 27.1943 3.71698 26.9704 3.71698 26.6943ZM3.71698 30.6321C3.71698 30.356 3.94084 30.1321 4.21698 30.1321H23.2736C23.5497 30.1321 23.7736 30.356 23.7736 30.6321C23.7736 30.9083 23.5497 31.1321 23.2736 31.1321H4.21698C3.94084 31.1321 3.71698 30.9083 3.71698 30.6321ZM3.71698 34.6684C3.71698 34.3922 3.94084 34.1684 4.21698 34.1684H23.2736C23.5497 34.1684 23.7736 34.3922 23.7736 34.6684C23.7736 34.9445 23.5497 35.1684 23.2736 35.1684H4.21698C3.94084 35.1684 3.71698 34.9445 3.71698 34.6684ZM3 38H24.6855C25.7901 38 26.6855 37.1046 26.6855 36V14.1243C26.6855 13.5721 26.2378 13.1243 25.6855 13.1243H20.0094C18.9049 13.1243 18.0094 12.2289 18.0094 11.1243V5.55957C18.0094 5.00728 17.5617 4.55957 17.0094 4.55957H3C1.89543 4.55957 1 5.455 1 6.55957V36C1 37.1046 1.89543 38 3 38ZM3 3.55957C1.34315 3.55957 0 4.90272 0 6.55957V36C0 37.6568 1.34315 39 3 39H24.6855C26.3424 39 27.6855 37.6568 27.6855 36V14.1243C27.6855 13.0198 26.7901 12.1243 25.6855 12.1243H20.0094C19.4572 12.1243 19.0094 11.6766 19.0094 11.1243V5.55957C19.0094 4.455 18.114 3.55957 17.0094 3.55957H3Z" fill="#5770BE"/>
<path fill-rule="evenodd" clip-rule="evenodd" d="M3.20435 3.75648C3.20435 1.95797 4.66232 0.5 6.46082 0.5H27.9999C29.9329 0.5 31.4999 2.067 31.4999 4V32.6528C31.4999 34.5858 29.9329 36.1529 27.9999 36.1529H27.6855V35.1529H27.9999C29.3807 35.1529 30.4999 34.0336 30.4999 32.6528V4C30.4999 2.61929 29.3807 1.5 27.9999 1.5H6.46082C5.2146 1.5 4.20435 2.51026 4.20435 3.75648H3.20435Z" fill="#5770BE"/>
</svg>
\ No newline at end of file
......@@ -58,7 +58,6 @@ export enum IcomoonIcons {
mentionsLegales = "mentions-legales",
politiquesConfidentialite = "politiques-confidentialite",
glossaire = "glossaire",
stepParentheque = "step-parentheque",
stepProjetParent = "step-projet-parent",
stepConception = "step-conception",
stepDebutDeGrossesse = "step-debut-de-grossesse",
......
import type { FC } from "react";
import * as React from "react";
import { Linking, StyleSheet } from "react-native";
import { ListItem } from "react-native-elements";
import {
Colors,
FontWeight,
Labels,
Margins,
Paddings,
Sizes,
} from "../../constants";
import type { Document } from "../../types";
import { reportError } from "../../utils/logging.util";
import { Button, IcomoonIcons, View } from "..";
import { CommonText, SecondaryText } from "../StyledText";
import StepIconLibrary from "../timeline/stepIconLibrary.component";
interface Props {
document: Document;
}
function openFile(url: string) {
Linking.openURL(url).catch((err: unknown) => {
reportError(err);
});
}
const DocumentCard: FC<Props> = ({ document }) => (
<ListItem
bottomDivider
pad={0}
containerStyle={[styles.listItemContainer, styles.borderLeftRadius]}
style={[styles.listItem, styles.borderLeftRadius]}
>
<View style={styles.documentImage}>
<StepIconLibrary name={IcomoonIcons.stepParentheque} />
</View>
<ListItem.Content style={styles.documentContent}>
<ListItem.Title style={styles.documentTitleContainer}>
<CommonText style={styles.documentTitle}>{document.nom}</CommonText>
</ListItem.Title>
<ListItem.Subtitle style={styles.documentDescription}>
<SecondaryText
style={styles.documentDescriptionFont}
numberOfLines={3}
allowFontScaling={true}
>
{document.description}
</SecondaryText>
</ListItem.Subtitle>
<View style={styles.contentButton}>
<Button
title={Labels.timeline.library.download}
titleStyle={styles.fontButton}
rounded={true}
disabled={false}
action={() => {
openFile(document.fichier.url);
}}
/>
</View>
</ListItem.Content>
</ListItem>
);
const styles = StyleSheet.create({
borderLeftRadius: {
borderBottomLeftRadius: Sizes.xxxxxs,
borderTopLeftRadius: Sizes.xxxxxs,
},
contentButton: {
alignSelf: "flex-end",
marginTop: Margins.smaller,
},
documentContent: {
justifyContent: "center",
padding: Paddings.default,
},
documentDescription: {
color: Colors.commonText,
},
documentDescriptionFont: {
color: Colors.commonText,
fontSize: Sizes.sm,
fontWeight: FontWeight.medium,
lineHeight: Sizes.lg,
},
documentImage: {
marginStart: Margins.smaller,
},
documentTitle: {
color: Colors.primaryBlueDark,
fontSize: Sizes.md,
fontWeight: FontWeight.bold,
},
documentTitleContainer: {
paddingBottom: Paddings.light,
},
fontButton: {
fontSize: Sizes.xxs,
textTransform: "uppercase",
},
listItem: {
marginVertical: Margins.smallest,
},
listItemContainer: {
borderColor: Colors.borderGrey,
borderWidth: 1,
padding: 0,
},
});
export default DocumentCard;
import type { FC } from "react";
import * as React from "react";
import { Colors, Sizes } from "../../constants";
import Icomoon from "../base/icomoon.component";
interface Props {
name: string;
}
const StepIconLibrary: FC<Props> = ({ name }) => (
<Icomoon name={name} color={Colors.primaryBlue} size={Sizes.xxxxl} />
);
export default StepIconLibrary;
import type { FC } from "react";
import * as React from "react";
import { StyleSheet } from "react-native";
import { Button as RNEButton } from "react-native-elements";
import type { IconNode } from "react-native-elements/dist/icons/Icon";
import { FontWeight, Margins, Paddings, Sizes } from "../../constants";
import Colors from "../../constants/Colors";
import { IcomoonIcons } from "../base/icomoon.component";
import { CommonText, SecondaryText } from "../StyledText";
import { View } from "../Themed";
import StepIconLibrary from "./stepIconLibrary.component";
interface TimelineStepLibraryProps {
order: number;
name: string;
onPress: () => void;
}
const initialOffset = Paddings.light;
const verticalOffset = Paddings.stepOffset;
const TimelineStepLibrary: FC<TimelineStepLibraryProps> = ({
order,
name,
onPress,
}) => {
const stepIcons: IconNode[] = [
<StepIconLibrary name={IcomoonIcons.stepParentheque} />,
];
const getStepStyles = () => [
styles.step,
{ marginTop: initialOffset - verticalOffset / 2 },
styles.stepRight,
];
const getStepNumStyles = () => [styles.stepNum, styles.stepNumRight];
return (
<View style={getStepStyles()}>
<View style={[styles.stepIconContainer]}>
<RNEButton
icon={stepIcons[order]}
onPress={onPress}
buttonStyle={[
styles.stepIconButtonLibrary,
styles.justifyContentCenter,
]}
type="clear"
/>
</View>
<View style={[styles.stepTitleContainer]}>
<CommonText style={[styles.stepTitle]}>{name}</CommonText>
<SecondaryText style={getStepNumStyles()}>{order}</SecondaryText>
</View>
</View>
);
};
const sizeOfStepNum = Sizes.xxxxxl;
const styles = StyleSheet.create({
justifyContentCenter: {
alignItems: "center",
justifyContent: "center",
},
step: {
alignItems: "center",
backgroundColor: "transparent",
flex: 1,
height: Sizes.step,
position: "absolute",
},
stepIconButtonLibrary: {
backgroundColor: "white",
borderColor: Colors.primaryBlue,
borderRadius: Sizes.step / 2,
borderWidth: 1,
height: Sizes.step,
width: Sizes.step,
},
stepIconContainer: {
backgroundColor: "white",
},
stepNum: {
color: Colors.primaryBlueLight,
fontSize: sizeOfStepNum,
fontWeight: FontWeight.bold,
paddingHorizontal: Paddings.smallest,
position: "absolute",
zIndex: -1,
},
stepNumRight: {
left: 0,
},
stepRight: {
flexDirection: "row-reverse",
right: 0,
textAlign: "right",
},
stepTitle: {
color: Colors.primaryBlueDark,
fontSize: Sizes.xxs,
},
stepTitleContainer: {
alignSelf: "center",
backgroundColor: "transparent",
height: sizeOfStepNum,
justifyContent: "center",
marginBottom: Margins.step,
paddingLeft: Paddings.default,
paddingRight: Paddings.light,
position: "relative",
},
});
export default TimelineStepLibrary;
......@@ -447,13 +447,7 @@ export default {
},
timeline: {
description:
"Choisissez dans le parcours ci-dessous l’étape qui vous concerne ou vous intéresse. A chaque étape correspond des informations, recommandations et outils spécifiques pour mieux vous guider et vous accompagner.",
library: {
description:
"Texte descriptif quii explique qu'il sagit des documents utiles durant le parcours des 1000 premiers jours.",
download: "Télécharger",
nom: "Parenthèque",
},
"Choisissez dans le parcours ci-dessous l’étape qui vous concerne ou vous intéresse. À chaque étape correspond des informations, recommandations et outils spécifiques pour mieux vous guider et vous accompagner.",
notification: {
body: "Vous entrez dans une nouvelle étape du parcours 1000 jours : ",
redirectTitle: "Modifier ma situation",
......
......@@ -145,16 +145,3 @@ export const CARTO_SEND_SUGGESTIONS = gql`
)
}
`;
export const PARENTS_DOCUMENTS = gql`
query GetParenthequeDocuments {
parenthequeDocuments {
id
nom
description
fichier {
url
}
}
}
`;
......@@ -11,7 +11,6 @@ import {
EpdsSurveyScreen,
EventDetails,
ListArticles,
ListParentsDocuments,
TabAroundMeScreen,
TabCalendarScreen,
TabHomeScreen,
......@@ -123,10 +122,6 @@ const TabHomeNavigator: FC = () => (
options={{}}
/>
<TabHomeStack.Screen name="listArticles" component={ListArticles} />
<TabHomeStack.Screen
name="listParentsDocuments"
component={ListParentsDocuments}
/>
<TabHomeStack.Screen name="article" component={ArticleDetail} />
<TabHomeStack.Screen name="epdsSurvey" component={EpdsSurveyScreen} />
</TabHomeStack.Navigator>
......
......@@ -45,8 +45,6 @@
"expo-cli": "^4.11.0",
"expo-constants": "~10.1.3",
"expo-device": "~3.2.0",
"expo-fast-image": "^1.1.3",
"expo-file-system": "~11.0.2",
"expo-font": "~9.1.0",
"expo-linking": "~2.2.3",
"expo-localization": "~10.1.0",
......@@ -70,6 +68,7 @@
"react-native-maps": "0.27.1",
"react-native-paper": "^4.9.2",
"react-native-reanimated": "~2.1.0",
"react-native-safe-area-context": "3.2.0",
"react-native-render-html": "^6.1.0",
"react-native-screens": "~3.0.0",
"react-native-svg": "<=12.1.0",
......
......@@ -17,7 +17,6 @@ import {
TitleH1,
View,
} from "../components";
import TimelineStepLibrary from "../components/timeline/timelineStepLibrary.component";
import {
FetchPoliciesConstants,
Paddings,
......@@ -36,7 +35,7 @@ import { getCurrentStepId } from "../utils/step.util";
import { stringIsNotNullNorEmpty } from "../utils/strings.util";
interface Props {
navigation: StackNavigationProp<TabHomeParamList>;
navigation: StackNavigationProp<TabHomeParamList, "listArticles">;
}
const TabHomeScreen: FC<Props> = ({ navigation }) => {
......@@ -145,16 +144,6 @@ const TabHomeScreen: FC<Props> = ({ navigation }) => {
}
}
const stepParentheque: Step = {
active: null,
debut: null,
description: Labels.timeline.library.description,
fin: null,
id: "0",
nom: Labels.timeline.library.nom,
ordre: 0,
};
return (
<ScrollView style={[styles.mainContainer]} ref={scrollViewRef}>
<TitleH1
......@@ -162,34 +151,6 @@ const TabHomeScreen: FC<Props> = ({ navigation }) => {
description={Labels.timeline.description}
animated={false}
/>
<View
style={[
styles.timelineStepContainer,
styles.timelineStepLibraryContainer,
]}
>
<View style={[styles.timelineContainer]}>
<View
style={[
styles.timelineBlock,
styles.timelineLibraryBlock,
styles.timelineBlockLeft,
]}
/>
</View>
{[stepParentheque].map((step, index) => (
<TimelineStepLibrary
order={step.ordre}
name={step.nom}
key={index}
onPress={() => {
navigation.navigate("listParentsDocuments", { step });
}}
/>
))}
</View>
<View style={[styles.timelineStepContainer]}>
<View style={[styles.timelineContainer]}>
<View
......@@ -274,19 +235,10 @@ const styles = StyleSheet.create({
flex: 1,
flexDirection: "column",
},
timelineLibraryBlock: {
borderBottomWidth: 0,
borderColor: Colors.primaryBlue,
borderStyle: "solid",
borderTopWidth: 1,
},
timelineStepContainer: {
marginBottom: Sizes.step,
marginLeft: "5%",
marginRight: "5%",
},
timelineStepLibraryContainer: {
marginBottom: 0,
marginTop: Sizes.step,
},
});
......
......@@ -5,7 +5,6 @@ import ArticleDetail from "./ArticleDetail";
import EpdsSurveyScreen from "./epdsSurvey/epdsSurveyScreen.component";
import EventDetails from "./event/eventDetails.component";
import ListArticles from "./listArticles.component";
import ListParentsDocuments from "./listParentsDocuments.component";
import TabCalendarScreen from "./TabCalendarScreen";
import TabFavoritesScreen from "./TabFavoritesScreen";
import TabHomeScreen from "./TabHomeScreen";
......@@ -17,7 +16,6 @@ export {
EventDetails,
LegalNotice,
ListArticles,
ListParentsDocuments,
TabAroundMeScreen,
TabCalendarScreen,
TabFavoritesScreen,
......
import { useQuery } from "@apollo/client";
import type { RouteProp } from "@react-navigation/core";
import type { StackNavigationProp } from "@react-navigation/stack";
import _ from "lodash";
import type { FC } from "react";
import * as React from "react";
import { useEffect } from "react";
import { ScrollView, StyleSheet } from "react-native";
import * as Animatable from "react-native-animatable";
import { BackButton, ErrorMessage, Loader, TitleH1, View } from "../components";
import DocumentCard from "../components/document/documentCard.component";
import {
Colors,
FetchPoliciesConstants,
FontWeight,
Paddings,
Sizes,
} from "../constants";
import { PARENTS_DOCUMENTS } from "../constants/databaseQueries.constants";
import type { Document, Step, TabHomeParamList } from "../types";
interface Props {
navigation: StackNavigationProp<TabHomeParamList>;
route: RouteProp<{ params: { step: Step } }, "params">;
}
const ListParentsDocuments: FC<Props> = ({ navigation, route }) => {
const screenTitle = route.params.step.nom;
const description = route.params.step.description;
const [documents, setDocuments] = React.useState<Document[]>([]);
const [showDocuments, setShowDocuments] = React.useState(false);
const { loading, error, data } = useQuery(PARENTS_DOCUMENTS, {
fetchPolicy: FetchPoliciesConstants.CACHE_AND_NETWORK,
});
useEffect(() => {
if (!loading && data) setShowDocuments(true);
}, [documents]);
useEffect(() => {
if (!loading && data) {
const results = (data as { parenthequeDocuments: Document[] })
.parenthequeDocuments;
setDocuments(results);
}
}, [loading, data]);
if (error) return <ErrorMessage error={error} />;
return (
<ScrollView style={styles.scrollView}>
<View style={styles.topContainer}>
<View style={[styles.flexStart]}>
<BackButton
action={() => {
navigation.goBack();
}}
/>
</View>
<TitleH1
title={screenTitle}
description={description}
animated={false}
/>
</View>
{showDocuments ? (
<View style={styles.listContainer}>
{documents.map((document, index) => (
<Animatable.View
key={index}
animation="fadeInUp"
duration={1000}
delay={0}
>
<DocumentCard document={document} index={index} />
</Animatable.View>
))}
</View>
) : (
<Loader />
)}
</ScrollView>
);
};
const styles = StyleSheet.create({
description: {
color: Colors.commonText,
},
flexStart: {
alignItems: "flex-start",
flexDirection: "row",
flexWrap: "wrap",
},
listContainer: {
paddingHorizontal: Paddings.default,
paddingVertical: Paddings.smallest,
},
scrollView: {
backgroundColor: Colors.white,
},
title: {
color: Colors.primaryBlueDark,
fontSize: Sizes.md,
fontWeight: FontWeight.black,
textTransform: "uppercase",
},
topContainer: {
paddingHorizontal: Paddings.default,
paddingTop: Paddings.default,
},
});
export default ListParentsDocuments;
......@@ -21,7 +21,6 @@ export type BottomTabParamList = {
export type TabHomeParamList = {
tabHomeScreen: undefined;
listArticles: { step: Step };
listParentsDocuments: { step: Step };
article: { id: number; step?: Step };
epdsSurvey: undefined;
};
......@@ -170,12 +169,3 @@ export type Tag = {
color: string;
bgColor: string;
};
export type Document = {
id: number;
nom: string;
description: string;
url: string;
thematique: Thematique;
etapes?: Step[];
};
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment