Merge branch 'develop' into 'main'
Develop See merge request witapp/aura-webapp!275
This commit is contained in:
commit
0789cfc0a5
@ -8,6 +8,7 @@ import { useNavigate } from "react-router-dom";
|
|||||||
import routes from "@/routes";
|
import routes from "@/routes";
|
||||||
import QuestionnaireGreenButton from "../../../../ui/GreenButton";
|
import QuestionnaireGreenButton from "../../../../ui/GreenButton";
|
||||||
import { ELottieKeys, useLottie } from "@/hooks/lottie/useLottie";
|
import { ELottieKeys, useLottie } from "@/hooks/lottie/useLottie";
|
||||||
|
import metricService from "@/services/metric/metricService";
|
||||||
|
|
||||||
interface IBirthdateCustomAnswerProps {
|
interface IBirthdateCustomAnswerProps {
|
||||||
affiliation?: "self" | "partner";
|
affiliation?: "self" | "partner";
|
||||||
@ -44,8 +45,23 @@ function BirthdateCustomAnswer({
|
|||||||
setIsDisabled(_birthdate === "");
|
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 handleNext = () => {
|
||||||
if (affiliation === "self") {
|
if (affiliation === "self") {
|
||||||
|
const age = getAge();
|
||||||
|
metricService.userParams({
|
||||||
|
age,
|
||||||
|
});
|
||||||
dispatch(actions.questionnaire.update({ birthdate }));
|
dispatch(actions.questionnaire.update({ birthdate }));
|
||||||
navigate(routes.client.singleZodiacInfoV1());
|
navigate(routes.client.singleZodiacInfoV1());
|
||||||
}
|
}
|
||||||
|
|||||||
@ -16,7 +16,7 @@ function AboutUsPage() {
|
|||||||
const [selectedAnswer, setSelectedAnswer] = useState<IAnswer | null>(null);
|
const [selectedAnswer, setSelectedAnswer] = useState<IAnswer | null>(null);
|
||||||
const clickAnswerTimeOutRef = useRef<NodeJS.Timeout>();
|
const clickAnswerTimeOutRef = useRef<NodeJS.Timeout>();
|
||||||
const [searchParams] = useSearchParams()
|
const [searchParams] = useSearchParams()
|
||||||
const aboutUsAnswersKey = searchParams.get('key') ?? "aboutUsAnswersNormal"
|
const aboutUsAnswersKey = searchParams.get('key') ?? "aboutUsAnswersA"
|
||||||
|
|
||||||
const handleClick = async (answer: IAnswer) => {
|
const handleClick = async (answer: IAnswer) => {
|
||||||
setSelectedAnswer(answer);
|
setSelectedAnswer(answer);
|
||||||
|
|||||||
@ -14,7 +14,9 @@ import { genders } from "../../data/genders";
|
|||||||
import PrivacyPolicy from "../../components/PrivacyPolicy";
|
import PrivacyPolicy from "../../components/PrivacyPolicy";
|
||||||
import Toast from "../../components/Toast";
|
import Toast from "../../components/Toast";
|
||||||
import { DotLottieReact } from "@lottiefiles/dotlottie-react";
|
import { DotLottieReact } from "@lottiefiles/dotlottie-react";
|
||||||
import { useMetricABFlags } from "@/services/metric/metricService";
|
import metricService, {
|
||||||
|
useMetricABFlags,
|
||||||
|
} from "@/services/metric/metricService";
|
||||||
import { usePreloadImages } from "@/hooks/preload/images";
|
import { usePreloadImages } from "@/hooks/preload/images";
|
||||||
|
|
||||||
interface IGenderPageProps {
|
interface IGenderPageProps {
|
||||||
@ -73,6 +75,10 @@ function GenderPage({ productKey }: IGenderPageProps): JSX.Element {
|
|||||||
if (!selectedGender) return;
|
if (!selectedGender) return;
|
||||||
await new Promise((resolve) => setTimeout(resolve, 1000));
|
await new Promise((resolve) => setTimeout(resolve, 1000));
|
||||||
dispatch(actions.questionnaire.update({ gender: selectedGender.id }));
|
dispatch(actions.questionnaire.update({ gender: selectedGender.id }));
|
||||||
|
|
||||||
|
metricService.userParams({
|
||||||
|
gender: selectedGender.name,
|
||||||
|
});
|
||||||
if (productKey === EProductKeys["moons.pdf.aura"]) {
|
if (productKey === EProductKeys["moons.pdf.aura"]) {
|
||||||
return navigate(routes.client.epeBirthdate());
|
return navigate(routes.client.epeBirthdate());
|
||||||
}
|
}
|
||||||
|
|||||||
@ -87,7 +87,7 @@ function PaymentTable({
|
|||||||
<span className={styles.discount}>
|
<span className={styles.discount}>
|
||||||
${Number(getText("full.price")) / 100}
|
${Number(getText("full.price")) / 100}
|
||||||
</span>
|
</span>
|
||||||
{product.trialPrice !== 50 && <span>${product.price / 100}</span>}
|
{product.trialPrice !== 50 && <span>${getPrice(product)}</span>}
|
||||||
{product.trialPrice === 50 && <span>${getPrice(product)}</span>}
|
{product.trialPrice === 50 && <span>${getPrice(product)}</span>}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@ -27,7 +27,7 @@ function AboutUsPage() {
|
|||||||
</Title>
|
</Title>
|
||||||
|
|
||||||
<div className={styles["answers-container"]}>
|
<div className={styles["answers-container"]}>
|
||||||
{aboutUsAnswers['aboutUsAnswersNormal'].map((answer, index) => (
|
{aboutUsAnswers["aboutUsAnswersA"].map((answer, index) => (
|
||||||
<Answer
|
<Answer
|
||||||
classNameContainer={styles["answer-container"]}
|
classNameContainer={styles["answer-container"]}
|
||||||
key={index}
|
key={index}
|
||||||
|
|||||||
@ -58,7 +58,7 @@ function PaymentTable({ product, buttonClick }: IPaymentTableProps) {
|
|||||||
<p>Your cost per 2 weeks after trial</p>
|
<p>Your cost per 2 weeks after trial</p>
|
||||||
<div>
|
<div>
|
||||||
<span className={styles.discount}>$65</span>
|
<span className={styles.discount}>$65</span>
|
||||||
<span>${product.trialPrice / 100}</span>
|
<span>${getPrice(product)}</span>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@ -32,6 +32,8 @@ interface IUserParams {
|
|||||||
genderFrom: string;
|
genderFrom: string;
|
||||||
email: string;
|
email: string;
|
||||||
hasPersonalVideo: boolean;
|
hasPersonalVideo: boolean;
|
||||||
|
gender: string;
|
||||||
|
age: number;
|
||||||
}
|
}
|
||||||
|
|
||||||
const environments = import.meta.env
|
const environments = import.meta.env
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user