diff --git a/src/components/BreathPage/index.tsx b/src/components/BreathPage/index.tsx index eb1b251..9011173 100644 --- a/src/components/BreathPage/index.tsx +++ b/src/components/BreathPage/index.tsx @@ -12,6 +12,7 @@ import { useNavigate } from "react-router-dom"; import routes from "@/routes"; import parseAPNG from "apng-js"; import Player from "apng-js/types/library/player"; +import { EPathsFromHome } from "@/store/siteConfig"; let apngPlayer: Player | null = null; @@ -116,9 +117,39 @@ function BreathPage(): JSX.Element { useApiCall(createCallback); + const handleCross = () => { + if (homeConfig.pathFromHome === EPathsFromHome.compatibility) { + dispatch( + actions.siteConfig.update({ + home: { + pathFromHome: EPathsFromHome.compatibility, + isShowNavbar: true, + }, + }) + ); + return navigate(routes.client.home()); + } + if (homeConfig.pathFromHome === EPathsFromHome.breath) { + dispatch( + actions.siteConfig.update({ + home: { pathFromHome: EPathsFromHome.breath, isShowNavbar: false }, + }) + ); + return navigate(routes.client.compatibility()); + } + return navigate(routes.client.home()); + }; + return ( <> -
+
+ {!showNavbarFooter && ( +
+ )} - {text !== "Loading..." && ( + {text !== "Loading..." && !showNavbarFooter && (
)}
diff --git a/src/components/Compatibility/DatePicker.tsx b/src/components/Compatibility/DatePicker.tsx index 908782a..2ce5043 100644 --- a/src/components/Compatibility/DatePicker.tsx +++ b/src/components/Compatibility/DatePicker.tsx @@ -18,7 +18,17 @@ const DatePicker: React.FC = ({ getDateAsString(currentDate) ); - const days = Array.from({ length: 31 }, (_, index) => (index + 1).toString()); + const days = Array.from({ length: 93 }, (_, index) => { + + if (index + 1 > 62) { + return (index + 1 - 62).toString(); + } + if (index + 1 > 31) { + return (index + 1 - 31).toString(); + } + return (index + 1).toString() + }); + const months = Array.from({ length: 36 }, (_, index) => new Date(0, index).toLocaleDateString(undefined, { month: "long" }) ); diff --git a/src/components/Compatibility/DatePickerItem.tsx b/src/components/Compatibility/DatePickerItem.tsx index 7479368..9aafa61 100644 --- a/src/components/Compatibility/DatePickerItem.tsx +++ b/src/components/Compatibility/DatePickerItem.tsx @@ -60,6 +60,14 @@ const DatePickerItem: React.FC = ({ setTranslateY((data.indexOf(selectedValue) + 12) * -ITEM_HEIGHT); } } + if (unit === "day") { + if ( + data.indexOf(selectedValue) < 31 || + data.indexOf(selectedValue) > 62 + ) { + setTranslateY((data.indexOf(selectedValue) + 31) * -ITEM_HEIGHT); + } + } }, [unit, data, selectedValue]); const handleTouchEnd = () => { diff --git a/src/components/Compatibility/index.tsx b/src/components/Compatibility/index.tsx index f8a0565..1129db0 100644 --- a/src/components/Compatibility/index.tsx +++ b/src/components/Compatibility/index.tsx @@ -11,6 +11,7 @@ import { useNavigate } from "react-router-dom"; import routes from "@/routes"; import { useDispatch, useSelector } from "react-redux"; import { actions, selectors } from "@/store"; +import { EPathsFromHome } from "@/store/siteConfig"; function CompatibilityPage(): JSX.Element { const { t, i18n } = useTranslation(); @@ -39,6 +40,32 @@ function CompatibilityPage(): JSX.Element { navigate(routes.client.compatibilityResult()); }; + const handleCross = () => { + if (homeConfig.pathFromHome === EPathsFromHome.compatibility) { + dispatch( + actions.siteConfig.update({ + home: { + pathFromHome: EPathsFromHome.compatibility, + isShowNavbar: false, + }, + }) + ); + return navigate(routes.client.breath()); + } + if (homeConfig.pathFromHome === EPathsFromHome.breath) { + dispatch( + actions.siteConfig.update({ + home: { + pathFromHome: EPathsFromHome.compatibility, + isShowNavbar: true, + }, + }) + ); + return navigate(routes.client.home()); + } + return navigate(routes.client.home()); + }; + const api = useApi(); const locale = i18n.language; const loadData = useCallback(() => { @@ -69,8 +96,13 @@ function CompatibilityPage(): JSX.Element { }; return ( -
-
+
+ {!showNavbarFooter && ( +
+ )} {/* {t("compatibility")} */} diff --git a/src/components/StartBreathModalChild/index.tsx b/src/components/StartBreathModalChild/index.tsx index 35fb05d..a069afc 100644 --- a/src/components/StartBreathModalChild/index.tsx +++ b/src/components/StartBreathModalChild/index.tsx @@ -13,7 +13,7 @@ function StartBreathModalChild({ return (
-
+ {/*
*/}
{t("breathe-title") diff --git a/src/components/UserCallbacksPage/index.tsx b/src/components/UserCallbacksPage/index.tsx index 4fa9526..bc89f2f 100644 --- a/src/components/UserCallbacksPage/index.tsx +++ b/src/components/UserCallbacksPage/index.tsx @@ -41,7 +41,7 @@ function UserCallbacksPage(): JSX.Element { className={`${styles.page} page`} style={{ paddingBottom: getPaddingBottomPage() }} > - <div className={styles.cross} onClick={handleNext}></div> + {!showNavbarFooter && <div className={styles.cross} onClick={handleNext}></div>} <div className={styles["title-container"]}> <Title variant="h3" className={styles.percent}> <>