Merge branch 'hotfix/redesign-palmistry' into 'main'
hotfix/redesign-palmistry See merge request witapp/aura-webapp!576
This commit is contained in:
commit
f3357ee02a
@ -26,11 +26,11 @@ export interface PayloadUpdate {
|
||||
}
|
||||
|
||||
export interface IAnswersSessionPalmistry {
|
||||
what_aspects: 'love_relationships' | 'health_vitality' | 'career_destiny', // Type: string, optional - 'love_relationships' | 'health_vitality' | 'career_destiny';
|
||||
relationship_status: 'single' | 'in_relationship', // Type: string, optional - 'single' | 'in_relationship';
|
||||
element_resonates: 'water' | 'fire' | 'air' | 'earth', // Type: string, optional - 'water' | 'fire' | 'air' | 'earth';
|
||||
favorite_color: 'blue' | 'green' | 'orange' | 'violet' | 'red' | 'yellow', // Type: string, optional - 'blue' | 'green' | 'orange' | 'violet' | 'red' | 'yellow';
|
||||
head_or_heart: 'head' | 'heart' | 'both', // Type: string, optional - 'head' | 'heart' | 'both';
|
||||
what_aspects: 'love_relationships' | 'health_vitality' | 'career_destiny' | 'life_transitions', // Type: string, optional - 'love_relationships' | 'health_vitality' | 'career_destiny';
|
||||
relationship_status: 'single' | 'in_relationship' | 'engaged' | 'divorced' | 'complicated', // Type: string, optional - 'single' | 'in_relationship';
|
||||
element_resonates: 'water' | 'fire' | 'air' | 'earth' | 'light' | 'darkness', // Type: string, optional - 'water' | 'fire' | 'air' | 'earth';
|
||||
favorite_color: 'blue' | 'green' | 'orange' | 'violet' | 'red' | 'yellow' | 'turquoise', // Type: string, optional - 'blue' | 'green' | 'orange' | 'violet' | 'red' | 'yellow';
|
||||
head_or_heart: 'head' | 'heart' | 'both' | 'depends', // Type: string, optional - 'head' | 'heart' | 'both';
|
||||
time_alone: 1 | 2 | 3 | 4 | 5, // Type: number, optional - 1 | 2 | 3 | 4 | 5;
|
||||
own_company: 1 | 2 | 3 | 4 | 5, // Type: number, optional - 1 | 2 | 3 | 4 | 5;
|
||||
socializing_in_groups: 1 | 2 | 3 | 4 | 5, // Type: number, optional - 1 | 2 | 3 | 4 | 5;
|
||||
|
||||
@ -317,13 +317,11 @@ function App(): JSX.Element {
|
||||
<CookieYesController isDelete={subscriptionStatus === "subscribed"} />
|
||||
}
|
||||
>
|
||||
<Route path={routes.client.auth()} element={<Auth redirectUrl={routes.client.trialPaymentV1()} />} />
|
||||
<Route path="*" element={<ABDesignV1Routes />} />
|
||||
<Route path={`${chatsPrefix}/*`} element={<ChatsRoutes />} />
|
||||
<Route
|
||||
path={`${palmistryV1Prefix}/*`}
|
||||
element={<PalmistryV1Routes />}
|
||||
/>
|
||||
<Route path={routes.client.auth()} element={<Auth redirectUrl={routes.client.trialPaymentV1()} />} />
|
||||
<Route
|
||||
path={`${palmistryV2Prefix}/*`}
|
||||
element={<PalmistryV2Routes />}
|
||||
@ -332,6 +330,159 @@ function App(): JSX.Element {
|
||||
path={`${emailMarketingV1Prefix}/*`}
|
||||
element={<MarketingLandingV1Routes />}
|
||||
/>
|
||||
|
||||
{/* Additional Purchases Palmistry */}
|
||||
<Route element={<PrivateOutlet />}>
|
||||
<Route element={<AdditionalPurchasesPalmistry />}>
|
||||
<Route path={routes.client.skipTrial()} element={<SkipTrial />} />
|
||||
<Route
|
||||
path={routes.client.addConsultant()}
|
||||
element={<AddConsultant />}
|
||||
/>
|
||||
<Route path={routes.client.addGuides()} element={<AddGuides />} />
|
||||
</Route>
|
||||
</Route>
|
||||
{/* Additional Purchases Palmistry End */}
|
||||
|
||||
<Route
|
||||
path={routes.client.getInformationPartner()}
|
||||
element={<GetInformationPartnerPage />}
|
||||
/>
|
||||
|
||||
<Route
|
||||
path={routes.client.paymentResult()}
|
||||
element={<PaymentResultPage />}
|
||||
>
|
||||
<Route path=":id" element={<PaymentResultPage />} />
|
||||
</Route>
|
||||
<Route
|
||||
path={routes.client.paymentSuccess()}
|
||||
element={<PaymentSuccessPage />}
|
||||
/>
|
||||
<Route
|
||||
path={routes.client.paymentFail()}
|
||||
element={<PaymentFailPage />}
|
||||
/>
|
||||
<Route element={<AuthorizedUserOutlet />}>
|
||||
<Route path={routes.client.root()} element={<MainPage />} />
|
||||
<Route path={routes.client.birthday()} element={<BirthdayPage />} />
|
||||
<Route
|
||||
path={routes.client.didYouKnow()}
|
||||
element={<DidYouKnowPage />}
|
||||
/>
|
||||
<Route
|
||||
path={routes.client.freePeriodInfo()}
|
||||
element={<FreePeriodInfoPage />}
|
||||
/>
|
||||
<Route path={routes.client.feedback()} element={<FeedbackPage />} />
|
||||
<Route
|
||||
path={routes.client.birthtime()}
|
||||
element={<BirthtimePage />}
|
||||
/>
|
||||
<Route
|
||||
path={routes.client.createProfile()}
|
||||
element={<SkipStep />}
|
||||
/>
|
||||
<Route
|
||||
path={routes.client.emailEnter()}
|
||||
element={<EmailEnterPage />}
|
||||
/>
|
||||
{/* <Route
|
||||
path={routes.client.auth()}
|
||||
element={<AuthPage padLockApng={padLockApng} />}
|
||||
/> */}
|
||||
<Route
|
||||
path={routes.client.authResult()}
|
||||
element={<AuthResultPage />}
|
||||
/>
|
||||
{/* <Route path={routes.client.static()} element={<StaticPage />} /> */}
|
||||
<Route
|
||||
path={routes.client.priceList()}
|
||||
element={<PriceListPage />}
|
||||
/>
|
||||
</Route>
|
||||
{/* <Route element={<AuthorizedUserOutlet />}>
|
||||
<Route
|
||||
path={routes.client.subscription()}
|
||||
element={<SubscriptionPage />}
|
||||
>
|
||||
<Route path=":subPlan" element={<SubscriptionPage />} />
|
||||
</Route>
|
||||
</Route> */}
|
||||
<Route element={<PrivateOutlet />}>
|
||||
<Route element={<AuthorizedUserOutlet />}>
|
||||
<Route
|
||||
path={routes.client.paymentMethod()}
|
||||
element={<PaymentPage />}
|
||||
/>
|
||||
</Route>
|
||||
<Route element={<PrivateSubscriptionOutlet />}>
|
||||
<Route path={routes.client.home()} element={<HomePage />} />
|
||||
<Route
|
||||
path={routes.client.compatibility()}
|
||||
element={<CompatibilityPage />}
|
||||
/>
|
||||
<Route
|
||||
path={routes.client.compatibilityResult()}
|
||||
element={<CompatResultPage />}
|
||||
/>
|
||||
<Route
|
||||
path={routes.client.breath()}
|
||||
element={<BreathPage leoApng={leoApng} />}
|
||||
/>
|
||||
<Route
|
||||
path={routes.client.breathResult()}
|
||||
element={<UserCallbacksPage />}
|
||||
/>
|
||||
<Route
|
||||
path={routes.client.wallpaper()}
|
||||
element={<WallpaperPage />}
|
||||
/>
|
||||
<Route path={routes.client.advisors()} element={<Advisors />} />
|
||||
<Route path={routes.client.advisors()}>
|
||||
<Route path=":id" element={<AdvisorChatPage />} />
|
||||
</Route>
|
||||
<Route
|
||||
path={routes.client.magicBall()}
|
||||
element={<MagicBallPage />}
|
||||
/>
|
||||
<Route
|
||||
path={routes.client.horoscopeBestiesResult()}
|
||||
element={<BestiesHoroscopeResult />}
|
||||
/>
|
||||
<Route
|
||||
path={routes.client.predictionMoonResult()}
|
||||
element={<PredictionMoonResult />}
|
||||
/>
|
||||
<Route
|
||||
path={routes.client.myHoroscopeResult()}
|
||||
element={<MyHoroscopeResult />}
|
||||
/>
|
||||
<Route
|
||||
path={routes.client.thermalResult()}
|
||||
element={<ThermalResult />}
|
||||
/>
|
||||
<Route
|
||||
path={routes.client.moonPhaseTracker()}
|
||||
element={<MoonPhaseTrackerResult />}
|
||||
/>
|
||||
<Route
|
||||
path={routes.client.energyVampirismResult()}
|
||||
element={<EnergyVampirismResult />}
|
||||
/>
|
||||
<Route
|
||||
path={routes.client.nameHoroscopeResult()}
|
||||
element={<NameHoroscopeResult />}
|
||||
/>
|
||||
</Route>
|
||||
</Route>
|
||||
|
||||
<Route path="*" element={<Navigate to={getRouteBy(subscriptionStatus)} />} />
|
||||
|
||||
{/* ROUTES OFF */}
|
||||
|
||||
<Route path="*" element={<ABDesignV1Routes />} />
|
||||
<Route path={`${chatsPrefix}/*`} element={<ChatsRoutes />} />
|
||||
<Route
|
||||
path={`${routes.client.mikeV1()}/*`}
|
||||
element={<MikeV1Routes />}
|
||||
@ -801,151 +952,7 @@ function App(): JSX.Element {
|
||||
</Route>
|
||||
{/* Additional Purchases End */}
|
||||
|
||||
{/* Additional Purchases Palmistry */}
|
||||
<Route element={<PrivateOutlet />}>
|
||||
<Route element={<AdditionalPurchasesPalmistry />}>
|
||||
<Route path={routes.client.skipTrial()} element={<SkipTrial />} />
|
||||
<Route
|
||||
path={routes.client.addConsultant()}
|
||||
element={<AddConsultant />}
|
||||
/>
|
||||
<Route path={routes.client.addGuides()} element={<AddGuides />} />
|
||||
</Route>
|
||||
</Route>
|
||||
{/* Additional Purchases Palmistry End */}
|
||||
|
||||
<Route
|
||||
path={routes.client.getInformationPartner()}
|
||||
element={<GetInformationPartnerPage />}
|
||||
/>
|
||||
|
||||
<Route
|
||||
path={routes.client.paymentResult()}
|
||||
element={<PaymentResultPage />}
|
||||
>
|
||||
<Route path=":id" element={<PaymentResultPage />} />
|
||||
</Route>
|
||||
<Route
|
||||
path={routes.client.paymentSuccess()}
|
||||
element={<PaymentSuccessPage />}
|
||||
/>
|
||||
<Route
|
||||
path={routes.client.paymentFail()}
|
||||
element={<PaymentFailPage />}
|
||||
/>
|
||||
<Route element={<AuthorizedUserOutlet />}>
|
||||
<Route path={routes.client.root()} element={<MainPage />} />
|
||||
<Route path={routes.client.birthday()} element={<BirthdayPage />} />
|
||||
<Route
|
||||
path={routes.client.didYouKnow()}
|
||||
element={<DidYouKnowPage />}
|
||||
/>
|
||||
<Route
|
||||
path={routes.client.freePeriodInfo()}
|
||||
element={<FreePeriodInfoPage />}
|
||||
/>
|
||||
<Route path={routes.client.feedback()} element={<FeedbackPage />} />
|
||||
<Route
|
||||
path={routes.client.birthtime()}
|
||||
element={<BirthtimePage />}
|
||||
/>
|
||||
<Route
|
||||
path={routes.client.createProfile()}
|
||||
element={<SkipStep />}
|
||||
/>
|
||||
<Route
|
||||
path={routes.client.emailEnter()}
|
||||
element={<EmailEnterPage />}
|
||||
/>
|
||||
{/* <Route
|
||||
path={routes.client.auth()}
|
||||
element={<AuthPage padLockApng={padLockApng} />}
|
||||
/> */}
|
||||
<Route
|
||||
path={routes.client.authResult()}
|
||||
element={<AuthResultPage />}
|
||||
/>
|
||||
{/* <Route path={routes.client.static()} element={<StaticPage />} /> */}
|
||||
<Route
|
||||
path={routes.client.priceList()}
|
||||
element={<PriceListPage />}
|
||||
/>
|
||||
</Route>
|
||||
{/* <Route element={<AuthorizedUserOutlet />}>
|
||||
<Route
|
||||
path={routes.client.subscription()}
|
||||
element={<SubscriptionPage />}
|
||||
>
|
||||
<Route path=":subPlan" element={<SubscriptionPage />} />
|
||||
</Route>
|
||||
</Route> */}
|
||||
<Route element={<PrivateOutlet />}>
|
||||
<Route element={<AuthorizedUserOutlet />}>
|
||||
<Route
|
||||
path={routes.client.paymentMethod()}
|
||||
element={<PaymentPage />}
|
||||
/>
|
||||
</Route>
|
||||
<Route element={<PrivateSubscriptionOutlet />}>
|
||||
<Route path={routes.client.home()} element={<HomePage />} />
|
||||
<Route
|
||||
path={routes.client.compatibility()}
|
||||
element={<CompatibilityPage />}
|
||||
/>
|
||||
<Route
|
||||
path={routes.client.compatibilityResult()}
|
||||
element={<CompatResultPage />}
|
||||
/>
|
||||
<Route
|
||||
path={routes.client.breath()}
|
||||
element={<BreathPage leoApng={leoApng} />}
|
||||
/>
|
||||
<Route
|
||||
path={routes.client.breathResult()}
|
||||
element={<UserCallbacksPage />}
|
||||
/>
|
||||
<Route
|
||||
path={routes.client.wallpaper()}
|
||||
element={<WallpaperPage />}
|
||||
/>
|
||||
<Route path={routes.client.advisors()} element={<Advisors />} />
|
||||
<Route path={routes.client.advisors()}>
|
||||
<Route path=":id" element={<AdvisorChatPage />} />
|
||||
</Route>
|
||||
<Route
|
||||
path={routes.client.magicBall()}
|
||||
element={<MagicBallPage />}
|
||||
/>
|
||||
<Route
|
||||
path={routes.client.horoscopeBestiesResult()}
|
||||
element={<BestiesHoroscopeResult />}
|
||||
/>
|
||||
<Route
|
||||
path={routes.client.predictionMoonResult()}
|
||||
element={<PredictionMoonResult />}
|
||||
/>
|
||||
<Route
|
||||
path={routes.client.myHoroscopeResult()}
|
||||
element={<MyHoroscopeResult />}
|
||||
/>
|
||||
<Route
|
||||
path={routes.client.thermalResult()}
|
||||
element={<ThermalResult />}
|
||||
/>
|
||||
<Route
|
||||
path={routes.client.moonPhaseTracker()}
|
||||
element={<MoonPhaseTrackerResult />}
|
||||
/>
|
||||
<Route
|
||||
path={routes.client.energyVampirismResult()}
|
||||
element={<EnergyVampirismResult />}
|
||||
/>
|
||||
<Route
|
||||
path={routes.client.nameHoroscopeResult()}
|
||||
element={<NameHoroscopeResult />}
|
||||
/>
|
||||
</Route>
|
||||
</Route>
|
||||
|
||||
<Route path="/palmistry" element={<StepsManager />} />
|
||||
|
||||
|
||||
@ -20,14 +20,10 @@ import { usePaywall } from "@/hooks/paywall/usePaywall";
|
||||
import { EPlacementKeys, IPaywallProduct } from "@/api/resources/Paywall";
|
||||
import { useAuth } from "@/auth";
|
||||
import { createSinglePayment } from "@/services/singlePayment";
|
||||
import Modal from "@/components/Modal";
|
||||
import Title from "@/components/Title";
|
||||
// import PaymentForm from "@/components/pages/SinglePaymentPage/PaymentForm";
|
||||
import { getPriceCentsToDollars } from "@/services/price";
|
||||
import { IMessage } from "@/api/resources/ChatMessages";
|
||||
import { useTranslations } from "@/hooks/translations";
|
||||
import { ELocalesPlacement } from "@/locales";
|
||||
import PaymentForm from "@/components/Payment/nmi/PaymentForm";
|
||||
import { usePayment } from "@/hooks/payment/nmi/usePayment";
|
||||
|
||||
const returnUrl = `${window.location.protocol}//${window.location.host
|
||||
}${routes.client.chatsExpert()}`;
|
||||
@ -76,7 +72,18 @@ function ExpertChat() {
|
||||
const setCurrentProduct = (product: IPaywallProduct) => {
|
||||
dispatch(actions.payment.update({ activeProduct: product }));
|
||||
};
|
||||
const [isPaymentModalOpen, setIsPaymentModalOpen] = useState(false);
|
||||
// const [isPaymentModalOpen, setIsPaymentModalOpen] = useState(false);
|
||||
|
||||
|
||||
const {
|
||||
error,
|
||||
isPaymentSuccess,
|
||||
showCreditCardForm,
|
||||
} = usePayment({
|
||||
placementKey,
|
||||
activeProduct: currentProduct!,
|
||||
paymentFormType: "lightbox"
|
||||
});
|
||||
|
||||
const isPayedFirstPurchase = useSelector(
|
||||
selectors.selectIsPayedFirstPurchase
|
||||
@ -189,7 +196,8 @@ function ExpertChat() {
|
||||
setIsLoadingPayment(true);
|
||||
const isPaymentMethodExist = await api.getPaymentMethods({ token: tokenFromStore });
|
||||
if (isPaymentMethodExist.status === "error") {
|
||||
return setIsPaymentModalOpen(true);
|
||||
// return setIsPaymentModalOpen(true);
|
||||
return showCreditCardForm();
|
||||
}
|
||||
// if (!isPayedFirstPurchase) {
|
||||
// return setIsPaymentModalOpen(true);
|
||||
@ -262,19 +270,31 @@ function ExpertChat() {
|
||||
};
|
||||
|
||||
const onPaymentError = () => {
|
||||
setIsPaymentModalOpen(false);
|
||||
// setIsPaymentModalOpen(false);
|
||||
return setIsError(true);
|
||||
}
|
||||
|
||||
const onPaymentSuccess = () => {
|
||||
setIsPaymentModalOpen(false);
|
||||
// setIsPaymentModalOpen(false);
|
||||
setIsLoadingPayment(false);
|
||||
return closeModals();
|
||||
}
|
||||
|
||||
useEffect(() => {
|
||||
if (error) {
|
||||
onPaymentError();
|
||||
}
|
||||
}, [error])
|
||||
|
||||
useEffect(() => {
|
||||
if (isPaymentSuccess) {
|
||||
onPaymentSuccess();
|
||||
}
|
||||
}, [isPaymentSuccess])
|
||||
|
||||
return (
|
||||
<section className={`${styles.page} page`}>
|
||||
{!isLoading &&
|
||||
{/* {!isLoading &&
|
||||
!!tokenFromStore.length &&
|
||||
currentProduct && (
|
||||
<>
|
||||
@ -286,12 +306,6 @@ function ExpertChat() {
|
||||
<Title variant="h1" className={styles["modal-title"]}>
|
||||
{getPriceCentsToDollars(currentProduct.price || 0)}$
|
||||
</Title>
|
||||
{/* <PaymentForm
|
||||
isLoadingPayment={isLoadingPayment}
|
||||
stripePublicKey={paymentIntent.paymentIntent.data.public_key}
|
||||
clientSecret={paymentIntent.paymentIntent.data.client_secret}
|
||||
returnUrl={returnUrl}
|
||||
/> */}
|
||||
<PaymentForm
|
||||
placementKey={placementKey}
|
||||
onPaymentError={onPaymentError}
|
||||
@ -300,7 +314,7 @@ function ExpertChat() {
|
||||
/>
|
||||
</Modal>
|
||||
</>
|
||||
)}
|
||||
)} */}
|
||||
{isLoading && (
|
||||
<Loader color={LoaderColor.Red} className={styles.loader} />
|
||||
)}
|
||||
|
||||
@ -7,9 +7,7 @@ import Button from "../../components/Button";
|
||||
import { usePaywall } from "@/hooks/paywall/usePaywall";
|
||||
import { EPlacementKeys } from "@/api/resources/Paywall";
|
||||
import { addCurrency, ELocalesPlacement } from "@/locales";
|
||||
import Modal from "@/components/Modal";
|
||||
import { useEffect, useState } from "react";
|
||||
import PaymentForm from "@/components/Payment/nmi/PaymentForm";
|
||||
import { useEffect } from "react";
|
||||
import { useNavigate } from "react-router-dom";
|
||||
import routes from "@/routes";
|
||||
import { useDispatch } from "react-redux";
|
||||
@ -17,6 +15,7 @@ import { actions } from "@/store";
|
||||
import { useTranslations } from "@/hooks/translations";
|
||||
import Header from "@/components/pages/ABDesign/v1/components/Header";
|
||||
import { useDynamicSize } from "@/hooks/useDynamicSize";
|
||||
import { usePayment } from "@/hooks/payment/nmi/usePayment";
|
||||
|
||||
const placementKey = EPlacementKeys["aura.placement.email.compatibility.discount"]
|
||||
|
||||
@ -42,27 +41,50 @@ function SecretDiscount() {
|
||||
}))
|
||||
}, [activeProduct])
|
||||
|
||||
const [isPaymentModalOpen, setIsPaymentModalOpen] = useState(false);
|
||||
// const [isPaymentModalOpen, setIsPaymentModalOpen] = useState(false);
|
||||
|
||||
|
||||
const {
|
||||
error,
|
||||
isPaymentSuccess,
|
||||
showCreditCardForm,
|
||||
} = usePayment({
|
||||
placementKey,
|
||||
activeProduct,
|
||||
paymentFormType: "lightbox"
|
||||
});
|
||||
|
||||
useEffect(() => {
|
||||
if (error) {
|
||||
onPaymentError();
|
||||
}
|
||||
}, [error])
|
||||
|
||||
useEffect(() => {
|
||||
if (isPaymentSuccess) {
|
||||
onPaymentSuccess();
|
||||
}
|
||||
}, [isPaymentSuccess])
|
||||
|
||||
|
||||
const onPaymentSuccess = () => {
|
||||
return navigate(routes.client.paymentSuccess())
|
||||
}
|
||||
|
||||
const onModalClosed = () => {
|
||||
setIsPaymentModalOpen(false);
|
||||
}
|
||||
// const onModalClosed = () => {
|
||||
// setIsPaymentModalOpen(false);
|
||||
// }
|
||||
|
||||
const onPaymentError = () => {
|
||||
return navigate(routes.client.paymentFail())
|
||||
}
|
||||
|
||||
const openPaymentModal = () => {
|
||||
setIsPaymentModalOpen(true);
|
||||
};
|
||||
// const openPaymentModal = () => {
|
||||
// setIsPaymentModalOpen(true);
|
||||
// };
|
||||
|
||||
return (
|
||||
<section className={styles.container} ref={elementRef} style={{
|
||||
<section className={styles.container} ref={elementRef} style={{
|
||||
paddingBottom: `${height + 42}px`
|
||||
}}>
|
||||
<Header
|
||||
@ -70,7 +92,7 @@ function SecretDiscount() {
|
||||
classNameTitle={styles["header-title"]}
|
||||
isBackButtonVisible={true}
|
||||
/>
|
||||
{activeProduct && (
|
||||
{/* {activeProduct && (
|
||||
<Modal
|
||||
containerClassName={styles.modal}
|
||||
open={isPaymentModalOpen}
|
||||
@ -83,13 +105,13 @@ function SecretDiscount() {
|
||||
onPaymentSuccess={onPaymentSuccess}
|
||||
/>
|
||||
</Modal>
|
||||
)}
|
||||
)} */}
|
||||
<Blob3 className={styles.blob3} />
|
||||
<Title className={styles.title} variant="h1">
|
||||
{translate("secret-discount.title")}
|
||||
</Title>
|
||||
<SecretDiscountTable />
|
||||
<Button className={styles.button} onClick={openPaymentModal}>
|
||||
<Button className={styles.button} onClick={showCreditCardForm}>
|
||||
{translate("secret-discount.button-trial", { days: trialDuration })}
|
||||
</Button>
|
||||
|
||||
|
||||
@ -3,24 +3,23 @@ import styles from "./styles.module.scss";
|
||||
import PricingSummary from "../../components/PricingSummary";
|
||||
import Button from "../../components/Button";
|
||||
import { useDispatch, useSelector } from "react-redux";
|
||||
import { useEffect, useState } from "react";
|
||||
import { useEffect } from "react";
|
||||
import { actions, selectors } from "@/store";
|
||||
import { usePaywall } from "@/hooks/paywall/usePaywall";
|
||||
import { EPlacementKeys } from "@/api/resources/Paywall";
|
||||
import Modal from "@/components/Modal";
|
||||
import PaymentForm from "@/components/Payment/nmi/PaymentForm";
|
||||
import routes from "@/routes";
|
||||
import { useNavigate } from "react-router-dom";
|
||||
import BlurComponent from "@/components/BlurComponent";
|
||||
import { useTranslations } from "@/hooks/translations";
|
||||
import { addCurrency, ELocalesPlacement } from "@/locales";
|
||||
import { usePayment } from "@/hooks/payment/nmi/usePayment";
|
||||
|
||||
const placementKey = EPlacementKeys["aura.placement.email.marketing"];
|
||||
|
||||
function SpecialOffer() {
|
||||
const dispatch = useDispatch();
|
||||
const navigate = useNavigate();
|
||||
const [isOpenPaymentModal, setIsOpenPaymentModal] = useState<boolean>(false);
|
||||
// const [isOpenPaymentModal, setIsOpenPaymentModal] = useState<boolean>(false);
|
||||
const activeProduct = useSelector(selectors.selectActiveProduct);
|
||||
const { translate } = useTranslations(ELocalesPlacement.EmailMarketingCompatibilityV1);
|
||||
|
||||
@ -36,12 +35,42 @@ function SpecialOffer() {
|
||||
dispatch(actions.payment.update({ activeProduct: products[0] }));
|
||||
}, [dispatch, products]);
|
||||
|
||||
const {
|
||||
error,
|
||||
isPaymentSuccess,
|
||||
isModalClosed,
|
||||
showCreditCardForm,
|
||||
} = usePayment({
|
||||
placementKey,
|
||||
activeProduct: products[0],
|
||||
paymentFormType: "lightbox"
|
||||
});
|
||||
|
||||
const openPaymentModal = () => {
|
||||
setIsOpenPaymentModal(true);
|
||||
// setIsOpenPaymentModal(true);
|
||||
showCreditCardForm();
|
||||
};
|
||||
|
||||
useEffect(() => {
|
||||
if (error) {
|
||||
onPaymentError();
|
||||
}
|
||||
}, [error])
|
||||
|
||||
useEffect(() => {
|
||||
if (isPaymentSuccess) {
|
||||
onPaymentSuccess();
|
||||
}
|
||||
}, [isPaymentSuccess])
|
||||
|
||||
useEffect(() => {
|
||||
if (isModalClosed) {
|
||||
handleCloseModal()
|
||||
}
|
||||
}, [isModalClosed])
|
||||
|
||||
const handleCloseModal = () => {
|
||||
setIsOpenPaymentModal(false);
|
||||
// setIsOpenPaymentModal(false);
|
||||
return navigate(routes.client.emailMarketingV1SaveOff())
|
||||
};
|
||||
|
||||
@ -55,7 +84,7 @@ function SpecialOffer() {
|
||||
|
||||
return (
|
||||
<>
|
||||
{products[0] && (
|
||||
{/* {products[0] && (
|
||||
<Modal
|
||||
containerClassName={styles.modal}
|
||||
open={isOpenPaymentModal}
|
||||
@ -68,7 +97,7 @@ function SpecialOffer() {
|
||||
onPaymentSuccess={onPaymentSuccess}
|
||||
/>
|
||||
</Modal>
|
||||
)}
|
||||
)} */}
|
||||
<div className={styles.container}>
|
||||
<Title className={styles.title} variant="h1">
|
||||
{translate("special-offer.title")}
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
import { useTranslations } from '@/hooks/translations';
|
||||
import { addCurrency, ELocalesPlacement } from '@/locales';
|
||||
import styles from "./styles.module.scss";
|
||||
import { LegacyRef, useRef, useState } from 'react';
|
||||
import { LegacyRef, useEffect, useRef, useState } from 'react';
|
||||
import { useSelector } from 'react-redux';
|
||||
import { selectors } from '@/store';
|
||||
import { EPlacementKeys, IPaywallProduct } from '@/api/resources/Paywall';
|
||||
@ -13,9 +13,9 @@ import metricService, { EGoals, EMetrics } from '@/services/metric/metricService
|
||||
import { useNavigate } from 'react-router-dom';
|
||||
import routes from '@/routes';
|
||||
import CreditCardIcon from '@/components/PaymentModalNew/PaymentCardModal/CreditCardIcon';
|
||||
import Modal from '@/components/Modal';
|
||||
import NMIPaymentForm from '@/components/Payment/nmi/PaymentForm';
|
||||
import { usePayment } from '@/hooks/payment/nmi/usePayment';
|
||||
|
||||
const placementKey = EPlacementKeys['aura.placement.palmistry.redesign'];
|
||||
|
||||
interface IPaymentFormProps {
|
||||
activeProduct: IPaywallProduct;
|
||||
@ -28,16 +28,39 @@ function PaymentForm({
|
||||
const { translate } = useTranslations(ELocalesPlacement.PalmistryV1);
|
||||
const ref = useRef<HTMLDivElement>();
|
||||
const currency = useSelector(selectors.selectCurrency);
|
||||
const [isPaymentSuccess, setIsPaymentSuccess] = useState(false);
|
||||
// const [isPaymentSuccess, setIsPaymentSuccess] = useState(false);
|
||||
const [isPaymentError, setIsPaymentError] = useState(false);
|
||||
const [isPaymentModalOpen, setIsPaymentModalOpen] = useState(false);
|
||||
// const [isPaymentModalOpen, setIsPaymentModalOpen] = useState(false);
|
||||
|
||||
|
||||
const {
|
||||
error,
|
||||
isPaymentSuccess,
|
||||
showCreditCardForm,
|
||||
} = usePayment({
|
||||
placementKey,
|
||||
activeProduct,
|
||||
paymentFormType: "lightbox"
|
||||
});
|
||||
|
||||
useEffect(() => {
|
||||
if (error) {
|
||||
onPaymentError();
|
||||
}
|
||||
}, [error])
|
||||
|
||||
useEffect(() => {
|
||||
if (isPaymentSuccess) {
|
||||
onPaymentSuccess();
|
||||
}
|
||||
}, [isPaymentSuccess])
|
||||
|
||||
const onPaymentError = () => {
|
||||
setIsPaymentError(true);
|
||||
}
|
||||
|
||||
const onPaymentSuccess = () => {
|
||||
setIsPaymentSuccess(true);
|
||||
// setIsPaymentSuccess(true);
|
||||
metricService.reachGoal(EGoals.PAYMENT_SUCCESS);
|
||||
metricService.reachGoal(EGoals.PAYMENT_SUCCESS_PALMISTRY, [
|
||||
EMetrics.YANDEX,
|
||||
@ -100,9 +123,9 @@ function PaymentForm({
|
||||
)}
|
||||
>
|
||||
|
||||
<Modal containerClassName={styles["modal-content"]} open={isPaymentModalOpen} onClose={() => setIsPaymentModalOpen(false)}>
|
||||
<NMIPaymentForm onPaymentError={onPaymentError} onPaymentSuccess={onPaymentSuccess} placementKey={EPlacementKeys['aura.placement.palmistry.redesign']} />
|
||||
</Modal>
|
||||
{/* <Modal containerClassName={styles["modal-content"]} open={isPaymentModalOpen} onClose={() => setIsPaymentModalOpen(false)}>
|
||||
<NMIPaymentForm onPaymentError={onPaymentError} onPaymentSuccess={onPaymentSuccess} placementKey={placementKey} />
|
||||
</Modal> */}
|
||||
|
||||
<div className={styles.paymentModalPrice}>
|
||||
{translate(
|
||||
@ -118,7 +141,8 @@ function PaymentForm({
|
||||
</div>
|
||||
<div
|
||||
className={styles.paymentCreditCard}
|
||||
onClick={() => setIsPaymentModalOpen(true)}
|
||||
// onClick={() => setIsPaymentModalOpen(true)}
|
||||
onClick={() => showCreditCardForm()}
|
||||
>
|
||||
<CreditCardIcon />
|
||||
<div>Credit / Debit Card</div>
|
||||
|
||||
17
src/components/PalmistryV1/images/SVG/Darkness/index.tsx
Normal file
17
src/components/PalmistryV1/images/SVG/Darkness/index.tsx
Normal file
@ -0,0 +1,17 @@
|
||||
function DarknessSVG() {
|
||||
return (
|
||||
<svg width="48" height="49" viewBox="0 0 48 49" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path fillRule="evenodd" clipRule="evenodd" d="M28.1969 0.865479C33.5795 1.81436 38.3436 4.5571 41.8496 8.45422C40.4797 10.7123 37.9981 12.221 35.1641 12.221C30.8485 12.221 27.3501 8.72258 27.3501 4.40705C27.3501 3.13218 27.6554 1.92861 28.1969 0.865479Z" fill="#62C3ED" />
|
||||
<circle cx="24" cy="24.5" r="24" fill="#62C3ED" />
|
||||
<circle cx="13.1163" cy="16.9651" r="4.74419" fill="#82DAFF" />
|
||||
<circle cx="40.4652" cy="32.0348" r="2.51163" fill="#82DAFF" />
|
||||
<circle cx="20.3714" cy="39.2906" r="1.39535" fill="#8BDCFF" />
|
||||
<path fillRule="evenodd" clipRule="evenodd" d="M28.1969 0.865479C33.5795 1.81436 38.3436 4.5571 41.8496 8.45422C40.4797 10.7123 37.9981 12.221 35.1641 12.221C30.8485 12.221 27.3501 8.72258 27.3501 4.40705C27.3501 3.13218 27.6554 1.92861 28.1969 0.865479Z" fill="#9AE1FF" />
|
||||
<circle cx="35.1636" cy="11.1048" r="0.55814" fill="#71D3FD" />
|
||||
<circle cx="30.4188" cy="2.45342" r="0.837209" fill="#71D3FD" />
|
||||
</svg>
|
||||
|
||||
);
|
||||
}
|
||||
|
||||
export default DarknessSVG;
|
||||
15
src/components/PalmistryV1/images/SVG/Light/index.tsx
Normal file
15
src/components/PalmistryV1/images/SVG/Light/index.tsx
Normal file
File diff suppressed because one or more lines are too long
@ -18,6 +18,8 @@ import { ELottieKeys, useLottie } from "@/hooks/lottie/useLottie";
|
||||
import { IAnswersSessionPalmistry } from "@/api/resources/Session";
|
||||
import { useSession } from "@/hooks/session/useSession";
|
||||
import { ESourceAuthorization } from "@/api/resources/User";
|
||||
import DarknessSVG from "../../images/SVG/Darkness";
|
||||
import LightSVG from "../../images/SVG/Light";
|
||||
|
||||
function ElementResonates() {
|
||||
const { translate } = useTranslations(ELocalesPlacement.PalmistryV1);
|
||||
@ -35,6 +37,11 @@ function ElementResonates() {
|
||||
Icon: JSX.Element;
|
||||
}[] = useMemo(
|
||||
() => [
|
||||
{
|
||||
id: "air",
|
||||
title: translate("/element-resonates.answer3"),
|
||||
Icon: <AirSVG />,
|
||||
},
|
||||
{
|
||||
id: "water",
|
||||
title: translate("/element-resonates.answer1"),
|
||||
@ -45,16 +52,21 @@ function ElementResonates() {
|
||||
title: translate("/element-resonates.answer2"),
|
||||
Icon: <FireSVG />,
|
||||
},
|
||||
{
|
||||
id: "air",
|
||||
title: translate("/element-resonates.answer3"),
|
||||
Icon: <AirSVG />,
|
||||
},
|
||||
{
|
||||
id: "earth",
|
||||
title: translate("/element-resonates.answer4"),
|
||||
Icon: <EarthSVG />,
|
||||
},
|
||||
{
|
||||
id: "light",
|
||||
title: translate("/element-resonates.answer5"),
|
||||
Icon: <LightSVG />,
|
||||
},
|
||||
{
|
||||
id: "darkness",
|
||||
title: translate("/element-resonates.answer6"),
|
||||
Icon: <DarknessSVG />,
|
||||
},
|
||||
],
|
||||
[translate]
|
||||
);
|
||||
|
||||
@ -46,16 +46,6 @@ function FavoriteColor() {
|
||||
title: translate("/favorite-color.answer2"),
|
||||
color: "#20C63B",
|
||||
},
|
||||
{
|
||||
id: "orange",
|
||||
title: translate("/favorite-color.answer3"),
|
||||
color: "#EFA006",
|
||||
},
|
||||
{
|
||||
id: "violet",
|
||||
title: translate("/favorite-color.answer4"),
|
||||
color: "#7B29E4",
|
||||
},
|
||||
{
|
||||
id: "red",
|
||||
title: translate("/favorite-color.answer5"),
|
||||
@ -66,6 +56,21 @@ function FavoriteColor() {
|
||||
title: translate("/favorite-color.answer6"),
|
||||
color: "#E4DD29",
|
||||
},
|
||||
{
|
||||
id: "violet",
|
||||
title: translate("/favorite-color.answer4"),
|
||||
color: "#7B29E4",
|
||||
},
|
||||
// {
|
||||
// id: "orange",
|
||||
// title: translate("/favorite-color.answer3"),
|
||||
// color: "#EFA006",
|
||||
// },
|
||||
{
|
||||
id: "turquoise",
|
||||
title: translate("/favorite-color.answer7"),
|
||||
color: "#00C6C6",
|
||||
},
|
||||
],
|
||||
[translate]
|
||||
);
|
||||
|
||||
@ -8,7 +8,7 @@ import { ELocalesPlacement } from "@/locales";
|
||||
import { useDispatch } from "react-redux";
|
||||
import { useEffect } from "react";
|
||||
import { actions } from "@/store";
|
||||
import StarSVG from "../../images/SVG/Star";
|
||||
// import StarSVG from "../../images/SVG/Star";
|
||||
import { usePreloadImages } from "@/hooks/preload/images";
|
||||
|
||||
function FindHappiness() {
|
||||
@ -32,7 +32,7 @@ function FindHappiness() {
|
||||
|
||||
return (
|
||||
<>
|
||||
<div className={styles["blocks-container"]}>
|
||||
{/* <div className={styles["blocks-container"]}>
|
||||
<div className={styles.block}>
|
||||
<img src={`${palmistryV1Prefix}/darts.png`} alt="darts" />
|
||||
<ol>
|
||||
@ -49,7 +49,7 @@ function FindHappiness() {
|
||||
<li>{translate("/find-your-happiness.point4")}</li>
|
||||
</ol>
|
||||
</div>
|
||||
</div>
|
||||
</div> */}
|
||||
<img
|
||||
className={styles.image}
|
||||
src={`${palmistryV1Prefix}/hand-with-lines.png`}
|
||||
@ -58,12 +58,25 @@ function FindHappiness() {
|
||||
<Title variant="h2" className={styles.title}>
|
||||
{translate("/find-your-happiness.title")}
|
||||
</Title>
|
||||
<div className={styles["button-container"]}>
|
||||
<Button onClick={() => navigate(`${palmistryV1Prefix}/gender`)}>
|
||||
{translate("next")}
|
||||
</Button>
|
||||
<div className={styles.advantages}>
|
||||
<ul className={styles.list}>
|
||||
<li>
|
||||
{translate("/find-your-happiness.advantage1")}
|
||||
</li>
|
||||
<li>
|
||||
{translate("/find-your-happiness.advantage2")}
|
||||
</li>
|
||||
<li>
|
||||
{translate("/find-your-happiness.advantage3")}
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
<p className={styles.description}>
|
||||
<div className={styles["button-container"]}>
|
||||
<Button onClick={() => navigate(`${palmistryV1Prefix}/gender`)}>
|
||||
{translate("next")}
|
||||
</Button>
|
||||
</div>
|
||||
<p className={styles.description}>
|
||||
{translate("/find-your-happiness.text")}
|
||||
</p>
|
||||
</>
|
||||
|
||||
@ -55,3 +55,23 @@
|
||||
-webkit-backdrop-filter: blur(2px);
|
||||
backdrop-filter: blur(2px);
|
||||
}
|
||||
|
||||
.advantages {
|
||||
width: 100%;
|
||||
text-align: center;
|
||||
margin: 16px 0;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 8px;
|
||||
}
|
||||
|
||||
.list {
|
||||
list-style: disc;
|
||||
padding-left: 20px;
|
||||
margin: 0;
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
.list li {
|
||||
margin-bottom: 8px;
|
||||
}
|
||||
@ -4,7 +4,7 @@ import { useDispatch, useSelector } from "react-redux";
|
||||
import { actions, selectors } from "@/store";
|
||||
import { Gender } from "@/data";
|
||||
import PrivacyPolicy from "@/components/pages/ABDesign/v1/components/PrivacyPolicy";
|
||||
import Toast from "@/components/pages/ABDesign/v1/components/Toast";
|
||||
// import Toast from "@/components/pages/ABDesign/v1/components/Toast";
|
||||
import { useTranslations } from "@/hooks/translations";
|
||||
import { ELocalesPlacement } from "@/locales";
|
||||
import { useCallback, useEffect, useState } from "react";
|
||||
@ -28,7 +28,6 @@ function GenderPalmistry() {
|
||||
const { checked: privacyPolicyChecked } = useSelector(
|
||||
selectors.selectPrivacyPolicy
|
||||
);
|
||||
console.log(privacyPolicyChecked);
|
||||
|
||||
const { gender } = useSelector(selectors.selectQuestionnaire);
|
||||
const [isSelected, setIsSelected] = useState(false);
|
||||
@ -84,7 +83,9 @@ function GenderPalmistry() {
|
||||
<Title variant="h2" className={styles.title}>
|
||||
{translate("/gender.title")}
|
||||
</Title>
|
||||
<p className={styles.description}>{translate("/gender.description")}</p>
|
||||
<p className={styles.description}>{translate("/gender.description", {
|
||||
br: <br />,
|
||||
})}</p>
|
||||
{/* <ChooseGender onSelectGender={selectGender} /> */}
|
||||
<PrivacyPolicy containerClassName={styles["privacy-policy"]} haveCheckbox={false} />
|
||||
<div className={styles["genders-container"]}>
|
||||
@ -98,11 +99,11 @@ function GenderPalmistry() {
|
||||
))}
|
||||
</div>
|
||||
<AlreadyHaveAccount text={translate("/gender.already_have_account")} />
|
||||
{gender && !privacyPolicyChecked && (
|
||||
{/* {gender && !privacyPolicyChecked && (
|
||||
<Toast classNameContainer={styles["toast-container"]} variant="error">
|
||||
{translate("/gender.toast", undefined, ELocalesPlacement.V1)}
|
||||
</Toast>
|
||||
)}
|
||||
)} */}
|
||||
</>
|
||||
);
|
||||
}
|
||||
|
||||
@ -14,6 +14,10 @@
|
||||
max-width: 302px;
|
||||
}
|
||||
|
||||
.leftAlign {
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
.privacy-policy {
|
||||
max-width: 316px;
|
||||
margin-top: 26px;
|
||||
|
||||
@ -49,6 +49,10 @@ function HeadOrHeart() {
|
||||
id: "both",
|
||||
title: translate("/head-or-heart.answer3"),
|
||||
},
|
||||
{
|
||||
id: "depends",
|
||||
title: translate("/head-or-heart.answer4"),
|
||||
},
|
||||
],
|
||||
[translate]
|
||||
);
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
import { ELottieKeys, useLottie } from "@/hooks/lottie/useLottie";
|
||||
// import { ELottieKeys, useLottie } from "@/hooks/lottie/useLottie";
|
||||
import styles from "./styles.module.scss";
|
||||
import { DotLottieReact } from "@lottiefiles/dotlottie-react";
|
||||
// import { DotLottieReact } from "@lottiefiles/dotlottie-react";
|
||||
import Title from "@/components/Title";
|
||||
import { useTranslations } from "@/hooks/translations";
|
||||
import { ELocalesPlacement } from "@/locales";
|
||||
@ -11,20 +11,22 @@ import Button from "../../components/Button";
|
||||
import { useNavigate } from "react-router-dom";
|
||||
import routes from "@/routes";
|
||||
|
||||
const animations = {
|
||||
both: ELottieKeys.scalesNeutralPalmistry,
|
||||
heart: ELottieKeys.scalesHeartPalmistry,
|
||||
head: ELottieKeys.scalesHeadPalmistry,
|
||||
};
|
||||
// const animations = {
|
||||
// both: ELottieKeys.scalesNeutralPalmistry,
|
||||
// heart: ELottieKeys.scalesHeartPalmistry,
|
||||
// head: ELottieKeys.scalesHeadPalmistry,
|
||||
// depends: ELottieKeys.scalesNeutralPalmistry,
|
||||
// };
|
||||
|
||||
function HeadOrHeartResult() {
|
||||
const navigate = useNavigate();
|
||||
const { translate } = useTranslations(ELocalesPlacement.V1);
|
||||
const { headOrHeart } = useSelector(selectors.selectPalmistryV1Answers);
|
||||
const { gender } = useSelector(selectors.selectQuestionnaire);
|
||||
|
||||
const { animationData } = useLottie({
|
||||
loadKey: animations[headOrHeart as keyof typeof animations],
|
||||
});
|
||||
// const { animationData } = useLottie({
|
||||
// loadKey: animations[headOrHeart as keyof typeof animations],
|
||||
// });
|
||||
|
||||
const birthdate = useSelector(selectors.selectBirthdate);
|
||||
const zodiacSign = getZodiacSignByDate(birthdate);
|
||||
@ -40,7 +42,7 @@ function HeadOrHeartResult() {
|
||||
|
||||
return (
|
||||
<section className={styles.container}>
|
||||
<div className={styles["animation-container"]}>
|
||||
{/* <div className={styles["animation-container"]}>
|
||||
{animationData && (
|
||||
<DotLottieReact
|
||||
className={`${styles["lottie-animation"]} ym-hide-content`}
|
||||
@ -49,7 +51,7 @@ function HeadOrHeartResult() {
|
||||
loop={false}
|
||||
/>
|
||||
)}
|
||||
</div>
|
||||
</div> */}
|
||||
<Title variant="h1" className={styles.title}>
|
||||
{headOrHeart === "both" &&
|
||||
translate("/both.title", {
|
||||
@ -61,6 +63,7 @@ function HeadOrHeartResult() {
|
||||
{translate(`zodiac_signs.${zodiacSign?.toLowerCase()}`)}
|
||||
</b>
|
||||
),
|
||||
gender: translate(gender?.toLowerCase()).toLowerCase()
|
||||
})}
|
||||
{headOrHeart === "head" &&
|
||||
translate("/with-head.title", {
|
||||
@ -69,6 +72,7 @@ function HeadOrHeartResult() {
|
||||
{translate(`zodiac_signs.${zodiacSign?.toLowerCase()}`)}
|
||||
</b>
|
||||
),
|
||||
gender: translate(gender?.toLowerCase()).toLowerCase()
|
||||
})}
|
||||
{headOrHeart === "heart" &&
|
||||
translate("/with-heart.title", {
|
||||
@ -77,7 +81,18 @@ function HeadOrHeartResult() {
|
||||
{translate(`zodiac_signs.${zodiacSign?.toLowerCase()}`)}
|
||||
</b>
|
||||
),
|
||||
gender: translate(gender?.toLowerCase()).toLowerCase()
|
||||
})}
|
||||
{headOrHeart === "depends" &&
|
||||
translate("/depends.title", {
|
||||
zodiacSign: (
|
||||
<b style={{ color: "#224e90" }}>
|
||||
{translate(`zodiac_signs.${zodiacSign?.toLowerCase()}`)}
|
||||
</b>
|
||||
),
|
||||
gender: translate(gender?.toLowerCase()).toLowerCase()
|
||||
})
|
||||
}
|
||||
</Title>
|
||||
<div className={styles["buttons-container"]}>
|
||||
<Button
|
||||
|
||||
@ -40,6 +40,18 @@ function RelationshipStatus() {
|
||||
id: "in_relationship",
|
||||
title: translate("/relationship-status.answer2"),
|
||||
},
|
||||
{
|
||||
id: "engaged",
|
||||
title: translate("/relationship-status.answer3"),
|
||||
},
|
||||
{
|
||||
id: "divorced",
|
||||
title: translate("/relationship-status.answer4"),
|
||||
},
|
||||
{
|
||||
id: "complicated",
|
||||
title: translate("/relationship-status.answer5"),
|
||||
},
|
||||
],
|
||||
[translate]
|
||||
);
|
||||
|
||||
@ -40,6 +40,10 @@ function WhatAspects() {
|
||||
id: "career_destiny",
|
||||
title: translate("/what-aspects.answer3"),
|
||||
},
|
||||
{
|
||||
id: "life_transitions",
|
||||
title: translate("/what-aspects.answer4"),
|
||||
},
|
||||
],
|
||||
[translate]
|
||||
);
|
||||
|
||||
@ -7,9 +7,7 @@ import Button from "../../components/Button";
|
||||
import { usePaywall } from "@/hooks/paywall/usePaywall";
|
||||
import { EPlacementKeys } from "@/api/resources/Paywall";
|
||||
import { addCurrency, ELocalesPlacement } from "@/locales";
|
||||
import Modal from "@/components/Modal";
|
||||
import { useEffect, useState } from "react";
|
||||
import PaymentForm from "@/components/Payment/nmi/PaymentForm";
|
||||
import { useEffect } from "react";
|
||||
import { useNavigate } from "react-router-dom";
|
||||
import routes from "@/routes";
|
||||
import { useDispatch } from "react-redux";
|
||||
@ -17,6 +15,7 @@ import { actions } from "@/store";
|
||||
import { useTranslations } from "@/hooks/translations";
|
||||
import { useDynamicSize } from "@/hooks/useDynamicSize";
|
||||
import Header from "@/components/pages/ABDesign/v1/components/Header";
|
||||
import { usePayment } from "@/hooks/payment/nmi/usePayment";
|
||||
|
||||
const placementKey = EPlacementKeys["aura.placement.email.palmistry.discount"]
|
||||
|
||||
@ -42,25 +41,47 @@ function SecretDiscount() {
|
||||
}))
|
||||
}, [activeProduct])
|
||||
|
||||
const [isPaymentModalOpen, setIsPaymentModalOpen] = useState(false);
|
||||
// const [isPaymentModalOpen, setIsPaymentModalOpen] = useState(false);
|
||||
|
||||
const {
|
||||
error,
|
||||
isPaymentSuccess,
|
||||
showCreditCardForm,
|
||||
} = usePayment({
|
||||
placementKey,
|
||||
activeProduct,
|
||||
paymentFormType: "lightbox"
|
||||
});
|
||||
|
||||
const onPaymentSuccess = () => {
|
||||
return navigate(routes.client.paymentSuccess())
|
||||
}
|
||||
|
||||
const onModalClosed = () => {
|
||||
setIsPaymentModalOpen(false);
|
||||
}
|
||||
// const onModalClosed = () => {
|
||||
// // setIsPaymentModalOpen(false);
|
||||
// }
|
||||
|
||||
const onPaymentError = () => {
|
||||
return navigate(routes.client.paymentFail())
|
||||
}
|
||||
|
||||
const openPaymentModal = () => {
|
||||
setIsPaymentModalOpen(true);
|
||||
// setIsPaymentModalOpen(true);
|
||||
showCreditCardForm();
|
||||
};
|
||||
|
||||
useEffect(() => {
|
||||
if (error) {
|
||||
onPaymentError();
|
||||
}
|
||||
}, [error])
|
||||
|
||||
useEffect(() => {
|
||||
if (isPaymentSuccess) {
|
||||
onPaymentSuccess();
|
||||
}
|
||||
}, [isPaymentSuccess])
|
||||
|
||||
return (
|
||||
<section className={styles.container} ref={elementRef} style={{
|
||||
paddingBottom: `${height + 42}px`
|
||||
@ -70,7 +91,7 @@ function SecretDiscount() {
|
||||
classNameTitle={styles["header-title"]}
|
||||
isBackButtonVisible={true}
|
||||
/>
|
||||
{activeProduct && (
|
||||
{/* {activeProduct && (
|
||||
<Modal
|
||||
containerClassName={styles.modal}
|
||||
open={isPaymentModalOpen}
|
||||
@ -83,7 +104,7 @@ function SecretDiscount() {
|
||||
onPaymentSuccess={onPaymentSuccess}
|
||||
/>
|
||||
</Modal>
|
||||
)}
|
||||
)} */}
|
||||
<Blob3 className={styles.blob3} />
|
||||
<Title className={styles.title} variant="h1">
|
||||
{translate("secret-discount.title")}
|
||||
|
||||
@ -14,15 +14,14 @@ import { EPlacementKeys } from "@/api/resources/Paywall";
|
||||
import { usePaywall } from "@/hooks/paywall/usePaywall";
|
||||
import MoneyBackGuarantee from "../../components/MoneyBackGuarantee";
|
||||
import PalmsSayAbout from "../../components/PalmsSayAbout";
|
||||
import { useCallback, useEffect, useMemo, useState } from "react";
|
||||
import { useCallback, useEffect, useMemo } from "react";
|
||||
import { getZodiacSignByDate } from "@/services/zodiac-sign";
|
||||
import WithPartnerInformation from "../../components/WithPartnerInformation";
|
||||
import PersonalInformation from "../../components/PersonalInformation";
|
||||
import Reviews from "../../components/Reviews";
|
||||
import Address from "../../components/Address";
|
||||
import Modal from "@/components/Modal";
|
||||
import PaymentForm from "@/components/Payment/nmi/PaymentForm";
|
||||
import { useApi, useApiCall, User } from "@/api";
|
||||
import { usePayment } from "@/hooks/payment/nmi/usePayment";
|
||||
|
||||
const placementKey = EPlacementKeys["aura.placement.email.palmistry"];
|
||||
|
||||
@ -51,14 +50,43 @@ function TrialPayment() {
|
||||
const partnerZodiacSign = getZodiacSignByDate(partnerBirthdate);
|
||||
const navigate = useNavigate();
|
||||
|
||||
const [isPaymentModalOpen, setIsPaymentModalOpen] = useState(false);
|
||||
// const [isPaymentModalOpen, setIsPaymentModalOpen] = useState(false);
|
||||
|
||||
const {
|
||||
error,
|
||||
isPaymentSuccess,
|
||||
isModalClosed,
|
||||
showCreditCardForm,
|
||||
} = usePayment({
|
||||
placementKey,
|
||||
activeProduct,
|
||||
paymentFormType: "lightbox"
|
||||
});
|
||||
|
||||
useEffect(() => {
|
||||
if (error) {
|
||||
onPaymentError();
|
||||
}
|
||||
}, [error])
|
||||
|
||||
useEffect(() => {
|
||||
if (isPaymentSuccess) {
|
||||
onPaymentSuccess();
|
||||
}
|
||||
}, [isPaymentSuccess])
|
||||
|
||||
useEffect(() => {
|
||||
if (isModalClosed) {
|
||||
onModalClosed();
|
||||
}
|
||||
}, [isModalClosed])
|
||||
|
||||
const onPaymentSuccess = () => {
|
||||
return navigate(routes.client.paymentSuccess())
|
||||
}
|
||||
|
||||
const onModalClosed = () => {
|
||||
setIsPaymentModalOpen(false);
|
||||
// setIsPaymentModalOpen(false);
|
||||
return handleDiscount()
|
||||
}
|
||||
|
||||
@ -71,7 +99,8 @@ function TrialPayment() {
|
||||
}
|
||||
|
||||
const openPaymentModal = () => {
|
||||
setIsPaymentModalOpen(true);
|
||||
// setIsPaymentModalOpen(true);
|
||||
showCreditCardForm();
|
||||
};
|
||||
|
||||
const userData = useCallback(async () => {
|
||||
@ -97,13 +126,13 @@ function TrialPayment() {
|
||||
|
||||
return (
|
||||
<>
|
||||
<Modal containerClassName={styles.modal} open={isPaymentModalOpen} onClose={onModalClosed}>
|
||||
{/* <Modal containerClassName={styles.modal} open={isPaymentModalOpen} onClose={onModalClosed}>
|
||||
<PaymentForm
|
||||
placementKey={placementKey}
|
||||
onPaymentError={onPaymentError}
|
||||
onPaymentSuccess={onPaymentSuccess}
|
||||
/>
|
||||
</Modal>
|
||||
</Modal> */}
|
||||
<div className={styles.background} />
|
||||
<div className={styles.header}>
|
||||
<Title className={styles.title}>
|
||||
|
||||
@ -26,7 +26,7 @@ function PrivacyPolicy({ containerClassName = "", haveCheckbox = true }: IPrivac
|
||||
{translate("policy", {
|
||||
privacyPolicy: (
|
||||
<a
|
||||
href="https://aura.wit.life/privacy"
|
||||
href="https://witapps.us/en/privacy"
|
||||
target="_blank"
|
||||
rel="noopener noreferrer"
|
||||
>
|
||||
@ -35,7 +35,7 @@ function PrivacyPolicy({ containerClassName = "", haveCheckbox = true }: IPrivac
|
||||
),
|
||||
termsOfUse: (
|
||||
<a
|
||||
href="https://aura.wit.life/terms"
|
||||
href="https://witapps.us/en/terms"
|
||||
target="_blank"
|
||||
rel="noopener noreferrer"
|
||||
>
|
||||
|
||||
@ -28,8 +28,7 @@ import metricService, {
|
||||
} from "@/services/metric/metricService";
|
||||
import { useTranslations } from "@/hooks/translations";
|
||||
import { ELocalesPlacement } from "@/locales";
|
||||
import Modal from "@/components/Modal";
|
||||
import PaymentForm from "@/components/Payment/nmi/PaymentForm";
|
||||
import { usePayment } from "@/hooks/payment/nmi/usePayment";
|
||||
|
||||
const placementKey = EPlacementKeys["aura.placement.redesign.main"]
|
||||
|
||||
@ -60,14 +59,44 @@ function TrialPaymentPage() {
|
||||
>("single");
|
||||
const { subPlan } = useParams();
|
||||
|
||||
const [isPaymentModalOpen, setIsPaymentModalOpen] = useState(false);
|
||||
|
||||
const {
|
||||
error,
|
||||
isPaymentSuccess,
|
||||
showCreditCardForm,
|
||||
isModalClosed
|
||||
} = usePayment({
|
||||
placementKey,
|
||||
activeProduct: activeProduct || products[0],
|
||||
paymentFormType: "lightbox"
|
||||
});
|
||||
|
||||
// const [isPaymentModalOpen, setIsPaymentModalOpen] = useState(false);
|
||||
|
||||
useEffect(() => {
|
||||
if (error) {
|
||||
onPaymentError();
|
||||
}
|
||||
}, [error])
|
||||
|
||||
useEffect(() => {
|
||||
if (isPaymentSuccess) {
|
||||
onPaymentSuccess();
|
||||
}
|
||||
}, [isPaymentSuccess])
|
||||
|
||||
useEffect(() => {
|
||||
if (isModalClosed) {
|
||||
onModalClosed()
|
||||
}
|
||||
}, [isModalClosed])
|
||||
|
||||
const onPaymentSuccess = () => {
|
||||
return navigate(routes.client.paymentSuccess())
|
||||
}
|
||||
|
||||
const onModalClosed = () => {
|
||||
setIsPaymentModalOpen(false);
|
||||
// setIsPaymentModalOpen(false);
|
||||
return handleDiscount()
|
||||
}
|
||||
|
||||
@ -129,7 +158,8 @@ function TrialPaymentPage() {
|
||||
|
||||
const openPaymentModal = () => {
|
||||
metricService.reachGoal(EGoals.AURA_PAYMENT_METHODS_OPENED);
|
||||
setIsPaymentModalOpen(true);
|
||||
// setIsPaymentModalOpen(true);
|
||||
showCreditCardForm();
|
||||
};
|
||||
|
||||
return (
|
||||
@ -140,13 +170,13 @@ function TrialPaymentPage() {
|
||||
backgroundColor: gender === "male" ? "#C1E5FF" : "#F7EBFF",
|
||||
}}
|
||||
>
|
||||
<Modal containerClassName={styles.modal} open={isPaymentModalOpen} onClose={onModalClosed}>
|
||||
{/* <Modal containerClassName={styles.modal} open={isPaymentModalOpen} onClose={onModalClosed}>
|
||||
<PaymentForm
|
||||
placementKey={placementKey}
|
||||
onPaymentError={onPaymentError}
|
||||
onPaymentSuccess={onPaymentSuccess}
|
||||
/>
|
||||
</Modal>
|
||||
</Modal> */}
|
||||
<div className={styles["background-top-blob-container"]}>
|
||||
<BackgroundTopBlob
|
||||
width={pageWidth}
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
import styles from "./styles.module.css";
|
||||
import PaymentDiscountTable from "./PaymentDiscountTable";
|
||||
import { useState } from "react";
|
||||
import { useEffect } from "react";
|
||||
import { selectors } from "@/store";
|
||||
import { useSelector } from "react-redux";
|
||||
import { EPlacementKeys } from "@/api/resources/Paywall";
|
||||
@ -10,8 +10,7 @@ import DiscountLayout from "../../layouts/Discount/DiscountLayout";
|
||||
import QuestionnaireGreenButton from "../../ui/GreenButton";
|
||||
import { Navigate, useNavigate } from "react-router-dom";
|
||||
import routes from "@/routes";
|
||||
import PaymentForm from "@/components/Payment/nmi/PaymentForm";
|
||||
import Modal from "@/components/Modal";
|
||||
import { usePayment } from "@/hooks/payment/nmi/usePayment";
|
||||
|
||||
const placementKey = EPlacementKeys["aura.placement.secret.discount"];
|
||||
|
||||
@ -20,37 +19,60 @@ function TrialPaymentWithDiscount() {
|
||||
const { translate } = useTranslations(ELocalesPlacement.V1);
|
||||
const activeProduct = useSelector(selectors.selectActiveProduct);
|
||||
const currency = useSelector(selectors.selectCurrency);
|
||||
const [isPaymentModalOpen, setIsPaymentModalOpen] = useState(false);
|
||||
// const [isPaymentModalOpen, setIsPaymentModalOpen] = useState(false);
|
||||
|
||||
if (!activeProduct) {
|
||||
return <Navigate to={routes.client.additionalDiscountV1()} />
|
||||
}
|
||||
|
||||
const {
|
||||
error,
|
||||
isPaymentSuccess,
|
||||
showCreditCardForm,
|
||||
} = usePayment({
|
||||
placementKey,
|
||||
activeProduct,
|
||||
paymentFormType: "lightbox"
|
||||
});
|
||||
|
||||
const onPaymentSuccess = () => {
|
||||
return navigate(routes.client.paymentSuccess())
|
||||
}
|
||||
|
||||
const onModalClosed = () => {
|
||||
setIsPaymentModalOpen(false);
|
||||
}
|
||||
// const onModalClosed = () => {
|
||||
// // setIsPaymentModalOpen(false);
|
||||
// }
|
||||
|
||||
const onPaymentError = () => {
|
||||
return navigate(routes.client.paymentFail())
|
||||
}
|
||||
|
||||
const openPaymentModal = () => {
|
||||
setIsPaymentModalOpen(true);
|
||||
// setIsPaymentModalOpen(true);
|
||||
showCreditCardForm();
|
||||
};
|
||||
|
||||
useEffect(() => {
|
||||
if (error) {
|
||||
onPaymentError();
|
||||
}
|
||||
}, [error])
|
||||
|
||||
useEffect(() => {
|
||||
if (isPaymentSuccess) {
|
||||
onPaymentSuccess();
|
||||
}
|
||||
}, [isPaymentSuccess])
|
||||
|
||||
return (
|
||||
<DiscountLayout title={translate("/trial-payment-with-discount.title")}>
|
||||
<Modal containerClassName={styles.modal} open={isPaymentModalOpen} onClose={onModalClosed}>
|
||||
{/* <Modal containerClassName={styles.modal} open={isPaymentModalOpen} onClose={onModalClosed}>
|
||||
<PaymentForm
|
||||
placementKey={placementKey}
|
||||
onPaymentError={onPaymentError}
|
||||
onPaymentSuccess={onPaymentSuccess}
|
||||
/>
|
||||
</Modal>
|
||||
</Modal> */}
|
||||
<PaymentDiscountTable />
|
||||
|
||||
<div className={styles['button-wrapper']}>
|
||||
|
||||
@ -14,7 +14,8 @@ function GetInformationPartnerPage() {
|
||||
|
||||
const handleBack = () => {
|
||||
if (path === "palmistry") {
|
||||
return navigate(routes.client.addGuides());
|
||||
return navigate(routes.client.skipTrial());
|
||||
// return navigate(routes.client.addGuides());
|
||||
}
|
||||
navigate(routes.client.addConsultationV1());
|
||||
};
|
||||
|
||||
@ -1,19 +1,19 @@
|
||||
import { Outlet } from "react-router-dom";
|
||||
import styles from "./styles.module.scss";
|
||||
import { palmistrySteps } from "@/data/additionalPurchases";
|
||||
import AdditionalPurchasesSteps from "./components/AdditionalPurchasesSteps";
|
||||
// import { palmistrySteps } from "@/data/additionalPurchases";
|
||||
// import AdditionalPurchasesSteps from "./components/AdditionalPurchasesSteps";
|
||||
|
||||
function AdditionalPurchasesPalmistry() {
|
||||
const activeStep = palmistrySteps.findIndex((value) =>
|
||||
window.location.href.includes(value.link)
|
||||
);
|
||||
// const activeStep = palmistrySteps.findIndex((value) =>
|
||||
// window.location.href.includes(value.link)
|
||||
// );
|
||||
|
||||
return (
|
||||
<section className={`${styles.page} page`}>
|
||||
<AdditionalPurchasesSteps
|
||||
{/* <AdditionalPurchasesSteps
|
||||
steps={palmistrySteps}
|
||||
activeStep={activeStep}
|
||||
/>
|
||||
/> */}
|
||||
<Outlet />
|
||||
</section>
|
||||
);
|
||||
|
||||
@ -49,11 +49,15 @@ function SkipTrial() {
|
||||
token
|
||||
);
|
||||
if (isPurchasedSkipTrial || isPurchasedPremiumBundle) {
|
||||
return navigate(routes.client.addConsultant());
|
||||
return handleNext();
|
||||
}
|
||||
})();
|
||||
}, [checkProductPurchased, navigate, token]);
|
||||
|
||||
const handleNext = () => {
|
||||
navigate(`${routes.client.getInformationPartner()}?path=palmistry`);
|
||||
}
|
||||
|
||||
useEffect(() => {
|
||||
(async () => {
|
||||
const products = await api.getSinglePaymentProducts({ token });
|
||||
@ -77,7 +81,7 @@ function SkipTrial() {
|
||||
}, [stripePublicKey]);
|
||||
|
||||
const goPremiumBundle = () => {
|
||||
navigate(routes.client.addConsultant());
|
||||
handleNext();
|
||||
};
|
||||
|
||||
const buy = async () => {
|
||||
|
||||
@ -166,9 +166,10 @@ export const useAuthentication = () => {
|
||||
setIsLoading(true);
|
||||
setError(null)
|
||||
const payload = getAuthorizationPayload(email, source);
|
||||
const { token, userId, generatingVideo, videoId, authCode } = await api.authorization(payload);
|
||||
const { token, userId: userIdFromApi, generatingVideo, videoId, authCode } = await api.authorization(payload);
|
||||
const { user } = await api.getUser({ token });
|
||||
const { user: userMe } = await api.getMe({ token });
|
||||
const userId = userIdFromApi || userMe?._id;
|
||||
if (userId?.length) {
|
||||
dispatch(actions.userId.update({ userId }));
|
||||
metricService.userParams({
|
||||
|
||||
@ -639,10 +639,10 @@ export const hasFullDataModal = (path: string) => {
|
||||
export const getRouteBy = (status: UserStatus): string => {
|
||||
switch (status) {
|
||||
case "lead":
|
||||
return routes.client.genderV1();
|
||||
return routes.client.palmistryV1Welcome();
|
||||
case "registred":
|
||||
case "unsubscribed":
|
||||
return routes.client.trialPaymentV1();
|
||||
return routes.client.palmistryV1TrialPayment();
|
||||
case "subscribed":
|
||||
return routes.client.home();
|
||||
default:
|
||||
|
||||
Loading…
Reference in New Issue
Block a user