Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TaskId #0000 task:implemted popup message for demo version for milestone level 5 #163

Open
wants to merge 6 commits into
base: all-saas-prod
Choose a base branch
from
21 changes: 18 additions & 3 deletions src/config/config.js
Original file line number Diff line number Diff line change
@@ -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/",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is this URL for?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

from beginning it s the same

};

export const POPUP_TEXT_CONSTANT = {
DEMO_MAX_MILESTONE_POPUP_TEXT: (
<>
You have reached the final milestone for the demo. To explore additional
levels, please{" "}
<a
href={`mailto:${process.env.REACT_APP_DEMO_POPUP_TEXT_SUPPORT_EMAIL_ID}`}
>
click here
</a>{" "}
to contact the ALL support team.
</>
),
};
11 changes: 10 additions & 1 deletion src/views/Practice/Practice.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -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("");
Expand Down Expand Up @@ -61,7 +62,6 @@ const Practice = () => {
const meetsFluencyCriteria = livesData?.meetsFluencyCriteria;
setGameOverData({ gameOver: true, userWon, ...data, meetsFluencyCriteria });
};

useEffect(() => {
if (startShowCase) {
setLivesData({ ...livesData, lives: LIVES });
Expand Down Expand Up @@ -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(
Expand Down