Develop
This commit is contained in:
parent
673a6e2241
commit
a03b2728f3
@ -121,7 +121,7 @@ import LoadingPage from "../pages/LoadingPage";
|
|||||||
import { EProductKeys, productUrls } from "@/data/products";
|
import { EProductKeys, productUrls } from "@/data/products";
|
||||||
import SinglePaymentPage from "../pages/SinglePaymentPage";
|
import SinglePaymentPage from "../pages/SinglePaymentPage";
|
||||||
import ABDesignV1Routes from "@/routerComponents/ABDesign/v1";
|
import ABDesignV1Routes from "@/routerComponents/ABDesign/v1";
|
||||||
import metricService, { EGoals } from "@/services/metric/metricService";
|
import metricService from "@/services/metric/metricService";
|
||||||
|
|
||||||
const isProduction = import.meta.env.MODE === "production";
|
const isProduction = import.meta.env.MODE === "production";
|
||||||
|
|
||||||
@ -164,11 +164,6 @@ function App(): JSX.Element {
|
|||||||
const birthPlace = user?.profile?.birthplace || birthPlaceFromStore;
|
const birthPlace = user?.profile?.birthplace || birthPlaceFromStore;
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (location.pathname.includes("v1/trial-choice")) {
|
|
||||||
metricService.reachGoal(EGoals.AURA_TRIAL_CHOICE_PAGE_VISIT, true);
|
|
||||||
} else if (location.pathname.includes("v1/trial-payment")) {
|
|
||||||
metricService.reachGoal(EGoals.AURA_TRIAL_PAYMENT_PAGE_VISIT, true);
|
|
||||||
}
|
|
||||||
// metricService.initMetricAB()
|
// metricService.initMetricAB()
|
||||||
metricService.hit();
|
metricService.hit();
|
||||||
}, [location]);
|
}, [location]);
|
||||||
|
|||||||
@ -1,6 +1,9 @@
|
|||||||
import { removeAfterDot, roundToWhole } from "@/services/price";
|
import { removeAfterDot, roundToWhole } from "@/services/price";
|
||||||
import styles from "./styles.module.css";
|
import styles from "./styles.module.css";
|
||||||
import Price, { Currency, Locale } from "@/components/PaymentTable/Price";
|
import Price, { Currency, Locale } from "@/components/PaymentTable/Price";
|
||||||
|
import { useEffect, useRef } from "react";
|
||||||
|
import { useDispatch } from "react-redux";
|
||||||
|
import { actions } from "@/store";
|
||||||
|
|
||||||
const currency = Currency.USD;
|
const currency = Currency.USD;
|
||||||
const locale = Locale.EN;
|
const locale = Locale.EN;
|
||||||
@ -22,12 +25,28 @@ function PriceItem({
|
|||||||
classNameActive = "",
|
classNameActive = "",
|
||||||
click,
|
click,
|
||||||
}: PriceItemProps): JSX.Element {
|
}: PriceItemProps): JSX.Element {
|
||||||
|
const dispatch = useDispatch();
|
||||||
|
|
||||||
const _price = new Price(
|
const _price = new Price(
|
||||||
roundToWhole(value === 1 ? 0.99 : value),
|
roundToWhole(value === 1 ? 0.99 : value),
|
||||||
currency,
|
currency,
|
||||||
locale
|
locale
|
||||||
);
|
);
|
||||||
|
|
||||||
|
const itemRef = useRef<HTMLDivElement>(null);
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
if (value === 13.76 && itemRef.current?.offsetLeft) {
|
||||||
|
dispatch(
|
||||||
|
actions.siteConfig.updateTrialChoiceArrowOptions({
|
||||||
|
left: `${
|
||||||
|
itemRef.current.offsetLeft + itemRef.current.offsetWidth / 2 - 26
|
||||||
|
}px`,
|
||||||
|
})
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}, [dispatch, value, itemRef.current?.offsetLeft]);
|
||||||
|
|
||||||
const compatClassName = () => {
|
const compatClassName = () => {
|
||||||
const isPopular = id === "stripe.7";
|
const isPopular = id === "stripe.7";
|
||||||
const isActive = active;
|
const isActive = active;
|
||||||
@ -41,7 +60,11 @@ function PriceItem({
|
|||||||
};
|
};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div onClick={itemClick} className={compatClassName()}>
|
<div
|
||||||
|
ref={value === 13.76 ? itemRef : null}
|
||||||
|
onClick={itemClick}
|
||||||
|
className={compatClassName()}
|
||||||
|
>
|
||||||
{removeAfterDot(_price.format())}
|
{removeAfterDot(_price.format())}
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
|
|||||||
@ -1,3 +1,3 @@
|
|||||||
.relationship-goal-answer {
|
.small-font-size-answer {
|
||||||
font-size: 15px !important;
|
font-size: 15px !important;
|
||||||
}
|
}
|
||||||
@ -846,6 +846,7 @@ export const stepsQuestionary: IStep[] = [
|
|||||||
{
|
{
|
||||||
id: "aboutGoals",
|
id: "aboutGoals",
|
||||||
question: "When you think about your relationship goals, you feel...?",
|
question: "When you think about your relationship goals, you feel...?",
|
||||||
|
answerClassName: styles["small-font-size-answer"],
|
||||||
lottie: {
|
lottie: {
|
||||||
preloadKey: ELottieKeys.darts,
|
preloadKey: ELottieKeys.darts,
|
||||||
},
|
},
|
||||||
@ -1191,7 +1192,7 @@ export const stepsQuestionary: IStep[] = [
|
|||||||
{
|
{
|
||||||
id: "relationshipGoal",
|
id: "relationshipGoal",
|
||||||
question: "When you think about your relationship goals, you feel...?",
|
question: "When you think about your relationship goals, you feel...?",
|
||||||
answerClassName: styles["relationship-goal-answer"],
|
answerClassName: styles["small-font-size-answer"],
|
||||||
answers: [
|
answers: [
|
||||||
{
|
{
|
||||||
id: "optimistic",
|
id: "optimistic",
|
||||||
|
|||||||
@ -87,3 +87,10 @@
|
|||||||
color: #0F1323;
|
color: #0F1323;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.lottie-animation {
|
||||||
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
|
margin-left: 12px;
|
||||||
|
margin-top: 12px;
|
||||||
|
transform: scale(1.35);
|
||||||
|
}
|
||||||
@ -77,6 +77,6 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
.lottie-animation {
|
.lottie-animation {
|
||||||
width: 100%;
|
width: 68%;
|
||||||
aspect-ratio: 401.27 / 353.27;
|
aspect-ratio: 229 / 178;
|
||||||
}
|
}
|
||||||
@ -8,6 +8,7 @@ import { useDynamicSize } from "@/hooks/useDynamicSize";
|
|||||||
import QuestionnaireGreenButton from "../../ui/GreenButton";
|
import QuestionnaireGreenButton from "../../ui/GreenButton";
|
||||||
import { DotLottieReact } from "@lottiefiles/dotlottie-react";
|
import { DotLottieReact } from "@lottiefiles/dotlottie-react";
|
||||||
import { ELottieKeys, useLottie } from "@/hooks/lottie/useLottie";
|
import { ELottieKeys, useLottie } from "@/hooks/lottie/useLottie";
|
||||||
|
import { useEffect } from "react";
|
||||||
|
|
||||||
function EmailConfirmPage() {
|
function EmailConfirmPage() {
|
||||||
const navigate = useNavigate();
|
const navigate = useNavigate();
|
||||||
@ -21,6 +22,13 @@ function EmailConfirmPage() {
|
|||||||
navigate(routes.client.onboardingV1());
|
navigate(routes.client.onboardingV1());
|
||||||
};
|
};
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
document.body.classList.add(styles["body-email-confirm"]);
|
||||||
|
return () => {
|
||||||
|
document.body.classList.remove(styles["body-email-confirm"]);
|
||||||
|
};
|
||||||
|
}, []);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<section className={`${styles.page} page`} ref={pageRef}>
|
<section className={`${styles.page} page`} ref={pageRef}>
|
||||||
<BackgroundTopBlob
|
<BackgroundTopBlob
|
||||||
|
|||||||
@ -1,9 +1,12 @@
|
|||||||
|
.body-email-confirm {
|
||||||
|
background-color: #0F1323;
|
||||||
|
}
|
||||||
|
|
||||||
.page {
|
.page {
|
||||||
position: relative;
|
position: relative;
|
||||||
height: fit-content;
|
height: fit-content;
|
||||||
min-height: 100dvh;
|
min-height: 100dvh;
|
||||||
display: flex;
|
display: flex;
|
||||||
justify-content: start;
|
|
||||||
align-items: center;
|
align-items: center;
|
||||||
justify-content: space-between;
|
justify-content: space-between;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
@ -12,6 +15,7 @@
|
|||||||
color: #fff;
|
color: #fff;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
max-width: 460px;
|
max-width: 460px;
|
||||||
|
overflow-y: auto;
|
||||||
}
|
}
|
||||||
|
|
||||||
.header {
|
.header {
|
||||||
@ -79,6 +83,7 @@
|
|||||||
font-weight: normal;
|
font-weight: normal;
|
||||||
line-height: 1.2;
|
line-height: 1.2;
|
||||||
font-size: 12px;
|
font-size: 12px;
|
||||||
|
margin-top: 8px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.lottie-animation {
|
.lottie-animation {
|
||||||
|
|||||||
@ -4,7 +4,7 @@ import { Gender } from "@/data";
|
|||||||
import { EProductKeys } from "@/data/products";
|
import { EProductKeys } from "@/data/products";
|
||||||
import routes from "@/routes";
|
import routes from "@/routes";
|
||||||
import { actions, selectors } from "@/store";
|
import { actions, selectors } from "@/store";
|
||||||
import { useEffect, useState } from "react";
|
import { useEffect, useMemo, useState } from "react";
|
||||||
import { useDispatch, useSelector } from "react-redux";
|
import { useDispatch, useSelector } from "react-redux";
|
||||||
import { useLocation, useNavigate, useParams } from "react-router-dom";
|
import { useLocation, useNavigate, useParams } from "react-router-dom";
|
||||||
import BackgroundTopBlob from "../../ui/BackgroundTopBlob";
|
import BackgroundTopBlob from "../../ui/BackgroundTopBlob";
|
||||||
@ -34,13 +34,22 @@ function GenderPage({ productKey }: IGenderPageProps): JSX.Element {
|
|||||||
const { flags } = useMetricABFlags();
|
const { flags } = useMetricABFlags();
|
||||||
const isNextPageMentioned = flags?.isNextPageMentioned?.[0];
|
const isNextPageMentioned = flags?.isNextPageMentioned?.[0];
|
||||||
|
|
||||||
usePreloadImages([
|
const preloadImages = useMemo(() => {
|
||||||
"/heart.webp",
|
const _preloadImages = [
|
||||||
"https://d2ecldjic51fgm.cloudfront.net/pub/assets/aura/emoji/twohearts-bc5e3e37.png",
|
"/heart.webp",
|
||||||
"https://d2ecldjic51fgm.cloudfront.net/pub/assets/aura/emoji/ring-26f6592d.png",
|
"https://d2ecldjic51fgm.cloudfront.net/pub/assets/aura/emoji/twohearts-bc5e3e37.png",
|
||||||
"https://d2ecldjic51fgm.cloudfront.net/pub/assets/aura/emoji/brokenheart-9e2ba6fb.png",
|
"https://d2ecldjic51fgm.cloudfront.net/pub/assets/aura/emoji/ring-26f6592d.png",
|
||||||
"https://d2ecldjic51fgm.cloudfront.net/pub/assets/aura/emoji/thinkingface-aa0f3a72.png",
|
"https://d2ecldjic51fgm.cloudfront.net/pub/assets/aura/emoji/brokenheart-9e2ba6fb.png",
|
||||||
]);
|
"https://d2ecldjic51fgm.cloudfront.net/pub/assets/aura/emoji/thinkingface-aa0f3a72.png",
|
||||||
|
];
|
||||||
|
if (isNextPageMentioned === "true") {
|
||||||
|
_preloadImages.push("/new-york-times.png");
|
||||||
|
_preloadImages.push("/partnersWithoutNewYorkTime.png");
|
||||||
|
}
|
||||||
|
return _preloadImages;
|
||||||
|
}, [isNextPageMentioned]);
|
||||||
|
|
||||||
|
usePreloadImages(preloadImages);
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
const feature = location.pathname.replace("/v1/gender/", "");
|
const feature = location.pathname.replace("/v1/gender/", "");
|
||||||
|
|||||||
@ -4,7 +4,7 @@
|
|||||||
align-items: center;
|
align-items: center;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
max-width: 460px;
|
max-width: 460px;
|
||||||
padding: 20px 24px;
|
padding: 20px 24px 116px;
|
||||||
color: #2C2C2C;
|
color: #2C2C2C;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -120,6 +120,8 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
.toast-container {
|
.toast-container {
|
||||||
|
position: fixed;
|
||||||
|
bottom: calc(0dvh + 16px);
|
||||||
margin-top: 16px;
|
margin-top: 16px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -88,4 +88,5 @@
|
|||||||
.lottie-animation {
|
.lottie-animation {
|
||||||
height: 100%;
|
height: 100%;
|
||||||
aspect-ratio: 250 / 145;
|
aspect-ratio: 250 / 145;
|
||||||
|
margin-left: 9%;
|
||||||
}
|
}
|
||||||
@ -41,10 +41,13 @@ function QuestionnaireIntermediatePage() {
|
|||||||
return (
|
return (
|
||||||
<section
|
<section
|
||||||
className={`${styles.page} page`}
|
className={`${styles.page} page`}
|
||||||
style={{
|
|
||||||
backgroundImage: `url(${backgroundImage})`,
|
|
||||||
}}
|
|
||||||
>
|
>
|
||||||
|
<div
|
||||||
|
className={styles["background-image"]}
|
||||||
|
style={{
|
||||||
|
backgroundImage: `url(${backgroundImage})`,
|
||||||
|
}}
|
||||||
|
/>
|
||||||
<Header
|
<Header
|
||||||
isBackButtonVisible={false}
|
isBackButtonVisible={false}
|
||||||
classNameTitle={styles["header-title"]}
|
classNameTitle={styles["header-title"]}
|
||||||
|
|||||||
@ -6,16 +6,33 @@
|
|||||||
justify-items: center;
|
justify-items: center;
|
||||||
grid-template-rows: repeat(4, min-content);
|
grid-template-rows: repeat(4, min-content);
|
||||||
gap: 40px;
|
gap: 40px;
|
||||||
background: url("/couple_holding_hands_1.webp");
|
|
||||||
background-position-y: bottom;
|
|
||||||
background-position-x: center;
|
|
||||||
background-size: cover;
|
|
||||||
color: #fff;
|
color: #fff;
|
||||||
padding-top: 64px;
|
padding-top: 64px;
|
||||||
background-color: #171717;
|
background-color: #171717;
|
||||||
padding-top: 32px;
|
padding-top: 32px;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
max-width: 460px;
|
max-width: 460px;
|
||||||
|
padding-bottom: calc(0dvh + 64px);
|
||||||
|
background-attachment: fixed;
|
||||||
|
}
|
||||||
|
|
||||||
|
.page > * {
|
||||||
|
z-index: 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
.background-image {
|
||||||
|
position: fixed;
|
||||||
|
top: 0;
|
||||||
|
left: 0;
|
||||||
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
|
z-index: 0;
|
||||||
|
background: url("/couple_holding_hands_1.webp");
|
||||||
|
background-position-y: bottom;
|
||||||
|
background-position-x: center;
|
||||||
|
background-size: cover;
|
||||||
|
background-attachment: fixed;
|
||||||
|
background-repeat: no-repeat;
|
||||||
}
|
}
|
||||||
|
|
||||||
.header-title {
|
.header-title {
|
||||||
|
|||||||
@ -1,7 +1,9 @@
|
|||||||
.page {
|
.page {
|
||||||
position: relative;
|
position: relative;
|
||||||
display: grid;
|
display: grid;
|
||||||
|
justify-items: center;
|
||||||
grid-template-rows: repeat(4, min-content);
|
grid-template-rows: repeat(4, min-content);
|
||||||
|
gap: 40px;
|
||||||
height: fit-content;
|
height: fit-content;
|
||||||
min-height: 100vh;
|
min-height: 100vh;
|
||||||
background: url("/almost-there.webp");
|
background: url("/almost-there.webp");
|
||||||
@ -68,6 +70,6 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
.lottie-animation {
|
.lottie-animation {
|
||||||
width: 100%;
|
width: 68%;
|
||||||
aspect-ratio: 575 / 506;
|
aspect-ratio: 229 / 178;
|
||||||
}
|
}
|
||||||
@ -14,7 +14,10 @@ import { usePaywall } from "@/hooks/paywall/usePaywall";
|
|||||||
import { EPlacementKeys } from "@/api/resources/Paywall";
|
import { EPlacementKeys } from "@/api/resources/Paywall";
|
||||||
import { getRandomArbitrary } from "@/services/random-value";
|
import { getRandomArbitrary } from "@/services/random-value";
|
||||||
import Loader from "@/components/Loader";
|
import Loader from "@/components/Loader";
|
||||||
import metricService, { EGoals } from "@/services/metric/metricService";
|
import metricService, {
|
||||||
|
EGoals,
|
||||||
|
EMetrics,
|
||||||
|
} from "@/services/metric/metricService";
|
||||||
import PersonalVideo from "../TrialPayment/components/PersonalVideo";
|
import PersonalVideo from "../TrialPayment/components/PersonalVideo";
|
||||||
|
|
||||||
enum EDisplayOptionButton {
|
enum EDisplayOptionButton {
|
||||||
@ -23,7 +26,7 @@ enum EDisplayOptionButton {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const displayOptionButton: EDisplayOptionButton =
|
const displayOptionButton: EDisplayOptionButton =
|
||||||
EDisplayOptionButton.alwaysVisible;
|
EDisplayOptionButton.visibleIfChosen; //
|
||||||
|
|
||||||
function TrialChoicePage() {
|
function TrialChoicePage() {
|
||||||
const dispatch = useDispatch();
|
const dispatch = useDispatch();
|
||||||
@ -39,9 +42,16 @@ function TrialChoicePage() {
|
|||||||
const { products, isLoading, getText } = usePaywall({
|
const { products, isLoading, getText } = usePaywall({
|
||||||
placementKey: EPlacementKeys["aura.placement.redesign.main"],
|
placementKey: EPlacementKeys["aura.placement.redesign.main"],
|
||||||
});
|
});
|
||||||
|
const arrowLeft = useSelector(selectors.selectTrialChoiceArrowOptions)?.left;
|
||||||
|
|
||||||
const { videoUrl } = useSelector(selectors.selectPersonalVideo);
|
const { videoUrl } = useSelector(selectors.selectPersonalVideo);
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
metricService.reachGoal(EGoals.AURA_TRIAL_CHOICE_PAGE_VISIT, [
|
||||||
|
EMetrics.KLAVIYO,
|
||||||
|
]);
|
||||||
|
}, []);
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
const randomDelay = getRandomArbitrary(3000, 5000);
|
const randomDelay = getRandomArbitrary(3000, 5000);
|
||||||
const countUsersTimeOut = setTimeout(() => {
|
const countUsersTimeOut = setTimeout(() => {
|
||||||
@ -130,7 +140,14 @@ function TrialChoicePage() {
|
|||||||
classNameItemActive={`${styles["price-item-active"]} ${styles[gender]}`}
|
classNameItemActive={`${styles["price-item-active"]} ${styles[gender]}`}
|
||||||
click={handlePriceItem}
|
click={handlePriceItem}
|
||||||
/>
|
/>
|
||||||
<p className={styles["auxiliary-text"]} style={{ maxWidth: "75%" }}>
|
<p
|
||||||
|
className={styles["auxiliary-text"]}
|
||||||
|
style={{
|
||||||
|
maxWidth: arrowLeft
|
||||||
|
? `${Number(arrowLeft.slice(0, -2)) - 8}px`
|
||||||
|
: "75%",
|
||||||
|
}}
|
||||||
|
>
|
||||||
{getText("text.3", {
|
{getText("text.3", {
|
||||||
color: "#1C38EA",
|
color: "#1C38EA",
|
||||||
})}
|
})}
|
||||||
@ -139,6 +156,13 @@ function TrialChoicePage() {
|
|||||||
className={styles["arrow-image"]}
|
className={styles["arrow-image"]}
|
||||||
src="/arrow.svg"
|
src="/arrow.svg"
|
||||||
alt={`Arrow to $${products.at(-1)?.trialPrice}`}
|
alt={`Arrow to $${products.at(-1)?.trialPrice}`}
|
||||||
|
style={
|
||||||
|
arrowLeft
|
||||||
|
? {
|
||||||
|
left: arrowLeft,
|
||||||
|
}
|
||||||
|
: {}
|
||||||
|
}
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
<div className={styles["emails-list-container"]}>
|
<div className={styles["emails-list-container"]}>
|
||||||
|
|||||||
@ -15,7 +15,10 @@ interface IPaymentTableProps {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const getPrice = (product: IPaywallProduct) => {
|
const getPrice = (product: IPaywallProduct) => {
|
||||||
return (product.trialPrice || 0) / 100;
|
if (product.trialPrice % 100 === 0) {
|
||||||
|
return product.trialPrice / 100;
|
||||||
|
}
|
||||||
|
return ((product.trialPrice || 0) / 100).toFixed(2);
|
||||||
};
|
};
|
||||||
|
|
||||||
function PaymentTable({
|
function PaymentTable({
|
||||||
@ -71,12 +74,21 @@ function PaymentTable({
|
|||||||
</div>
|
</div>
|
||||||
<hr />
|
<hr />
|
||||||
<div className={styles["table-element"]}>
|
<div className={styles["table-element"]}>
|
||||||
<p>Your cost per 2 weeks after trial</p>
|
{product.trialPrice !== 50 && (
|
||||||
|
<p>Your cost per 2 weeks after trial</p>
|
||||||
|
)}
|
||||||
|
{product.trialPrice === 50 && (
|
||||||
|
<p style={{ fontSize: "11px", lineHeight: "14px", color: "#8E8E93", marginRight: "8px" }}>
|
||||||
|
Your cost after the trial is fourteen dollars for every two
|
||||||
|
weeks or $0.50 per half-day
|
||||||
|
</p>
|
||||||
|
)}
|
||||||
<div>
|
<div>
|
||||||
<span className={styles.discount}>
|
<span className={styles.discount}>
|
||||||
${Number(getText("full.price")) / 100}
|
${Number(getText("full.price")) / 100}
|
||||||
</span>
|
</span>
|
||||||
<span>${product.price / 100}</span>
|
{product.trialPrice !== 50 && <span>${product.price / 100}</span>}
|
||||||
|
{product.trialPrice === 50 && <span>${getPrice(product)}</span>}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@ -89,9 +101,8 @@ function PaymentTable({
|
|||||||
You are enrolling in 2 weeks subscription. By continuing you agree that
|
You are enrolling in 2 weeks subscription. By continuing you agree that
|
||||||
if you don't cancel prior to the end of the {product?.trialDuration}-day
|
if you don't cancel prior to the end of the {product?.trialDuration}-day
|
||||||
trial for the ${getPrice(product)} you will automatically be charged $
|
trial for the ${getPrice(product)} you will automatically be charged $
|
||||||
{product.price / 100}{" "}
|
{product.price / 100} every 2 weeks until you cancel in settings. Learn
|
||||||
every 2 weeks until you cancel in settings. Learn more about
|
more about cancellation and refund policy in{" "}
|
||||||
cancellation and refund policy in{" "}
|
|
||||||
<a onClick={handleSubscriptionPolicyClick}>Subscription policy</a>
|
<a onClick={handleSubscriptionPolicyClick}>Subscription policy</a>
|
||||||
</p>
|
</p>
|
||||||
</>
|
</>
|
||||||
|
|||||||
@ -24,7 +24,10 @@ import { useDynamicSize } from "@/hooks/useDynamicSize";
|
|||||||
import { EPlacementKeys, IPaywallProduct } from "@/api/resources/Paywall";
|
import { EPlacementKeys, IPaywallProduct } from "@/api/resources/Paywall";
|
||||||
import { usePaywall } from "@/hooks/paywall/usePaywall";
|
import { usePaywall } from "@/hooks/paywall/usePaywall";
|
||||||
import PaymentModal from "@/components/PaymentModal";
|
import PaymentModal from "@/components/PaymentModal";
|
||||||
import metricService, { EGoals } from "@/services/metric/metricService";
|
import metricService, {
|
||||||
|
EGoals,
|
||||||
|
EMetrics,
|
||||||
|
} from "@/services/metric/metricService";
|
||||||
|
|
||||||
function TrialPaymentPage() {
|
function TrialPaymentPage() {
|
||||||
const dispatch = useDispatch();
|
const dispatch = useDispatch();
|
||||||
@ -55,6 +58,12 @@ function TrialPaymentPage() {
|
|||||||
>("single");
|
>("single");
|
||||||
const { subPlan } = useParams();
|
const { subPlan } = useParams();
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
metricService.reachGoal(EGoals.AURA_TRIAL_PAYMENT_PAGE_VISIT, [
|
||||||
|
EMetrics.KLAVIYO,
|
||||||
|
]);
|
||||||
|
}, []);
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (subPlan) {
|
if (subPlan) {
|
||||||
const targetProduct = products.find(
|
const targetProduct = products.find(
|
||||||
|
|||||||
@ -19,7 +19,7 @@ function GetInformationPartnerPage() {
|
|||||||
<section className={`${styles.page} page`}>
|
<section className={`${styles.page} page`}>
|
||||||
<video
|
<video
|
||||||
className={styles["background-video"]}
|
className={styles["background-video"]}
|
||||||
loop={true}
|
loop={false}
|
||||||
autoPlay={true}
|
autoPlay={true}
|
||||||
muted={true}
|
muted={true}
|
||||||
playsInline={true}
|
playsInline={true}
|
||||||
|
|||||||
@ -1,9 +1,10 @@
|
|||||||
import styles from "./styles.module.css";
|
import styles from "./styles.module.css";
|
||||||
import { useSchemeColorByElement } from "@/hooks/useSchemeColorByElement";
|
import { useSchemeColorByElement } from "@/hooks/useSchemeColorByElement";
|
||||||
import { useRef } from "react";
|
import { useRef } from "react";
|
||||||
import { Outlet } from "react-router-dom";
|
import { Outlet, useLocation } from "react-router-dom";
|
||||||
|
|
||||||
function LayoutABDesignV1() {
|
function LayoutABDesignV1() {
|
||||||
|
const location = useLocation();
|
||||||
const mainRef = useRef<HTMLDivElement>(null);
|
const mainRef = useRef<HTMLDivElement>(null);
|
||||||
useSchemeColorByElement(mainRef.current, "section.page, .page, section", [
|
useSchemeColorByElement(mainRef.current, "section.page, .page, section", [
|
||||||
location,
|
location,
|
||||||
|
|||||||
@ -22,6 +22,11 @@ export enum EFlags {
|
|||||||
aboutUsAnswers = 'Key for aboutUsAnswers'
|
aboutUsAnswers = 'Key for aboutUsAnswers'
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export enum EMetrics {
|
||||||
|
YANDEX = "Yandex",
|
||||||
|
KLAVIYO = "Klaviyo",
|
||||||
|
}
|
||||||
|
|
||||||
interface IUserParams {
|
interface IUserParams {
|
||||||
UserID: number | string;
|
UserID: number | string;
|
||||||
genderFrom: string;
|
genderFrom: string;
|
||||||
@ -64,19 +69,14 @@ const userParams = (parameters: Partial<IUserParams>) => {
|
|||||||
window.klaviyo.push(['identify', parameters]);
|
window.klaviyo.push(['identify', parameters]);
|
||||||
}
|
}
|
||||||
|
|
||||||
const reachGoal = (goal: EGoals, onlyKlaviyo = false) => {
|
const reachGoal = (goal: EGoals, usingMetrics = [EMetrics.KLAVIYO, EMetrics.YANDEX]) => {
|
||||||
if (onlyKlaviyo) {
|
if (!checkIsAvailableYandexMetric()) return;
|
||||||
if (!window.klaviyo) return console.error("Klaviyo.Metric not found");
|
|
||||||
window.klaviyo.push(['track', goal]);
|
|
||||||
} else {
|
|
||||||
if (!checkIsAvailableYandexMetric()) return;
|
|
||||||
|
|
||||||
window.ym(metricCounterNumber, "reachGoal", goal)
|
if (usingMetrics.includes(EMetrics.YANDEX)) window.ym(metricCounterNumber, "reachGoal", goal)
|
||||||
console.log("goal: ", goal);
|
console.log("goal: ", goal);
|
||||||
|
|
||||||
if (!window.klaviyo) return console.error("Klaviyo.Metric not found");
|
if (!window.klaviyo) return console.error("Klaviyo.Metric not found");
|
||||||
window.klaviyo.push(['track', goal]);
|
if (usingMetrics.includes(EMetrics.KLAVIYO)) window.klaviyo.push(['track', goal]);
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
type THitOptions = {
|
type THitOptions = {
|
||||||
@ -123,7 +123,7 @@ const initMetricAB = () => {
|
|||||||
export const useMetricABFlags = () => {
|
export const useMetricABFlags = () => {
|
||||||
return useExperiments<typeof EFlags>({
|
return useExperiments<typeof EFlags>({
|
||||||
clientId: `metrika.${metricCounterNumber}`
|
clientId: `metrika.${metricCounterNumber}`
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
export default { setUserID, userParams, reachGoal, hit, initMetric, initMetricAB }
|
export default { setUserID, userParams, reachGoal, hit, initMetric, initMetricAB }
|
||||||
@ -18,6 +18,7 @@ import paywalls, { actions as paywallsActions } from "./paywalls";
|
|||||||
import siteConfig, {
|
import siteConfig, {
|
||||||
selectHome,
|
selectHome,
|
||||||
selectOpenAiToken,
|
selectOpenAiToken,
|
||||||
|
selectTrialChoiceArrowOptions,
|
||||||
actions as siteConfigActions,
|
actions as siteConfigActions,
|
||||||
} from "./siteConfig";
|
} from "./siteConfig";
|
||||||
import onboardingConfig, {
|
import onboardingConfig, {
|
||||||
@ -125,6 +126,7 @@ export const selectors = {
|
|||||||
selectFeature,
|
selectFeature,
|
||||||
selectIsForceShortPath,
|
selectIsForceShortPath,
|
||||||
selectOpenAiToken,
|
selectOpenAiToken,
|
||||||
|
selectTrialChoiceArrowOptions,
|
||||||
selectPalmistryLines,
|
selectPalmistryLines,
|
||||||
selectPalmistryFingers,
|
selectPalmistryFingers,
|
||||||
selectPaywalls,
|
selectPaywalls,
|
||||||
|
|||||||
@ -13,6 +13,9 @@ interface ISiteConfig {
|
|||||||
pathFromHome: EPathsFromHome;
|
pathFromHome: EPathsFromHome;
|
||||||
};
|
};
|
||||||
openAiToken: string;
|
openAiToken: string;
|
||||||
|
trialChoiceArrowOptions: {
|
||||||
|
left?: string;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const initialState: ISiteConfig = {
|
const initialState: ISiteConfig = {
|
||||||
@ -21,6 +24,7 @@ const initialState: ISiteConfig = {
|
|||||||
pathFromHome: EPathsFromHome.compatibility,
|
pathFromHome: EPathsFromHome.compatibility,
|
||||||
},
|
},
|
||||||
openAiToken: "",
|
openAiToken: "",
|
||||||
|
trialChoiceArrowOptions: {}
|
||||||
};
|
};
|
||||||
|
|
||||||
const siteConfigSlice = createSlice({
|
const siteConfigSlice = createSlice({
|
||||||
@ -30,6 +34,9 @@ const siteConfigSlice = createSlice({
|
|||||||
update(state, action: PayloadAction<Partial<ISiteConfig>>) {
|
update(state, action: PayloadAction<Partial<ISiteConfig>>) {
|
||||||
return { ...state, ...action.payload };
|
return { ...state, ...action.payload };
|
||||||
},
|
},
|
||||||
|
updateTrialChoiceArrowOptions(state, action: PayloadAction<Partial<ISiteConfig['trialChoiceArrowOptions']>>) {
|
||||||
|
return { ...state, trialChoiceArrowOptions: { ...state.trialChoiceArrowOptions, ...action.payload } }
|
||||||
|
}
|
||||||
},
|
},
|
||||||
extraReducers: (builder) => builder.addCase("reset", () => initialState),
|
extraReducers: (builder) => builder.addCase("reset", () => initialState),
|
||||||
});
|
});
|
||||||
@ -43,4 +50,8 @@ export const selectOpenAiToken = createSelector(
|
|||||||
(state: { siteConfig: ISiteConfig }) => state.siteConfig.openAiToken,
|
(state: { siteConfig: ISiteConfig }) => state.siteConfig.openAiToken,
|
||||||
(siteConfig) => siteConfig
|
(siteConfig) => siteConfig
|
||||||
);
|
);
|
||||||
|
export const selectTrialChoiceArrowOptions = createSelector(
|
||||||
|
(state: { siteConfig: ISiteConfig }) => state.siteConfig.trialChoiceArrowOptions,
|
||||||
|
(siteConfig) => siteConfig
|
||||||
|
);
|
||||||
export default siteConfigSlice.reducer;
|
export default siteConfigSlice.reducer;
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user