From ad155a00a61404e1fb291ad5f7df6e271da59aaa Mon Sep 17 00:00:00 2001 From: Benjamin Guedj Date: Mon, 15 Jan 2024 17:10:57 +0100 Subject: [PATCH] =?UTF-8?q?fix:=20=F0=9F=90=9B=20Corrige=20la=20redirectio?= =?UTF-8?q?n=20vers=20les=20articles=20depuis=20les=20tnd?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- front/src/navigation/BottomTabNavigator.tsx | 2 + .../tndSurvey/tndSurveyResult.component.tsx | 66 ++----------------- 2 files changed, 7 insertions(+), 61 deletions(-) diff --git a/front/src/navigation/BottomTabNavigator.tsx b/front/src/navigation/BottomTabNavigator.tsx index 977b7c601..00618a034 100644 --- a/front/src/navigation/BottomTabNavigator.tsx +++ b/front/src/navigation/BottomTabNavigator.tsx @@ -162,6 +162,8 @@ const TabSurveysNavigator: FC = () => ( options={{}} /> + + ); diff --git a/front/src/screens/tndSurvey/tndSurveyResult.component.tsx b/front/src/screens/tndSurvey/tndSurveyResult.component.tsx index 6fbd40d4a..e78143ca4 100644 --- a/front/src/screens/tndSurvey/tndSurveyResult.component.tsx +++ b/front/src/screens/tndSurvey/tndSurveyResult.component.tsx @@ -8,13 +8,8 @@ import HTML from "react-native-render-html"; import WebView from "react-native-webview"; import ImgBtnReview from "../../assets/images/btn-review-sp-plus.svg"; -import { ArticleList } from "../../components"; -import { - CommonText, - SecondaryTextItalic, - TitleH1, - View, -} from "../../components/baseComponents"; +import { ArticleCard } from "../../components"; +import { CommonText, TitleH1, View } from "../../components/baseComponents"; import { FetchPoliciesConstants, HomeDbQueries, @@ -27,58 +22,8 @@ import { GraphQLMutation, GraphQLQuery } from "../../services"; import { Colors, FontWeight, Margins, Paddings, Sizes } from "../../styles"; import type { SurveyQuestionAndAnswers } from "../../type"; import type { TndAnswers, TndQuestionnaire } from "../../type/tndSurvey.types"; -import type { Article, Step } from "../../types"; +import type { Article } from "../../types"; import { LinkingUtils, TndSurveyUtils } from "../../utils"; -import ArticleDetail from "../articles/articleDetail.component"; - -export const ArticlesRoute = ( - updatedText: string, - articles: Article[] -): React.ReactElement => { - const [showArticle, setShowArticle] = useState(false); - const [currentArticleId, setCurrentArticleId] = useState(0); - const [currentArticleStep, setCurrentArticleStep] = useState< - Step | undefined - >(); - - const onBackButtonPressed = useCallback(() => { - setShowArticle(false); - }, []); - - const onUpdateStepAndArticleId = useCallback( - (articleId: number, step: Step | undefined) => { - setShowArticle(true); - setCurrentArticleId(articleId); - setCurrentArticleStep(step); - }, - [] - ); - - if (articles.length <= 0) { - return ( - - {updatedText} - - ); - } - - return showArticle ? ( - - ) : ( - - - - ); -}; interface Props { result: number; @@ -173,7 +118,7 @@ const TndSurveyResult: FC = ({ survey, tndQuestionnaire }) => { {Labels.tndSurvey.surveyResult.articlesToRead} - {/* {handicapArticles.map((article, index) => ( + {handicapArticles.map((article, index) => ( = ({ survey, tndQuestionnaire }) => { isFromTndScreen={true} /> - ))} */} - {ArticlesRoute("", handicapArticles)} + ))} )}