diff --git a/src/config/config.js b/src/config/config.js index eef004b3..594f45de 100644 --- a/src/config/config.js +++ b/src/config/config.js @@ -1,10 +1,25 @@ /* Constants to be used across the app */ export const APP_CONSTANTS = { - APP_TITLE: 'Consuli', - PAGE_NOT_FOUND: 'Page Not found', + APP_TITLE: "Consuli", + PAGE_NOT_FOUND: "Page Not found", }; export const API_CONSTANTS = { - API_URL: 'http://localhost:3001/', + API_URL: "http://localhost:3001/", +}; + +export const POPUP_TEXT_CONSTANT = { + DEMO_MAX_MILESTONE_POPUP_TEXT: ( + <> + You have reached the final milestone for the demo. To explore additional + levels, please{" "} + + click here + {" "} + to contact the ALL support team. + + ), }; diff --git a/src/views/Practice/Practice.jsx b/src/views/Practice/Practice.jsx index 338039aa..1d574270 100644 --- a/src/views/Practice/Practice.jsx +++ b/src/views/Practice/Practice.jsx @@ -21,6 +21,7 @@ import { Typography } from "@mui/material"; import config from "../../utils/urlConstants.json"; import { MessageDialog } from "../../components/Assesment/Assesment"; import { Log } from "../../services/telementryService"; +import { POPUP_TEXT_CONSTANT } from "../../config/config"; const Practice = () => { const [page, setPage] = useState(""); @@ -61,7 +62,6 @@ const Practice = () => { const meetsFluencyCriteria = livesData?.meetsFluencyCriteria; setGameOverData({ gameOver: true, userWon, ...data, meetsFluencyCriteria }); }; - useEffect(() => { if (startShowCase) { setLivesData({ ...livesData, lives: LIVES }); @@ -248,6 +248,15 @@ const Practice = () => { ); } setLocalData("previous_level", getSetData.data.previous_level); + if ( + getSetData?.data?.previous_level === + process.env.REACT_APP_DEMO_MAX_MILESTONE_LEVEL + ) { + setOpenMessageDialog({ + message: POPUP_TEXT_CONSTANT.DEMO_MAX_MILESTONE_POPUP_TEXT, + dontShowHeader: true, + }); + } if (getSetData.data.sessionResult === "pass") { try { await axios.post(