From 2f7f9dcf4e3909758fd1a141280a6e29931fcb64 Mon Sep 17 00:00:00 2001 From: HAUTBOIS Aurelie <aurelie.hautbois@ext.soprasteria.com> Date: Wed, 13 Jan 2021 09:48:34 +0100 Subject: [PATCH] feat: modify exploration view --- .../Exploration/ExplorationView.tsx | 19 +++++++++++-------- src/locales/fr.json | 1 + 2 files changed, 12 insertions(+), 8 deletions(-) diff --git a/src/components/Exploration/ExplorationView.tsx b/src/components/Exploration/ExplorationView.tsx index 06f64160e..865a07c49 100644 --- a/src/components/Exploration/ExplorationView.tsx +++ b/src/components/Exploration/ExplorationView.tsx @@ -4,7 +4,7 @@ import { AppStore } from 'store' import CozyBar from 'components/Header/CozyBar' import Content from 'components/Content/Content' import Header from 'components/Header/Header' -import { UserMissionState } from 'enum/userMission.enum' +import { UserExplorationState } from 'enum/userExploration.enum' import { UserChallenge } from 'models' const ExplorationView: React.FC = () => { @@ -17,11 +17,11 @@ const ExplorationView: React.FC = () => { setHeaderHeight(height) }, []) - const renderMission = (challenge: UserChallenge) => { - switch (challenge.mission.state) { - case UserMissionState.UNLOCKED: + const renderExploration = (challenge: UserChallenge) => { + switch (challenge.exploration.state) { + case UserExplorationState.UNLOCKED: return 'ExplorationOngoing' - case UserMissionState.DONE: + case UserExplorationState.DONE: return 'ExplorationFinished' default: return 'ExplorationOnGoing' @@ -30,14 +30,17 @@ const ExplorationView: React.FC = () => { return ( <> - <CozyBar titleKey={'COMMON.APP_QUIZ_TITLE'} displayBackArrow={true} /> + <CozyBar + titleKey={'COMMON.APP_EXPLORATION_TITLE'} + displayBackArrow={true} + /> <Header setHeaderHeight={defineHeaderHeight} - desktopTitleKey={'COMMON.APP_QUIZ_TITLE'} + desktopTitleKey={'COMMON.APP_EXPLORATION_TITLE'} displayBackArrow={true} ></Header> <Content height={headerHeight}> - {currentChallenge && renderMission(currentChallenge)} + {currentChallenge && renderExploration(currentChallenge)} </Content> </> ) diff --git a/src/locales/fr.json b/src/locales/fr.json index 3fc13327b..a65282872 100644 --- a/src/locales/fr.json +++ b/src/locales/fr.json @@ -22,6 +22,7 @@ "APP_TITLE": "Ecolyo", "APP_CHALLENGE_TITLE": "Défi", "APP_QUIZ_TITLE": "Quiz", + "APP_EXPLORATION_TITLE": "Exploration", "APP_DUEL_TITLE": "Duel final", "APP_ECO_GESTURE_TITLE": "Ecogestes", "APP_OPTIONS_TITLE": "Options", -- GitLab