Skip to content

Commit e1037c5

Browse files
authored
added pricing table
1 parent 5be6251 commit e1037c5

13 files changed

Lines changed: 847 additions & 52 deletions

‎src/components/webdav/WebDAVSupportSection.tsx‎

Lines changed: 63 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,54 @@ import ReactMarkdown from 'react-markdown';
22
import RenderDescription from '../shared/RenderDescription';
33
import SignUpBanner from '../banners/SignUpBanner';
44
import FaqAccordion from '../shared/FAQAccordion';
5+
import { PricingSectionWrapper } from '@/components/shared/pricing/PricingSectionWrapper';
6+
import { stripeService } from '@/services/stripe.service';
7+
import { PromoCodeName } from '@/lib/types';
8+
import usePricing from '@/hooks/usePricing';
59

6-
export const WebDAVSupportSection = ({ textContent }) => {
10+
export const WebDAVSupportSection = ({ textContent, lang }) => {
711
const bannerLang = require('../../assets/lang/en/banners.json');
812

13+
const {
14+
products,
15+
loadingCards,
16+
currencyValue,
17+
coupon: individualCoupon,
18+
lifetimeCoupon,
19+
lifetimeCoupons,
20+
} = usePricing({ couponCode: PromoCodeName.seolp, couponCodeForLifetime: PromoCodeName.seolp });
21+
22+
const decimalDiscountForLifetime = lifetimeCoupon?.percentOff && 100 - lifetimeCoupon.percentOff;
23+
const decimalDiscount = individualCoupon?.percentOff && 100 - individualCoupon.percentOff;
24+
25+
const onCheckoutButtonClicked = async (
26+
priceId: string,
27+
isCheckoutForLifetime: boolean,
28+
interval: string,
29+
storage: string,
30+
) => {
31+
const couponCodeForCheckout = isCheckoutForLifetime ? lifetimeCoupon : individualCoupon;
32+
33+
const finalPrice = await stripeService.calculateFinalPrice(
34+
priceId,
35+
interval,
36+
currencyValue,
37+
'individuals',
38+
couponCodeForCheckout,
39+
);
40+
41+
stripeService.redirectToCheckout(
42+
priceId,
43+
finalPrice,
44+
currencyValue,
45+
'individual',
46+
isCheckoutForLifetime,
47+
interval,
48+
storage,
49+
couponCodeForCheckout?.name,
50+
);
51+
};
52+
953
return (
1054
<section
1155
className="overflow-hidden bg-white px-5 py-20"
@@ -37,6 +81,24 @@ export const WebDAVSupportSection = ({ textContent }) => {
3781
</div>
3882
</div>
3983
</div>
84+
<PricingSectionWrapper
85+
textContent={textContent.tableSection}
86+
decimalDiscount={{
87+
individuals: decimalDiscount,
88+
lifetime: decimalDiscountForLifetime,
89+
}}
90+
lifetimeCoupons={lifetimeCoupons}
91+
lang={lang}
92+
products={products}
93+
loadingCards={loadingCards}
94+
onCheckoutButtonClicked={onCheckoutButtonClicked}
95+
hideBusinessCards
96+
hideBusinessSelector
97+
popularPlanBySize="5TB"
98+
sectionDetails="bg-white lg:py-20"
99+
hideFreeCard
100+
backgroundGradientColor='linear-gradient(360deg, #F4F8FF 0%, #FFFFFF 100%)'
101+
/>
40102
<SignUpBanner textContent={bannerLang.SignUpWebDAVBanner} lang="en" />
41103
<div className="flex w-full flex-col space-y-2 lg:max-w-[850px] lg:pt-10">
42104
{textContent.questions.map((item) => (

‎src/pages/cloud-storage-backup-solutions.tsx‎

Lines changed: 70 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,10 @@ import RelationalLinks from '@/components/shared/sections/RelationalLinks';
1717
import AnimatedHeroSection from '@/components/shared/HeroSections/AnimatedHeroSection';
1818
import { Check } from '@phosphor-icons/react';
1919
import 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

2226
interface 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

‎src/pages/cloud-storage-comparison.tsx‎

Lines changed: 64 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,13 @@ import CtaSection from '@/components/shared/CtaSection';
1515
import { ComparisonHeader } from '@/components/comparison/ComparisonHeader';
1616
import { Eye, Fingerprint, LockKey, ShieldCheck } from '@phosphor-icons/react';
1717
import InfoSection from '@/components/shared/sections/InfoSection';
18+
import { PricingSectionWrapper } from '@/components/shared/pricing/PricingSectionWrapper';
19+
import { stripeService } from '@/services/stripe.service';
20+
import { PromoCodeName } from '@/lib/types';
21+
import usePricing from '@/hooks/usePricing';
1822

1923

20-
const URL_REDIRECT = 'https://internxt.com/specialoffer';
24+
const URL_REDIRECT = '#billingButtons';
2125

2226
const CloudStorageComparison = ({ metatagsDescriptions, langJson, navbarLang, footerLang, lang }) => {
2327
const metatags = metatagsDescriptions.filter((desc) => desc.id === 'comparison');
@@ -45,6 +49,46 @@ const CloudStorageComparison = ({ metatagsDescriptions, langJson, navbarLang, fo
4549
},
4650
];
4751

52+
const {
53+
products,
54+
loadingCards,
55+
currencyValue,
56+
coupon: individualCoupon,
57+
lifetimeCoupon,
58+
lifetimeCoupons,
59+
} = usePricing({ couponCode: PromoCodeName.seolp, couponCodeForLifetime: PromoCodeName.seolp });
60+
61+
const decimalDiscountForLifetime = lifetimeCoupon?.percentOff && 100 - lifetimeCoupon.percentOff;
62+
const decimalDiscount = individualCoupon?.percentOff && 100 - individualCoupon.percentOff;
63+
64+
const onCheckoutButtonClicked = async (
65+
priceId: string,
66+
isCheckoutForLifetime: boolean,
67+
interval: string,
68+
storage: string,
69+
) => {
70+
const couponCodeForCheckout = isCheckoutForLifetime ? lifetimeCoupon : individualCoupon;
71+
72+
const finalPrice = await stripeService.calculateFinalPrice(
73+
priceId,
74+
interval,
75+
currencyValue,
76+
'individuals',
77+
couponCodeForCheckout,
78+
);
79+
80+
stripeService.redirectToCheckout(
81+
priceId,
82+
finalPrice,
83+
currencyValue,
84+
'individual',
85+
isCheckoutForLifetime,
86+
interval,
87+
storage,
88+
couponCodeForCheckout?.name,
89+
);
90+
};
91+
4892
return (
4993
<>
5094
<Script type="application/ld+json" strategy="beforeInteractive">
@@ -68,6 +112,25 @@ const CloudStorageComparison = ({ metatagsDescriptions, langJson, navbarLang, fo
68112

69113
<FeatureSection textContent={langJson.FeatureSection} />
70114

115+
<PricingSectionWrapper
116+
textContent={langJson.tableSection}
117+
decimalDiscount={{
118+
individuals: decimalDiscount,
119+
lifetime: decimalDiscountForLifetime,
120+
}}
121+
lifetimeCoupons={lifetimeCoupons}
122+
lang={lang}
123+
products={products}
124+
loadingCards={loadingCards}
125+
onCheckoutButtonClicked={onCheckoutButtonClicked}
126+
hideBusinessCards
127+
hideBusinessSelector
128+
popularPlanBySize="5TB"
129+
sectionDetails="bg-white lg:py-20"
130+
hideFreeCard
131+
132+
/>
133+
71134
<InfoSection textContent={langJson.InfoSection} lang={lang} redirect="/privacy" cards={cardsData} />
72135

73136
<ThirdFeaturesSection textContent={langJson.ThirdFeaturesSection} />

0 commit comments

Comments
 (0)