Merge branch 'develop' into 'main'
AW-429-comp-v1-ios-ab See merge request witapp/aura-webapp!705
This commit is contained in:
commit
c116b163f0
@ -5,7 +5,6 @@ import { useState } from "react";
|
||||
import { useDispatch, useSelector } from "react-redux";
|
||||
import { actions, selectors } from "@/store";
|
||||
import Button from "../../components/Button";
|
||||
import metricService from "@/services/metric/metricService";
|
||||
import routes, { compatibilityV2Prefix } from "@/routes";
|
||||
import { useNavigate } from "react-router-dom";
|
||||
import { useTranslations } from "@/hooks/translations";
|
||||
@ -27,23 +26,7 @@ function BirthdatePartner() {
|
||||
setIsDisabled(_birthdate === "");
|
||||
};
|
||||
|
||||
const getAge = () => {
|
||||
const today = new Date();
|
||||
const birthDate = new Date(birthdate);
|
||||
let age = today?.getFullYear() - birthDate?.getFullYear();
|
||||
const m = today?.getMonth() - birthDate?.getMonth();
|
||||
if (m < 0 || (m === 0 && today?.getDate() < birthDate?.getDate())) {
|
||||
age--;
|
||||
}
|
||||
return age;
|
||||
};
|
||||
|
||||
const handleNext = () => {
|
||||
const age = getAge();
|
||||
metricService.userParams({
|
||||
age,
|
||||
});
|
||||
// dispatch(actions.form.addDate(birthdate));
|
||||
dispatch(actions.questionnaire.update({ partnerBirthdate: birthdate }));
|
||||
navigate(routes.client.compatibilityV2PalmsInformationPartner());
|
||||
updateSession(
|
||||
|
||||
@ -5,7 +5,6 @@ import { useState } from "react";
|
||||
import { useDispatch, useSelector } from "react-redux";
|
||||
import { actions, selectors } from "@/store";
|
||||
import Button from "../../components/Button";
|
||||
import metricService from "@/services/metric/metricService";
|
||||
import routes, { compatibilityV2Prefix } from "@/routes";
|
||||
import { useNavigate } from "react-router-dom";
|
||||
import { useTranslations } from "@/hooks/translations";
|
||||
@ -29,23 +28,7 @@ function DateEvent() {
|
||||
setIsDisabled(_birthdate === "");
|
||||
};
|
||||
|
||||
const getAge = () => {
|
||||
const today = new Date();
|
||||
const date = new Date(dateEvent);
|
||||
let age = today?.getFullYear() - date?.getFullYear();
|
||||
const m = today?.getMonth() - date?.getMonth();
|
||||
if (m < 0 || (m === 0 && today?.getDate() < date?.getDate())) {
|
||||
age--;
|
||||
}
|
||||
return age;
|
||||
};
|
||||
|
||||
const handleNext = () => {
|
||||
const age = getAge();
|
||||
metricService.userParams({
|
||||
age,
|
||||
});
|
||||
// dispatch(actions.form.addDate(birthdate));
|
||||
dispatch(actions.compatibilityV2Answers.update({ dateEvent }));
|
||||
navigate(routes.client.compatibilityV2HeadOrHeart());
|
||||
updateSession(
|
||||
|
||||
@ -5,7 +5,6 @@ import { useState } from "react";
|
||||
import { useDispatch, useSelector } from "react-redux";
|
||||
import { actions, selectors } from "@/store";
|
||||
import Button from "../../components/Button";
|
||||
import metricService from "@/services/metric/metricService";
|
||||
import routes, { compatibilityV3Prefix } from "@/routes";
|
||||
import { useNavigate } from "react-router-dom";
|
||||
import { useTranslations } from "@/hooks/translations";
|
||||
@ -27,23 +26,7 @@ function BirthdatePartner() {
|
||||
setIsDisabled(_birthdate === "");
|
||||
};
|
||||
|
||||
const getAge = () => {
|
||||
const today = new Date();
|
||||
const birthDate = new Date(birthdate);
|
||||
let age = today?.getFullYear() - birthDate?.getFullYear();
|
||||
const m = today?.getMonth() - birthDate?.getMonth();
|
||||
if (m < 0 || (m === 0 && today?.getDate() < birthDate?.getDate())) {
|
||||
age--;
|
||||
}
|
||||
return age;
|
||||
};
|
||||
|
||||
const handleNext = () => {
|
||||
const age = getAge();
|
||||
metricService.userParams({
|
||||
age,
|
||||
});
|
||||
// dispatch(actions.form.addDate(birthdate));
|
||||
dispatch(actions.questionnaire.update({ partnerBirthdate: birthdate }));
|
||||
navigate(routes.client.compatibilityV3PalmsInformationPartner());
|
||||
updateSession(
|
||||
|
||||
@ -5,7 +5,6 @@ import { useState } from "react";
|
||||
import { useDispatch, useSelector } from "react-redux";
|
||||
import { actions, selectors } from "@/store";
|
||||
import Button from "../../components/Button";
|
||||
import metricService from "@/services/metric/metricService";
|
||||
import routes, { compatibilityV3Prefix } from "@/routes";
|
||||
import { useNavigate } from "react-router-dom";
|
||||
import { useTranslations } from "@/hooks/translations";
|
||||
@ -29,23 +28,7 @@ function DateEvent() {
|
||||
setIsDisabled(_birthdate === "");
|
||||
};
|
||||
|
||||
const getAge = () => {
|
||||
const today = new Date();
|
||||
const date = new Date(dateEvent);
|
||||
let age = today?.getFullYear() - date?.getFullYear();
|
||||
const m = today?.getMonth() - date?.getMonth();
|
||||
if (m < 0 || (m === 0 && today?.getDate() < date?.getDate())) {
|
||||
age--;
|
||||
}
|
||||
return age;
|
||||
};
|
||||
|
||||
const handleNext = () => {
|
||||
const age = getAge();
|
||||
metricService.userParams({
|
||||
age,
|
||||
});
|
||||
// dispatch(actions.form.addDate(birthdate));
|
||||
dispatch(actions.compatibilityV3Answers.update({ dateEvent }));
|
||||
navigate(routes.client.compatibilityV3HeadOrHeart());
|
||||
updateSession(
|
||||
|
||||
@ -5,7 +5,6 @@ import { useState } from "react";
|
||||
import { useDispatch, useSelector } from "react-redux";
|
||||
import { actions, selectors } from "@/store";
|
||||
import Button from "../../components/Button";
|
||||
import metricService from "@/services/metric/metricService";
|
||||
import routes from "@/routes";
|
||||
import { useNavigate } from "react-router-dom";
|
||||
import { useTranslations } from "@/hooks/translations";
|
||||
@ -27,23 +26,7 @@ function BirthdatePartner() {
|
||||
setIsDisabled(_birthdate === "");
|
||||
};
|
||||
|
||||
const getAge = () => {
|
||||
const today = new Date();
|
||||
const birthDate = new Date(birthdate);
|
||||
let age = today?.getFullYear() - birthDate?.getFullYear();
|
||||
const m = today?.getMonth() - birthDate?.getMonth();
|
||||
if (m < 0 || (m === 0 && today?.getDate() < birthDate?.getDate())) {
|
||||
age--;
|
||||
}
|
||||
return age;
|
||||
};
|
||||
|
||||
const handleNext = () => {
|
||||
const age = getAge();
|
||||
metricService.userParams({
|
||||
age,
|
||||
});
|
||||
// dispatch(actions.form.addDate(birthdate));
|
||||
dispatch(actions.questionnaire.update({ partnerBirthdate: birthdate }));
|
||||
navigate(routes.client.compatibilityV4BirthplacePartner());
|
||||
updateSession(
|
||||
|
||||
@ -5,7 +5,6 @@ import { useState } from "react";
|
||||
import { useDispatch, useSelector } from "react-redux";
|
||||
import { actions, selectors } from "@/store";
|
||||
import Button from "../../components/Button";
|
||||
import metricService from "@/services/metric/metricService";
|
||||
import routes from "@/routes";
|
||||
import { useNavigate } from "react-router-dom";
|
||||
import { useTranslations } from "@/hooks/translations";
|
||||
@ -29,23 +28,7 @@ function DateEvent() {
|
||||
setIsDisabled(_birthdate === "");
|
||||
};
|
||||
|
||||
const getAge = () => {
|
||||
const today = new Date();
|
||||
const date = new Date(dateEvent);
|
||||
let age = today?.getFullYear() - date?.getFullYear();
|
||||
const m = today?.getMonth() - date?.getMonth();
|
||||
if (m < 0 || (m === 0 && today?.getDate() < date?.getDate())) {
|
||||
age--;
|
||||
}
|
||||
return age;
|
||||
};
|
||||
|
||||
const handleNext = () => {
|
||||
const age = getAge();
|
||||
metricService.userParams({
|
||||
age,
|
||||
});
|
||||
// dispatch(actions.form.addDate(birthdate));
|
||||
dispatch(actions.compatibilityV4Answers.update({ dateEvent }));
|
||||
navigate(routes.client.compatibilityV4PartnerAnalysis());
|
||||
updateSession(
|
||||
|
||||
@ -21,11 +21,17 @@ import ProgressBarSubstrate from "./ProgressBarSubstrate";
|
||||
import { useTranslations } from "@/hooks/translations";
|
||||
import { ELocalesPlacement } from "@/locales";
|
||||
import { useMetricABFlags } from "@/services/metric/metricService";
|
||||
import { EUnleashFlags, useUnleash } from "@/hooks/ab/unleash/useUnleash";
|
||||
import { useAuthentication } from "@/hooks/authentication/use-authentication";
|
||||
import { ESourceAuthorization } from "@/api/resources/User";
|
||||
import { useSelector } from "react-redux";
|
||||
import { selectors } from "@/store";
|
||||
|
||||
function LoadingProfilePage() {
|
||||
// const userDeviceType = useSelector(selectors.selectUserDeviceType);
|
||||
// const isShowTryApp = useSelector(selectors.selectIsShowTryApp);
|
||||
const { width: pageWidth, elementRef: pageElement } = useDynamicSize({});
|
||||
const { authorization } = useAuthentication();
|
||||
|
||||
const navigate = useNavigate();
|
||||
const { translate } = useTranslations(ELocalesPlacement.V1);
|
||||
@ -34,6 +40,19 @@ function LoadingProfilePage() {
|
||||
const interval = useRef<NodeJS.Timeout>();
|
||||
const pointsRef = useRef<HTMLDivElement[]>([]);
|
||||
const { flags } = useMetricABFlags();
|
||||
const { variant: emailEnterVariant } = useUnleash({
|
||||
flag: EUnleashFlags.compatibilityV1EmailEnter,
|
||||
});
|
||||
const feature = useSelector(selectors.selectFeature);
|
||||
const isHideEmailByFeature = feature?.includes("ios/link") ?? false;
|
||||
|
||||
useEffect(() => {
|
||||
if (emailEnterVariant === "hide" || isHideEmailByFeature) {
|
||||
(async () => {
|
||||
await authorization("", ESourceAuthorization["aura.main.new"], true);
|
||||
})();
|
||||
}
|
||||
}, [emailEnterVariant, isHideEmailByFeature]);
|
||||
|
||||
const onEndLoading = useCallback(() => {
|
||||
// if (isShowTryApp && userDeviceType === EUserDeviceType.ios) {
|
||||
@ -43,8 +62,11 @@ function LoadingProfilePage() {
|
||||
if (flags?.auraPalmistry?.[0] === "on") {
|
||||
return navigate(routes.client.findHappinessV1());
|
||||
}
|
||||
if (emailEnterVariant === "hide" || isHideEmailByFeature) {
|
||||
return navigate(routes.client.onboardingV1());
|
||||
}
|
||||
return navigate(routes.client.emailEnterV1());
|
||||
}, [flags?.auraPalmistry, navigate]);
|
||||
}, [flags?.auraPalmistry, navigate, emailEnterVariant, isHideEmailByFeature]);
|
||||
|
||||
const getProgressValue = useCallback(
|
||||
(index: number) => {
|
||||
@ -114,9 +136,8 @@ function LoadingProfilePage() {
|
||||
<div className={styles["points-container"]}>
|
||||
{loadingProfilePoints.map(({ title, color }, index) => (
|
||||
<div
|
||||
className={`${styles["point"]} ${
|
||||
getCurrentIndex() === index && styles["active"]
|
||||
}`}
|
||||
className={`${styles["point"]} ${getCurrentIndex() === index && styles["active"]
|
||||
}`}
|
||||
ref={(el) => (pointsRef.current[index] = el as HTMLDivElement)}
|
||||
key={`point-${index}`}
|
||||
>
|
||||
|
||||
@ -36,7 +36,7 @@ function WithPartnerInformation(props: IWithPartnerInformationProps) {
|
||||
<div className={styles["images-container"]}>
|
||||
<div className={styles["image-container"]}>
|
||||
<img
|
||||
src={`/questionnaire-redesign/zodiacs/${gender}/pdf.sex.${zodiacSign?.toUpperCase()}.${gender.toUpperCase()}.webp`}
|
||||
src={`/questionnaire-redesign/zodiacs/${gender}/pdf.sex.${zodiacSign?.toUpperCase()}.${gender?.toUpperCase()}.webp`}
|
||||
alt={`${gender} ${zodiacSign}`}
|
||||
/>
|
||||
<p>{translate("you")}</p>
|
||||
@ -44,7 +44,7 @@ function WithPartnerInformation(props: IWithPartnerInformationProps) {
|
||||
<img src="/plus.svg" alt="Plus" />
|
||||
<div className={styles["image-container"]}>
|
||||
<img
|
||||
src={`/questionnaire-redesign/zodiacs/${partnerGender}/pdf.sex.${partnerZodiacSign?.toUpperCase()}.${partnerGender.toUpperCase()}.webp`}
|
||||
src={`/questionnaire-redesign/zodiacs/${partnerGender}/pdf.sex.${partnerZodiacSign?.toUpperCase()}.${partnerGender?.toUpperCase()}.webp`}
|
||||
alt={`${partnerGender} ${partnerZodiacSign}`}
|
||||
/>
|
||||
<p>{translate("partner")}</p>
|
||||
@ -55,22 +55,22 @@ function WithPartnerInformation(props: IWithPartnerInformationProps) {
|
||||
<li>
|
||||
<h6>{translate("/trial-payment.zodiac_sign")}</h6>
|
||||
<p>
|
||||
{zodiacSign.length
|
||||
{zodiacSign?.length
|
||||
? translate(`zodiac_signs.${zodiacSign?.toLowerCase()}`)
|
||||
: "-"}
|
||||
</p>
|
||||
</li>
|
||||
<li>
|
||||
<h6>{translate("gender")}</h6>
|
||||
<p>{gender.length ? translate(gender?.toLowerCase()) : "-"}</p>
|
||||
<p>{gender?.length ? translate(gender?.toLowerCase()) : "-"}</p>
|
||||
</li>
|
||||
<li>
|
||||
<h6>{translate("/trial-payment.date_of_birth")}</h6>
|
||||
<p>{birthdate.length ? birthdate : "-"}</p>
|
||||
<p>{birthdate?.length ? birthdate : "-"}</p>
|
||||
</li>
|
||||
<li>
|
||||
<h6>{translate("/trial-payment.place_of_birth")}</h6>
|
||||
<p>{birthPlace.length ? birthPlace : "-"}</p>
|
||||
<p>{birthPlace?.length ? birthPlace : "-"}</p>
|
||||
</li>
|
||||
</ul>
|
||||
<ul>
|
||||
@ -84,15 +84,15 @@ function WithPartnerInformation(props: IWithPartnerInformationProps) {
|
||||
</li>
|
||||
<li>
|
||||
<h6>{translate("gender")}</h6>
|
||||
<p>{partnerGender.length ? translate(partnerGender?.toLowerCase()) : "-"}</p>
|
||||
<p>{partnerGender?.length ? translate(partnerGender?.toLowerCase()) : "-"}</p>
|
||||
</li>
|
||||
<li>
|
||||
<h6>{translate("/trial-payment.date_of_birth")}</h6>
|
||||
<p>{partnerBirthDate.length ? partnerBirthDate : "-"}</p>
|
||||
<p>{partnerBirthDate?.length ? partnerBirthDate : "-"}</p>
|
||||
</li>
|
||||
<li>
|
||||
<h6>{translate("/trial-payment.place_of_birth")}</h6>
|
||||
<p>{partnerBirthPlace.length ? partnerBirthPlace : "-"}</p>
|
||||
<p>{partnerBirthPlace?.length ? partnerBirthPlace : "-"}</p>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
@ -19,6 +19,7 @@ import { trialPaymentPointsList } from "@/data/pointsLists";
|
||||
import BackgroundTopBlob from "../../ui/BackgroundTopBlob";
|
||||
import { useDynamicSize } from "@/hooks/useDynamicSize";
|
||||
import metricService, { EGoals, EMetrics } from "@/services/metric/metricService";
|
||||
import { copyToClipboard } from "@/services/data";
|
||||
|
||||
function TryAppPage() {
|
||||
const { width: pageWidth, elementRef: pageRef } = useDynamicSize({});
|
||||
@ -48,8 +49,9 @@ function TryAppPage() {
|
||||
setSingleOrWithPartner("single");
|
||||
}, [flowChoice]);
|
||||
|
||||
const downloadApp = () => {
|
||||
const downloadApp = async () => {
|
||||
metricService.reachGoal(EGoals.DOWNLOAD_APP, [EMetrics.YANDEX]);
|
||||
await copyToClipboard(authCode);
|
||||
// TODO
|
||||
window.location.href =
|
||||
"https://apps.apple.com/us/app/aura-astrology-horoscope/id1601978549";
|
||||
|
||||
@ -22,6 +22,7 @@ export enum EUnleashFlags {
|
||||
"headOrHeartResultPageCompatibilityV2" = "headOrHeartResultPageCompatibilityV2",
|
||||
"headOrHeartResultPageCompatibilityV3" = "headOrHeartResultPageCompatibilityV3",
|
||||
"headOrHeartResultPageCompatibilityV4" = "headOrHeartResultPageCompatibilityV4",
|
||||
"compatibilityV1EmailEnter" = "compatibilityV1EmailEnter",
|
||||
}
|
||||
|
||||
interface IUseUnleashProps<T extends EUnleashFlags> {
|
||||
@ -48,6 +49,7 @@ interface IVariants {
|
||||
[EUnleashFlags.headOrHeartResultPageCompatibilityV2]: "v0" | "v1";
|
||||
[EUnleashFlags.headOrHeartResultPageCompatibilityV3]: "v0" | "v1";
|
||||
[EUnleashFlags.headOrHeartResultPageCompatibilityV4]: "v0" | "v1";
|
||||
[EUnleashFlags.compatibilityV1EmailEnter]: "show" | "hide";
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Loading…
Reference in New Issue
Block a user