@@ -17,6 +17,10 @@ import RelationalLinks from '@/components/shared/sections/RelationalLinks';
1717import AnimatedHeroSection from '@/components/shared/HeroSections/AnimatedHeroSection' ;
1818import { Check } from '@phosphor-icons/react' ;
1919import Link from 'next/link' ;
20+ import { PricingSectionWrapper } from '@/components/shared/pricing/PricingSectionWrapper' ;
21+ import { stripeService } from '@/services/stripe.service' ;
22+ import { PromoCodeName } from '@/lib/types' ;
23+ import usePricing from '@/hooks/usePricing' ;
2024
2125
2226interface PrivacyProps {
@@ -38,7 +42,7 @@ const CloudStorageBackupSolutions = ({
3842 relationalLinksText,
3943} : PrivacyProps ) : JSX . Element => {
4044 const metatags = metatagsDescriptions . filter ( ( desc ) => desc . id === 'internxt-cloud-storage-backup-solutions' ) ;
41- const CTA_URL = `/pricing ` ;
45+ const CTA_URL = `#billingButtons ` ;
4246 const cardsData : FeatureCard [ ] = [
4347 {
4448 title : textContent . FeatureSection . cards . element1 . title ,
@@ -61,20 +65,61 @@ const CloudStorageBackupSolutions = ({
6165 image : '/images/cloud-storage-backup-solutions/internxt_cross_platforms.webp' ,
6266 } ,
6367 ] ;
64- const products = [
68+ const product = [
6569 {
6670 imageUrl : '/images/cloud-storage-backup-solutions/internxt_drive.webp' ,
6771 animationDirection : 'left' ,
68- redirect : '/drive ' ,
72+ redirect : '#billingButtons ' ,
6973 textContent : textContent . WhatWeDo . square1 ,
7074 } ,
7175 {
7276 imageUrl : '/images/cloud-storage-backup-solutions/internxt_s3.webp' ,
7377 animationDirection : 'left' ,
74- redirect : '/cloud-object-storage' ,
78+ redirect : '/cloud-object-storage/checkout ' ,
7579 textContent : textContent . WhatWeDo . square2 ,
7680 } ,
7781 ] ;
82+
83+ const {
84+ products,
85+ loadingCards,
86+ currencyValue,
87+ coupon : individualCoupon ,
88+ lifetimeCoupon,
89+ lifetimeCoupons,
90+ } = usePricing ( { couponCode : PromoCodeName . seolp , couponCodeForLifetime : PromoCodeName . seolp } ) ;
91+
92+ const decimalDiscountForLifetime = lifetimeCoupon ?. percentOff && 100 - lifetimeCoupon . percentOff ;
93+ const decimalDiscount = individualCoupon ?. percentOff && 100 - individualCoupon . percentOff ;
94+
95+ const onCheckoutButtonClicked = async (
96+ priceId : string ,
97+ isCheckoutForLifetime : boolean ,
98+ interval : string ,
99+ storage : string ,
100+ ) => {
101+ const couponCodeForCheckout = isCheckoutForLifetime ? lifetimeCoupon : individualCoupon ;
102+
103+ const finalPrice = await stripeService . calculateFinalPrice (
104+ priceId ,
105+ interval ,
106+ currencyValue ,
107+ 'individuals' ,
108+ couponCodeForCheckout ,
109+ ) ;
110+
111+ stripeService . redirectToCheckout (
112+ priceId ,
113+ finalPrice ,
114+ currencyValue ,
115+ 'individual' ,
116+ isCheckoutForLifetime ,
117+ interval ,
118+ storage ,
119+ couponCodeForCheckout ?. name ,
120+ ) ;
121+ } ;
122+
78123 return (
79124 < >
80125 < Script type = "application/ld+json" strategy = "beforeInteractive" >
@@ -115,7 +160,7 @@ const CloudStorageBackupSolutions = ({
115160 ) ) }
116161 </ div >
117162 < Link
118- href = { '/pricing ' }
163+ href = { '#billingButtons ' }
119164 className = { `z-10 mb-10 flex w-max justify-center rounded-lg bg-primary px-6 py-3 text-base font-medium text-white hover:bg-primary-dark lg:text-xl` }
120165 >
121166 { textContent . HeroSection . TitleAndOnePlan . claimDeal }
@@ -130,7 +175,7 @@ const CloudStorageBackupSolutions = ({
130175 subtitle = { textContent . FeatureSection . titleLine2 }
131176 description = { textContent . FeatureSection . description }
132177 ctaText = { textContent . FeatureSection . cta }
133- ctaLink = "/signup "
178+ ctaLink = "#billingButtons "
134179 cards = { cardsData }
135180 />
136181 { textContent . NewBlock1 && (
@@ -142,6 +187,24 @@ const CloudStorageBackupSolutions = ({
142187 </ div >
143188 ) }
144189
190+ < PricingSectionWrapper
191+ textContent = { textContent . tableSection }
192+ decimalDiscount = { {
193+ individuals : decimalDiscount ,
194+ lifetime : decimalDiscountForLifetime ,
195+ } }
196+ lifetimeCoupons = { lifetimeCoupons }
197+ lang = { lang }
198+ products = { products }
199+ loadingCards = { loadingCards }
200+ onCheckoutButtonClicked = { onCheckoutButtonClicked }
201+ hideBusinessCards
202+ hideBusinessSelector
203+ popularPlanBySize = "5TB"
204+ sectionDetails = "bg-white lg:py-20"
205+ hideFreeCard
206+ />
207+
145208 < CtaSection
146209 textContent = { textContent . CtaSection1 }
147210 url = { CTA_URL }
@@ -165,7 +228,7 @@ const CloudStorageBackupSolutions = ({
165228 customDescription = { < p className = "w-full text-xl font-normal" > { textContent . CtaSection2 . description } </ p > }
166229 />
167230
168- < WhatWeDo textContent = { textContent . WhatWeDo } lang = { lang } products = { products } />
231+ < WhatWeDo textContent = { textContent . WhatWeDo } lang = { lang } products = { product } />
169232
170233 < FAQSection textContent = { textContent . FaqSection } />
171234
0 commit comments