Revert "feat: Добавил препрогрузку оплаты"
This reverts commit 49cea63a95.
This commit is contained in:
parent
49cea63a95
commit
7652b17e80
@ -9,7 +9,6 @@ interface ModalProps {
|
|||||||
containerClassName?: string;
|
containerClassName?: string;
|
||||||
type?: "hidden" | "normal";
|
type?: "hidden" | "normal";
|
||||||
onClose?: () => void;
|
onClose?: () => void;
|
||||||
removeNoScroll?: boolean;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function Modal({
|
function Modal({
|
||||||
@ -20,7 +19,6 @@ function Modal({
|
|||||||
containerClassName = "",
|
containerClassName = "",
|
||||||
type = "normal",
|
type = "normal",
|
||||||
onClose,
|
onClose,
|
||||||
removeNoScroll = true
|
|
||||||
}: ModalProps): JSX.Element {
|
}: ModalProps): JSX.Element {
|
||||||
const handleClose = (event: React.MouseEvent) => {
|
const handleClose = (event: React.MouseEvent) => {
|
||||||
if (event.target !== event.currentTarget) return;
|
if (event.target !== event.currentTarget) return;
|
||||||
@ -29,10 +27,6 @@ function Modal({
|
|||||||
};
|
};
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (!removeNoScroll) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (open) {
|
if (open) {
|
||||||
document.body.classList.add("no-scroll");
|
document.body.classList.add("no-scroll");
|
||||||
}
|
}
|
||||||
@ -40,7 +34,7 @@ function Modal({
|
|||||||
return () => {
|
return () => {
|
||||||
document.body.classList.remove("no-scroll");
|
document.body.classList.remove("no-scroll");
|
||||||
};
|
};
|
||||||
}, [open, removeNoScroll]);
|
}, [open]);
|
||||||
|
|
||||||
if (!open && type === "normal") return <></>;
|
if (!open && type === "normal") return <></>;
|
||||||
return (
|
return (
|
||||||
|
|||||||
@ -14,7 +14,6 @@ interface IPaymentCardModalProps {
|
|||||||
returnUrl?: string;
|
returnUrl?: string;
|
||||||
isOpen: boolean;
|
isOpen: boolean;
|
||||||
setIsOpen: Dispatch<SetStateAction<boolean>>;
|
setIsOpen: Dispatch<SetStateAction<boolean>>;
|
||||||
removeNoScroll?: boolean;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
export default function PaymentCardModal({
|
export default function PaymentCardModal({
|
||||||
@ -25,10 +24,9 @@ export default function PaymentCardModal({
|
|||||||
returnUrl,
|
returnUrl,
|
||||||
isOpen,
|
isOpen,
|
||||||
setIsOpen,
|
setIsOpen,
|
||||||
removeNoScroll,
|
|
||||||
}: IPaymentCardModalProps) {
|
}: IPaymentCardModalProps) {
|
||||||
return (
|
return (
|
||||||
<Modal open={isOpen} onClose={() => setIsOpen(false)} removeNoScroll={removeNoScroll}>
|
<Modal open={isOpen} onClose={() => setIsOpen(false)}>
|
||||||
<Elements stripe={stripePromise} options={{clientSecret}}>
|
<Elements stripe={stripePromise} options={{clientSecret}}>
|
||||||
<CheckoutForm
|
<CheckoutForm
|
||||||
confirmType={paymentType}
|
confirmType={paymentType}
|
||||||
|
|||||||
@ -128,18 +128,15 @@ export default function PaymentModalNew({
|
|||||||
/>
|
/>
|
||||||
</Elements>
|
</Elements>
|
||||||
|
|
||||||
<div style={!isOpenCardModal ? {visibility: 'hidden', position: 'absolute'} : {}}>
|
<PaymentCardModal
|
||||||
<PaymentCardModal
|
isOpen={isOpenCardModal}
|
||||||
isOpen={true}
|
setIsOpen={setIsOpenCardModal}
|
||||||
setIsOpen={setIsOpenCardModal}
|
clientSecret={clientSecret}
|
||||||
clientSecret={clientSecret}
|
stripePromise={stripePromise}
|
||||||
stripePromise={stripePromise}
|
paymentType={paymentType}
|
||||||
paymentType={paymentType}
|
paymentIntentId={paymentIntentId}
|
||||||
paymentIntentId={paymentIntentId}
|
returnUrl={returnUrl}
|
||||||
returnUrl={returnUrl}
|
/>
|
||||||
removeNoScroll={isOpenCardModal}
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
{!isLoading &&
|
{!isLoading &&
|
||||||
<>
|
<>
|
||||||
<div className={styles.infoContainer}>
|
<div className={styles.infoContainer}>
|
||||||
|
|||||||
@ -46,7 +46,6 @@ export default function PaymentScreen() {
|
|||||||
|
|
||||||
const [minutes, seconds] = time.split(":");
|
const [minutes, seconds] = time.split(":");
|
||||||
|
|
||||||
const returnUrl = window.location.origin + '/palmistry/payment';
|
|
||||||
return (
|
return (
|
||||||
<div className="payment-screen">
|
<div className="payment-screen">
|
||||||
<div className="payment-screen__header">
|
<div className="payment-screen__header">
|
||||||
@ -257,7 +256,7 @@ export default function PaymentScreen() {
|
|||||||
<PaymentModalNew
|
<PaymentModalNew
|
||||||
setHeight={setHeight}
|
setHeight={setHeight}
|
||||||
activeProduct={activeProductFromStore}
|
activeProduct={activeProductFromStore}
|
||||||
returnUrl={returnUrl}
|
returnUrl={window.location.href}
|
||||||
placementKey={EPlacementKeys["aura.placement.palmistry.main"]}
|
placementKey={EPlacementKeys["aura.placement.palmistry.main"]}
|
||||||
/>
|
/>
|
||||||
)}
|
)}
|
||||||
|
|||||||
@ -78,14 +78,12 @@ export default function StepsManager() {
|
|||||||
)}
|
)}
|
||||||
|
|
||||||
<main className="steps-manager__main">
|
<main className="steps-manager__main">
|
||||||
{(nonSliderSteps.includes(steps.current as Step) || steps.current === Step.Paywall) && (
|
{nonSliderSteps.includes(steps.current as Step) && (
|
||||||
<div style={steps.current === Step.Paywall ? {visibility: 'hidden', position: 'absolute'} : {}}>
|
<PalmistryContainerWrapper currentStep={steps.current as Step}>
|
||||||
<PalmistryContainerWrapper currentStep={steps.current as Step}>
|
{steps.current === Step.Payment && <PaymentScreen />}
|
||||||
{[Step.Paywall, Step.Payment].includes(steps.current as Step) && <PaymentScreen />}
|
{steps.current === Step.Discount && <DiscountScreen />}
|
||||||
{steps.current === Step.Discount && <DiscountScreen/>}
|
{steps.current === Step.PremiumBundle && <PremiumBundleScreen />}
|
||||||
{steps.current === Step.PremiumBundle && <PremiumBundleScreen/>}
|
</PalmistryContainerWrapper>
|
||||||
</PalmistryContainerWrapper>
|
|
||||||
</div>
|
|
||||||
)}
|
)}
|
||||||
|
|
||||||
{!nonSliderSteps.includes(steps.current as Step) && (
|
{!nonSliderSteps.includes(steps.current as Step) && (
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user