Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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