Revert "feat: Добавил препрогрузку оплаты"

This reverts commit 49cea63a95.
This commit is contained in:
yury 2024-06-29 06:03:54 +03:00
parent 49cea63a95
commit 7652b17e80
5 changed files with 18 additions and 32 deletions

View File

@ -9,7 +9,6 @@ interface ModalProps {
containerClassName?: string;
type?: "hidden" | "normal";
onClose?: () => void;
removeNoScroll?: boolean;
}
function Modal({
@ -20,7 +19,6 @@ function Modal({
containerClassName = "",
type = "normal",
onClose,
removeNoScroll = true
}: ModalProps): JSX.Element {
const handleClose = (event: React.MouseEvent) => {
if (event.target !== event.currentTarget) return;
@ -29,10 +27,6 @@ function Modal({
};
useEffect(() => {
if (!removeNoScroll) {
return;
}
if (open) {
document.body.classList.add("no-scroll");
}
@ -40,7 +34,7 @@ function Modal({
return () => {
document.body.classList.remove("no-scroll");
};
}, [open, removeNoScroll]);
}, [open]);
if (!open && type === "normal") return <></>;
return (

View File

@ -14,7 +14,6 @@ interface IPaymentCardModalProps {
returnUrl?: string;
isOpen: boolean;
setIsOpen: Dispatch<SetStateAction<boolean>>;
removeNoScroll?: boolean;
}
export default function PaymentCardModal({
@ -25,10 +24,9 @@ export default function PaymentCardModal({
returnUrl,
isOpen,
setIsOpen,
removeNoScroll,
}: IPaymentCardModalProps) {
return (
<Modal open={isOpen} onClose={() => setIsOpen(false)} removeNoScroll={removeNoScroll}>
<Modal open={isOpen} onClose={() => setIsOpen(false)}>
<Elements stripe={stripePromise} options={{clientSecret}}>
<CheckoutForm
confirmType={paymentType}

View File

@ -128,18 +128,15 @@ export default function PaymentModalNew({
/>
</Elements>
<div style={!isOpenCardModal ? {visibility: 'hidden', position: 'absolute'} : {}}>
<PaymentCardModal
isOpen={true}
setIsOpen={setIsOpenCardModal}
clientSecret={clientSecret}
stripePromise={stripePromise}
paymentType={paymentType}
paymentIntentId={paymentIntentId}
returnUrl={returnUrl}
removeNoScroll={isOpenCardModal}
/>
</div>
<PaymentCardModal
isOpen={isOpenCardModal}
setIsOpen={setIsOpenCardModal}
clientSecret={clientSecret}
stripePromise={stripePromise}
paymentType={paymentType}
paymentIntentId={paymentIntentId}
returnUrl={returnUrl}
/>
{!isLoading &&
<>
<div className={styles.infoContainer}>

View File

@ -46,7 +46,6 @@ export default function PaymentScreen() {
const [minutes, seconds] = time.split(":");
const returnUrl = window.location.origin + '/palmistry/payment';
return (
<div className="payment-screen">
<div className="payment-screen__header">
@ -257,7 +256,7 @@ export default function PaymentScreen() {
<PaymentModalNew
setHeight={setHeight}
activeProduct={activeProductFromStore}
returnUrl={returnUrl}
returnUrl={window.location.href}
placementKey={EPlacementKeys["aura.placement.palmistry.main"]}
/>
)}

View File

@ -78,14 +78,12 @@ export default function StepsManager() {
)}
<main className="steps-manager__main">
{(nonSliderSteps.includes(steps.current as Step) || steps.current === Step.Paywall) && (
<div style={steps.current === Step.Paywall ? {visibility: 'hidden', position: 'absolute'} : {}}>
<PalmistryContainerWrapper currentStep={steps.current as Step}>
{[Step.Paywall, Step.Payment].includes(steps.current as Step) && <PaymentScreen />}
{steps.current === Step.Discount && <DiscountScreen/>}
{steps.current === Step.PremiumBundle && <PremiumBundleScreen/>}
</PalmistryContainerWrapper>
</div>
{nonSliderSteps.includes(steps.current as Step) && (
<PalmistryContainerWrapper currentStep={steps.current as Step}>
{steps.current === Step.Payment && <PaymentScreen />}
{steps.current === Step.Discount && <DiscountScreen />}
{steps.current === Step.PremiumBundle && <PremiumBundleScreen />}
</PalmistryContainerWrapper>
)}
{!nonSliderSteps.includes(steps.current as Step) && (