From b5891942a291b1464df90e6d20d3c5949d899130 Mon Sep 17 00:00:00 2001 From: Xavier Abad <77491413+masterprog-cmd@users.noreply.github.com> Date: Wed, 26 Jun 2024 18:59:48 +0200 Subject: [PATCH 01/10] feat: add husky --- package.json | 2 ++ yarn.lock | 5 +++++ 2 files changed, 7 insertions(+) diff --git a/package.json b/package.json index 7ba8cf43c..9099815b2 100644 --- a/package.json +++ b/package.json @@ -7,6 +7,7 @@ "preinstall": "node ./scripts/use-yarn.js", "find:unused": "next-unused", "prebuild": "node ./scripts/check-envs.js", + "postinstall": "husky", "dev": "yarn && next dev -p 3001", "dev:tw": "TAILWIND_MODE=watch tailwindcss -o src/tailwind.css --watch", "build": "node ./scripts/check-envs.js && next build", @@ -73,6 +74,7 @@ "babel-plugin-istanbul": "^6.1.1", "cypress": "^13.11.0", "eslint": "^7.32.0", + "husky": "^9.0.11", "next-unused": "^0.0.6", "postcss": "8.4.31", "prettier": "2.7.1", diff --git a/yarn.lock b/yarn.lock index 454f6b28a..4cba0cd76 100644 --- a/yarn.lock +++ b/yarn.lock @@ -4610,6 +4610,11 @@ human-signals@^1.1.1: resolved "https://registry.yarnpkg.com/human-signals/-/human-signals-1.1.1.tgz#c5b1cd14f50aeae09ab6c59fe63ba3395fe4dfa3" integrity sha512-SEQu7vl8KjNL2eoGBLF3+wAjpsNfA9XMlXAYj/3EdaNfAlxKthD1xjEQfGOUhllCGGJVNY34bRr6lPINhNjyZw== +husky@^9.0.11: + version "9.0.11" + resolved "https://registry.yarnpkg.com/husky/-/husky-9.0.11.tgz#fc91df4c756050de41b3e478b2158b87c1e79af9" + integrity sha512-AB6lFlbwwyIqMdHYhwPe+kjOC3Oc5P3nThEoW/AaO2BX3vJDjWPFxYLxokUZOo6RNX20He3AaT8sESs9NJcmEw== + idb-keyval@^6.2.0: version "6.2.1" resolved "https://registry.yarnpkg.com/idb-keyval/-/idb-keyval-6.2.1.tgz#94516d625346d16f56f3b33855da11bfded2db33" From 9b4ce90378520f1f5bcaf1858af9dadecc2ccf9e Mon Sep 17 00:00:00 2001 From: Xavier Abad <77491413+masterprog-cmd@users.noreply.github.com> Date: Wed, 26 Jun 2024 19:19:12 +0200 Subject: [PATCH 02/10] feat: update Action name --- .github/workflows/pre-build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pre-build.yml b/.github/workflows/pre-build.yml index f1bcb2090..cb9815301 100644 --- a/.github/workflows/pre-build.yml +++ b/.github/workflows/pre-build.yml @@ -23,5 +23,5 @@ jobs: - name: Install dependencies run: yarn install - - name: Build project + - name: Build project before deployment run: yarn build From b693cef9bf55c4fbbf0e8cce6aacf3baa92c3181 Mon Sep 17 00:00:00 2001 From: Xavier Abad <77491413+masterprog-cmd@users.noreply.github.com> Date: Thu, 27 Jun 2024 08:45:08 +0200 Subject: [PATCH 03/10] feat: add pre-commit script (husky) --- .husky/pre-commit | 1 + package.json | 7 +++++-- 2 files changed, 6 insertions(+), 2 deletions(-) create mode 100755 .husky/pre-commit diff --git a/.husky/pre-commit b/.husky/pre-commit new file mode 100755 index 000000000..8f56d750c --- /dev/null +++ b/.husky/pre-commit @@ -0,0 +1 @@ +yarn build diff --git a/package.json b/package.json index 9099815b2..ea026143c 100644 --- a/package.json +++ b/package.json @@ -7,7 +7,6 @@ "preinstall": "node ./scripts/use-yarn.js", "find:unused": "next-unused", "prebuild": "node ./scripts/check-envs.js", - "postinstall": "husky", "dev": "yarn && next dev -p 3001", "dev:tw": "TAILWIND_MODE=watch tailwindcss -o src/tailwind.css --watch", "build": "node ./scripts/check-envs.js && next build", @@ -15,7 +14,11 @@ "prod": "next export", "cypress:open": "cypress open", "cypress:run": "cypress run --browser chrome", - "lint": "eslint './**/*.{js,ts,tsx}'" + "lint": "eslint './**/*.{js,ts,tsx}'", + "postinstall": "husky", + "prepack": "pinst --disable", + "postpack": "pinst --enable", + "prepare": "husky" }, "dependencies": { "@coderosh/images-to-pdf": "^2.1.0", From 345d791ba1396c4432ce176d62bb91bb003c26eb Mon Sep 17 00:00:00 2001 From: Xavier Abad <77491413+masterprog-cmd@users.noreply.github.com> Date: Fri, 28 Jun 2024 09:32:00 +0200 Subject: [PATCH 04/10] feat: add eslint to the build process --- .eslintrc.json | 9 +- package.json | 3 + src/components/Snackbar.tsx | 1 - .../CtaSection.tsx | 12 +- .../HeroSection.tsx | 4 +- src/components/banners/LoginBFBanner.tsx | 8 +- src/components/banners/WheelBanner.tsx | 113 ------- .../banners/components/WheelComponent.tsx | 148 --------- src/components/components/Countdown.tsx | 17 +- src/components/dealfuel/PriceCard.tsx | 23 +- src/components/dealfuel/PriceTable.tsx | 4 - src/components/home/InfoSection.tsx | 2 - src/components/home/SocialProofSection.tsx | 1 - src/components/home/TestimonialsSection.tsx | 9 +- src/components/home/ThirdFeaturesSection.tsx | 22 +- src/components/home/components/FileItem.tsx | 14 +- src/components/home/components/Label.tsx | 7 +- .../components/heroSection/TitleAndSignup.tsx | 6 +- .../components/heroSection/TitleAndSurvey.tsx | 8 +- src/components/layout/BFBanner.tsx | 113 ------- src/components/layout/Layout.tsx | 10 +- src/components/layout/ProductsNavigation.tsx | 12 +- .../layout/components/LanguageBox.tsx | 51 ++- .../components/navbar/ItemsNavigation.tsx | 244 +++++++------- src/components/layout/footers/Footer.tsx | 44 ++- .../layout/footers/MinimalFooter.tsx | 4 +- .../layout/navbars/MinimalNavbar.tsx | 2 +- src/components/layout/navbars/Navbar.tsx | 40 +-- .../legal/TermsAndConditionsOverview.tsx | 11 +- .../legal/components/SelectSection.tsx | 14 +- src/components/lifetime/CtaSection.tsx | 2 +- src/components/lifetime/HeroSection.tsx | 4 +- .../lifetime/PriceBannerForCampaigns.tsx | 2 +- .../lifetime/celebration/HeroSection.tsx | 2 +- src/components/media-area/KitSection.tsx | 2 +- .../newsletter/MakePrivacySection.tsx | 44 +-- .../partner-discount/HeroSection.tsx | 12 +- .../partner-discount/InfoSection.tsx | 12 +- .../partner-discount/PaymentSection.tsx | 7 +- .../partnerships/freemonth/FeatureSection.js | 121 ------- .../partnerships/freemonth/HeroSection.js | 50 --- .../partnerships/freemonth/PriceCard.js | 306 ------------------ .../partnerships/guru99/FeatureSection.js | 121 ------- .../partnerships/guru99/HeroSection.js | 87 ----- .../partnerships/guru99/PriceCard.js | 304 ----------------- .../password-checker/FeaturesSection.tsx | 17 +- .../password-checker/HeroSection.tsx | 14 +- .../password-generator/HeroSection.tsx | 11 +- .../password-generator/InfoSection.tsx | 10 +- .../components/CheckboxSettings.tsx | 12 +- .../components/PasswordSettings.tsx | 12 +- .../password-generator/utils/index.ts | 2 +- .../prices/CyberAwarenessSpecialCard.tsx | 16 +- src/components/prices/FreePlanCard.tsx | 6 +- src/components/prices/PriceCard.tsx | 10 +- src/components/prices/PriceTable.tsx | 8 +- src/components/prices/SpecialPriceCard.tsx | 8 +- src/components/pricing/BestStorageSection.tsx | 7 +- src/components/pricing/CtaSection.tsx | 8 +- src/components/pricing/HeroSection.tsx | 6 +- .../privacy-directory/HeroSection2.tsx | 5 +- .../privacy-directory/SupportNGOsSection.tsx | 3 +- .../privacy/BetterTomorrowSection.tsx | 7 +- src/components/privacy/FeatureSection.tsx | 8 +- src/components/privacy/HeroSection.tsx | 8 +- src/components/privacy/HeroSection2.tsx | 8 +- src/components/privacy/InxtAppsSection.tsx | 7 +- src/components/privacy/ManifestoSection.tsx | 11 +- src/components/privacy/ManifestoSection2.tsx | 11 +- src/components/privacy/SecuritumSection.tsx | 6 +- src/components/services/stripe.service.ts | 2 +- .../shared/CommandTextInputCopy.tsx | 4 +- .../shared/CompanyLogosRecognitions.tsx | 2 +- src/components/shared/DownloadComponent.tsx | 4 +- src/components/shared/DropArea.tsx | 2 +- src/components/shared/FaqSection.tsx | 2 +- src/components/shared/Header.tsx | 11 +- src/components/shared/HeroSectionSafeArea.tsx | 14 +- src/components/shared/ProductCard.tsx | 52 ++- src/components/shared/RedirectButton.tsx | 2 +- src/components/shared/RenderDescription.tsx | 7 +- src/components/shared/StarsRate.tsx | 2 +- src/components/shared/ToolsSection.tsx | 7 +- .../specialoffer/MarqueeComponent.tsx | 2 +- .../specialoffer/WhatWeDoSection.tsx | 2 +- .../success-stories/HeroSection.tsx | 6 +- src/components/success-stories/WhatWeDo.tsx | 7 +- .../techradar-discount/HeroSection.tsx | 16 +- .../techradar-discount/InfoSection.tsx | 7 +- .../techradar-discount/PaymentsSection.tsx | 6 +- src/components/temp-email/HeroSection.tsx | 6 +- src/components/temp-email/InfoSection.tsx | 12 +- src/components/temp-email/SignupSection.tsx | 19 +- .../temp-email/components/EmailToolBar.tsx | 81 +++-- .../temp-email/components/InboxView.tsx | 2 +- .../temp-email/components/Messages.tsx | 48 +-- .../temp-email/services/icon-service.ts | 2 +- .../utils/schema-markup-generator.ts | 4 +- .../virus-scanner/BannersSection.tsx | 11 +- src/components/virus-scanner/CtaSection.tsx | 7 +- .../virus-scanner/FeaturesSection.tsx | 6 +- src/components/virus-scanner/HeroSection.tsx | 6 +- src/components/vpn-extension/HeroSection.tsx | 8 +- .../vpn-extension/SecureVPNSection.tsx | 2 +- src/components/webdav/HowToUseCLISection.tsx | 2 +- .../webdav/WebDAVSupportSection.tsx | 2 +- src/lib/analytics.ts | 11 +- src/lib/auth.ts | 1 + src/lib/brave.ts | 4 +- src/lib/{checker.js => checker.ts} | 24 +- src/lib/{gtag.js => gtag.ts} | 0 src/pages/_app.tsx | 2 +- src/pages/about.tsx | 5 +- src/pages/affiliates/[filename].tsx | 13 +- src/pages/affiliates/index.tsx | 11 +- src/pages/annual.tsx | 3 +- src/pages/b.tsx | 3 +- src/pages/black-friday.tsx | 5 +- src/pages/byte-converter.tsx | 7 +- src/pages/cloud-storage-comparison.tsx | 7 +- src/pages/cloud-storage-for-education.tsx | 3 +- src/pages/cloudwards.tsx | 11 +- src/pages/cyber-awareness.tsx | 7 +- src/pages/cyber-security-quiz.tsx | 9 +- src/pages/dealfuel.tsx | 17 +- src/pages/dealmirror.tsx | 17 +- src/pages/drive.tsx | 7 +- src/pages/file-converter/[filename].tsx | 5 +- src/pages/file-converter/index.tsx | 3 +- src/pages/freemonth.tsx | 52 --- src/pages/index.tsx | 3 +- src/pages/legal.tsx | 3 +- src/pages/lifetime/celebration/[filename].tsx | 7 +- src/pages/lifetime/index.tsx | 9 +- src/pages/lifetime_special.tsx | 5 +- src/pages/locker.tsx | 11 +- src/pages/media-area.tsx | 11 +- src/pages/mightydeals.tsx | 21 +- src/pages/newsletter-subscribe.tsx | 11 +- src/pages/open-source.tsx | 5 +- src/pages/partner-discount.tsx | 14 +- src/pages/password-checker.tsx | 13 +- src/pages/password-generator.tsx | 7 +- src/pages/pccomponentes-products.tsx | 11 +- src/pages/pcloud-alternative.tsx | 3 +- src/pages/pricing.tsx | 7 +- src/pages/privacy-directory.tsx | 7 +- src/pages/privacy.tsx | 11 +- src/pages/{sitemap.xml.js => sitemap.xml.ts} | 0 src/pages/specialoffer/freeuser.tsx | 3 +- src/pages/stackcommerce.tsx | 40 ++- src/pages/startpage.tsx | 27 +- src/pages/techradar-discount.tsx | 29 +- src/pages/temporary-email.tsx | 8 +- src/pages/virus-scanner.tsx | 27 +- src/pages/vpn.tsx | 22 +- src/pages/webdav.tsx | 11 +- src/pages/what-does-google-know-about-me.tsx | 15 +- tests/redeem-codes.test.ts | 25 +- yarn.lock | 48 +++ 160 files changed, 1081 insertions(+), 2188 deletions(-) delete mode 100644 src/components/banners/WheelBanner.tsx delete mode 100644 src/components/banners/components/WheelComponent.tsx delete mode 100644 src/components/layout/BFBanner.tsx delete mode 100644 src/components/partnerships/freemonth/FeatureSection.js delete mode 100644 src/components/partnerships/freemonth/HeroSection.js delete mode 100644 src/components/partnerships/freemonth/PriceCard.js delete mode 100644 src/components/partnerships/guru99/FeatureSection.js delete mode 100644 src/components/partnerships/guru99/HeroSection.js delete mode 100644 src/components/partnerships/guru99/PriceCard.js rename src/lib/{checker.js => checker.ts} (71%) rename src/lib/{gtag.js => gtag.ts} (100%) delete mode 100644 src/pages/freemonth.tsx rename src/pages/{sitemap.xml.js => sitemap.xml.ts} (100%) diff --git a/.eslintrc.json b/.eslintrc.json index 5e621e651..95826e251 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -1,10 +1,15 @@ +// TODO: Add next core-web-vitals. E.g. "extends": ["next/core-web-vitals"] + { "extends": ["eslint:recommended", "plugin:@typescript-eslint/recommended", "prettier"], "rules": { - "quotes": ["error", "single"], + "quotes": ["warn", "single"], "semi": ["error", "always"], "linebreak-style": ["error", "unix"], "no-console": "off", - "max-len": "off" + "max-len": "off", + "@typescript-eslint/no-var-requires": "off", + "@typescript-eslint/no-empty-function": "off", + "no-async-promise-executor": "warn" } } diff --git a/package.json b/package.json index 73edf782b..63c41c884 100644 --- a/package.json +++ b/package.json @@ -77,10 +77,13 @@ "babel-plugin-istanbul": "^6.1.1", "cypress": "^13.12.0", "eslint": "^7.32.0", + "eslint-config-prettier": "^9.1.0", + "eslint-plugin-prettier": "^5.1.3", "husky": "^9.0.11", "next-unused": "^0.0.6", "postcss": "8.4.31", "prettier": "2.7.1", + "prettier-plugin-organize-imports": "^3.2.4", "prettier-plugin-tailwindcss": "0.1.13", "reset-css": "5.0.1", "sass": "1.41.0", diff --git a/src/components/Snackbar.tsx b/src/components/Snackbar.tsx index 3a684dbc8..40af755d1 100644 --- a/src/components/Snackbar.tsx +++ b/src/components/Snackbar.tsx @@ -1,4 +1,3 @@ -import React from 'react'; import { toast, ToastContainer } from 'react-toastify'; import 'react-toastify/dist/ReactToastify.css'; diff --git a/src/components/annual-plans-for-affiliates/CtaSection.tsx b/src/components/annual-plans-for-affiliates/CtaSection.tsx index 8facc216b..e77363af5 100644 --- a/src/components/annual-plans-for-affiliates/CtaSection.tsx +++ b/src/components/annual-plans-for-affiliates/CtaSection.tsx @@ -2,10 +2,12 @@ const PRICE_TABLE_ID = 'pricing-table'; const CtaSection = ({ textContent }: { textContent: any }) => { function redirectToPricingTable() { - window.scrollTo({ - top: document?.getElementById(PRICE_TABLE_ID)?.offsetTop! + 500, - behavior: 'smooth', - }); + if (document.getElementById(PRICE_TABLE_ID)) { + window.scrollTo({ + top: document.getElementById(PRICE_TABLE_ID)!.offsetTop + 500, + behavior: 'smooth', + }); + } } return ( @@ -16,7 +18,7 @@ const CtaSection = ({ textContent }: { textContent: any }) => { className="overflow-hidden bg-primary bg-cover px-5 py-14" >
-
+

{textContent.title}

{textContent.description}

diff --git a/src/components/annual-plans-for-affiliates/HeroSection.tsx b/src/components/annual-plans-for-affiliates/HeroSection.tsx index 662e958b3..851aa5e14 100644 --- a/src/components/annual-plans-for-affiliates/HeroSection.tsx +++ b/src/components/annual-plans-for-affiliates/HeroSection.tsx @@ -17,7 +17,7 @@ const StartPageLabel = () => { Internxt logo { const HeroSection: React.FC = ({ textContent, InfoTextComponent, isStartPage }) => { function redirectToPricingTable() { window.scrollTo({ - top: document?.getElementById('payment')?.offsetTop! + 500, + top: document?.getElementById('payment')!.offsetTop + 500, behavior: 'smooth', }); } diff --git a/src/components/banners/LoginBFBanner.tsx b/src/components/banners/LoginBFBanner.tsx index 00ff6604b..32e7fce65 100644 --- a/src/components/banners/LoginBFBanner.tsx +++ b/src/components/banners/LoginBFBanner.tsx @@ -60,7 +60,7 @@ const LoginBFBanner = () => { if (showBanner) { window.dispatchEvent(new Event('CloseSquare')); } - if (Boolean(hideBanner)) { + if (hideBanner) { setShowBanner(false); } window.addEventListener('unload', function (e) { @@ -133,9 +133,11 @@ const LoginBFBanner = () => { }; return showBanner ? ( -
+
- {view === 'wheel' ? ( - setView('congratulations')} setResult={setResult} /> - ) : view === 'congratulations' ? ( -
-
-

Congratulations!

-

Choose your plan and activate your offer with code:

-
-
-
- -
- -
-
- -

- Go to the pricing page and choose your subscription to activate your discount. -

-
-
- ) : null} -
- - ); -}; - -export default WheelBanner; diff --git a/src/components/banners/components/WheelComponent.tsx b/src/components/banners/components/WheelComponent.tsx deleted file mode 100644 index a66f5db88..000000000 --- a/src/components/banners/components/WheelComponent.tsx +++ /dev/null @@ -1,148 +0,0 @@ -import { LockKey, WarningCircle } from '@phosphor-icons/react'; -import TextInput from '@/components/components/TextInput'; -import CheckboxItem from '@/components/shared/CheckboxItem'; -import { useEffect, useState } from 'react'; -import { Roulette, useRoulette } from 'react-hook-roulette'; -import axios, { AxiosError } from 'axios'; - -const WheelComponent = ({ onViewChange, setResult }) => { - const [email, setEmail] = useState(''); - const [firstCheckbox, setFirstCheckbox] = useState(false); - const [error, setError] = useState(false); - - const items = [ - { name: '10% OFF', bg: '#001D6C' }, - { name: '15% OFF', bg: '#002D9C' }, - { name: '25% OFF', bg: '#0043CE' }, - { name: '30% OFF', bg: '#0066FF' }, - { name: '45% OFF', bg: '#4589FF' }, - { name: '50% OFF', bg: '#78A9FF' }, - ]; - const { roulette, onStart, onStop, result } = useRoulette({ - items, - options: { - size: 300, - style: { - label: { - defaultColor: '#fff', - }, - }, - }, - }); - - // Stop the roulette after random seconds between 4 and 6 seconds - useEffect(() => { - setTimeout(() => { - onStop(); - }, Math.floor(Math.random() * 2000) + 4000); - }, [onStart]); - - useEffect(() => { - if (result) { - setResult(result); - onViewChange('congratulations'); - } - }, [result]); - - useEffect(() => { - if (error) { - setTimeout(() => { - setError(false); - }, 3000); - } - }, [error]); - - const onEmailInputChange = (e) => { - setEmail(e.target.value); - }; - - const onCheckboxChange = () => { - setFirstCheckbox(!firstCheckbox); - }; - - const handleOnButtonClick = (e) => { - e.preventDefault(); - axios - .post('/api/authenticate', { - userEmail: email, - }) - .then(() => { - setError(true); - }) - .catch((error: AxiosError) => { - if (error.response?.status === 404 || error.response?.status === 403) { - onStart(); - } else { - console.error('[ERROR]: ', 'You are not authorized to access this resource'); - } - }); - }; - - return ( -
-
- {/* Icon */} -
- -
- {/* Text */} -
-

Safer Internet Day!

-

Subscribe, spin, and save on a subscription of your choice!*

-
-
-

*Offer is for free accounts or new customers

-
-
- {/* Wheel and mobile view */} -
- {/* Title */} -
-

Safer Internet Day!

-

Spin, save, and secure your data!

-
-
- -
- {/* Text input and button */} -
- - {error && ( -
- -

Offer unavailable for paid users

-
- )} - - - {/* Checkbox and privacy policy */} -
- -
-

*Offer is for free accounts or new customers

-
-
-
-
- ); -}; - -export default WheelComponent; diff --git a/src/components/components/Countdown.tsx b/src/components/components/Countdown.tsx index 5059db0bb..d808fbf23 100644 --- a/src/components/components/Countdown.tsx +++ b/src/components/components/Countdown.tsx @@ -28,7 +28,6 @@ const Countdown: React.FC = ({ textColor, dt }) => { const minute = second * 60; const hour = minute * 60; const day = hour * 24; - let timer: NodeJS.Timeout; const showRemaining = () => { const now = new Date(); @@ -48,7 +47,7 @@ const Countdown: React.FC = ({ textColor, dt }) => { setSeconds(seconds); }; - timer = setInterval(showRemaining, 1000); + const timer = setInterval(showRemaining, 1000); return () => clearInterval(timer); }; @@ -81,19 +80,19 @@ const Countdown: React.FC = ({ textColor, dt }) => { return (
-
+
{days < 10 ? `0${days}` : days}
-

:

-
+

:

+
{hours < 10 ? `0${hours}` : hours}
-

:

-
+

:

+
{minutes < 10 ? `0${minutes}` : minutes}
-

:

-
+

:

+
{seconds < 10 ? `0${seconds}` : seconds}
diff --git a/src/components/dealfuel/PriceCard.tsx b/src/components/dealfuel/PriceCard.tsx index 73844cf63..15ffb469b 100644 --- a/src/components/dealfuel/PriceCard.tsx +++ b/src/components/dealfuel/PriceCard.tsx @@ -1,11 +1,12 @@ -/* eslint-disable jsx-a11y/no-noninteractive-tabindex */ -/* eslint-disable jsx-a11y/no-static-element-interactions */ -/* eslint-disable prefer-destructuring */ -/* eslint-disable no-restricted-globals */ -/* eslint-disable no-nested-ternary */ -import React from 'react'; +interface PriceCardProps { + planType: string; + storage: string; + price: number; + country: string; + popular: boolean; +} -const PriceCard = ({ planType, storage, price, cta, country, popular }) => { +const PriceCard = ({ planType, storage, price, country, popular }: PriceCardProps): JSX.Element => { const currency = () => { switch (country) { case 'US': @@ -17,7 +18,7 @@ const PriceCard = ({ planType, storage, price, cta, country, popular }) => { } }; - const contentText = require(`../../assets/lang/en/priceCard.json`); + const contentText = require('../../assets/lang/en/priceCard.json'); return (
{ {contentText.mostPopularPlan}
-
+
{

{storage}

-
+
-

+

{currency()} {price}

diff --git a/src/components/dealfuel/PriceTable.tsx b/src/components/dealfuel/PriceTable.tsx index 141433037..dcaa376eb 100644 --- a/src/components/dealfuel/PriceTable.tsx +++ b/src/components/dealfuel/PriceTable.tsx @@ -1,4 +1,3 @@ -import React from 'react'; import PriceCard from './PriceCard'; import { Coin, CreditCard, Detective } from '@phosphor-icons/react'; @@ -89,7 +88,6 @@ const PriceTable = ({ lang, country, textContent }) => { planType="individual" storage={prices.TB2.storage} price={billingPrice(prices.TB2.price)} - cta={['checkout', 'lifetime2TB']} popular={prices.TB2.popular} country={country} /> @@ -97,7 +95,6 @@ const PriceTable = ({ lang, country, textContent }) => { planType="individual" storage={prices.TB5.storage} price={billingPrice(prices.TB5.price)} - cta={['checkout', 'lifetime5TB']} popular={prices.TB5.popular} country={country} /> @@ -105,7 +102,6 @@ const PriceTable = ({ lang, country, textContent }) => { planType="individual" storage={prices.TB10.storage} price={billingPrice(prices.TB10.price)} - cta={['checkout', 'lifetime10TB']} popular={prices.TB10.popular} country={country} /> diff --git a/src/components/home/InfoSection.tsx b/src/components/home/InfoSection.tsx index 383594507..0ade83ba4 100644 --- a/src/components/home/InfoSection.tsx +++ b/src/components/home/InfoSection.tsx @@ -1,11 +1,9 @@ -import React from 'react'; import RevealY from '@/components/components/RevealY'; import { CaretRight, Eye, Fingerprint, LockKey, ShieldCheck } from '@phosphor-icons/react'; import { useRouter } from 'next/router'; const InfoSection = ({ textContent, - lang, withoutCta, backgroundColor, redirect, diff --git a/src/components/home/SocialProofSection.tsx b/src/components/home/SocialProofSection.tsx index 68b623f60..3d1e9cc72 100644 --- a/src/components/home/SocialProofSection.tsx +++ b/src/components/home/SocialProofSection.tsx @@ -1,4 +1,3 @@ -/* eslint-disable react/jsx-no-target-blank */ import { getImage } from '@/lib/getImage'; import Image from 'next/image'; diff --git a/src/components/home/TestimonialsSection.tsx b/src/components/home/TestimonialsSection.tsx index 97cd40383..7f358dcda 100644 --- a/src/components/home/TestimonialsSection.tsx +++ b/src/components/home/TestimonialsSection.tsx @@ -2,7 +2,12 @@ import { getImage } from '@/lib/getImage'; import Image from 'next/image'; import { FiveStars } from '../shared/StarsRate'; -const AvatarAndText = ({ testimonial }) => ( +interface TestimonialsSectionProps { + textContent: Record; + bgColor?: string; +} + +const AvatarAndText = ({ testimonial }): JSX.Element => (
FixThePhoto Avatar @@ -14,7 +19,7 @@ const AvatarAndText = ({ testimonial }) => (
); -const TestimonialsSection = ({ textContent, bgColor }: { textContent: any; bgColor?: string }) => { +const TestimonialsSection = ({ textContent, bgColor }: TestimonialsSectionProps): JSX.Element => { const testimonials = [ { review: textContent.cards[0].review, diff --git a/src/components/home/ThirdFeaturesSection.tsx b/src/components/home/ThirdFeaturesSection.tsx index 6d08071f9..2f5260ef5 100644 --- a/src/components/home/ThirdFeaturesSection.tsx +++ b/src/components/home/ThirdFeaturesSection.tsx @@ -1,15 +1,21 @@ import Image from 'next/legacy/image'; import { Gift } from '@phosphor-icons/react'; -import React from 'react'; import RevealX from '@/components/components/RevealX'; +import { getImage } from '@/lib/getImage'; +import Link from 'next/link'; +import { SIGNUP_DRIVE_WEB } from '@/constants'; -const ThirdFeaturesSection = ({ textContent }) => { +interface ThirdFeaturesSectionProps { + textContent: Record; +} + +const ThirdFeaturesSection = ({ textContent }: ThirdFeaturesSectionProps): JSX.Element => { return (
{

{textContent.title}

{textContent.description}

- +
diff --git a/src/components/home/components/FileItem.tsx b/src/components/home/components/FileItem.tsx index 707283f88..adb1f9bf3 100644 --- a/src/components/home/components/FileItem.tsx +++ b/src/components/home/components/FileItem.tsx @@ -1,23 +1,19 @@ import { DotsThree } from '@phosphor-icons/react'; import moment from 'moment'; -import React from 'react'; -const FileItem = ({ - encrypted, - className, - title, - ItemImg, -}: { +interface FileItemProps { title: string; className: string; ItemImg: any; encrypted?: boolean; -}) => { +} + +const FileItem = ({ encrypted, className, title, ItemImg }: FileItemProps): JSX.Element => { const fileYear = moment().year(); return (
-
+
diff --git a/src/components/home/components/Label.tsx b/src/components/home/components/Label.tsx index 3ff91a1e5..46b534de3 100644 --- a/src/components/home/components/Label.tsx +++ b/src/components/home/components/Label.tsx @@ -1,7 +1,12 @@ import { CaretRight } from '@phosphor-icons/react'; import { useRouter } from 'next/navigation'; -export const Label = ({ label, path }) => { +interface LabelProps { + label: string; + path: string; +} + +export const Label = ({ label, path }: LabelProps): JSX.Element => { const router = useRouter(); return ( diff --git a/src/components/home/components/heroSection/TitleAndSignup.tsx b/src/components/home/components/heroSection/TitleAndSignup.tsx index 09ce36539..a2d5bc546 100644 --- a/src/components/home/components/heroSection/TitleAndSignup.tsx +++ b/src/components/home/components/heroSection/TitleAndSignup.tsx @@ -2,7 +2,11 @@ import SignUpInline from '@/components/auth/SignUpInline'; import Header from '@/components/shared/Header'; import { goToSignUpURL } from '@/lib/auth'; -export const TitleAndSignup = ({ textContent }) => { +interface TitleAndSignupProps { + textContent: Record; +} + +export const TitleAndSignup = ({ textContent }: TitleAndSignupProps): JSX.Element => { return (
diff --git a/src/components/home/components/heroSection/TitleAndSurvey.tsx b/src/components/home/components/heroSection/TitleAndSurvey.tsx index ca37cdb88..552a560f2 100644 --- a/src/components/home/components/heroSection/TitleAndSurvey.tsx +++ b/src/components/home/components/heroSection/TitleAndSurvey.tsx @@ -3,7 +3,11 @@ import Header from '@/components/shared/Header'; import { FiveStars } from '@/components/shared/StarsRate'; import { useRouter } from 'next/router'; -export const TitleAndSurvey = ({ textContent }) => { +interface TitleAndSurveyProps { + textContent: Record; +} + +export const TitleAndSurvey = ({ textContent }: TitleAndSurveyProps): JSX.Element => { const router = useRouter(); const handleOnPlanButtonClicked = () => { @@ -39,7 +43,7 @@ export const TitleAndSurvey = ({ textContent }) => { {/* // TODO: Manage the buttons logic */}
{textContent.buttonLabel.map((label) => ( -
+
))} diff --git a/src/components/layout/BFBanner.tsx b/src/components/layout/BFBanner.tsx deleted file mode 100644 index 2b66d0ae3..000000000 --- a/src/components/layout/BFBanner.tsx +++ /dev/null @@ -1,113 +0,0 @@ -import { CircleWavyCheck, X } from '@phosphor-icons/react'; -import { useState, useEffect } from 'react'; -import styles from '../black-friday/BF-HeroSection.module.scss'; -import { useRouter } from 'next/router'; -import { buttonDeal, buttonLink, BFBannerText } from '../TextWithoutJson'; - -const BFBanner = () => { - const [showBanner, setShowBanner] = useState(false); - const router = useRouter(); - const lang = router.locale; - - const handleClose = () => { - localStorage.setItem('hideBanner', 'true'); - setShowBanner(false); - }; - - useEffect(() => { - setTimeout(() => { - if (router.pathname !== '/black-friday') { - setShowBanner(true); - } - }, 20000); - }, []); - - useEffect(() => { - const hideBanner = localStorage.getItem('hideBanner'); - if (showBanner) { - window.dispatchEvent(new Event('CloseSquare')); - } - if (hideBanner) { - setShowBanner(false); - } - window.addEventListener('unload', function (e) { - e.preventDefault(); - localStorage.removeItem('hideBanner'); - }); - return () => { - window.removeEventListener('unload', () => {}); - }; - }, [showBanner]); - - const cards = [ - { - title: BFBannerText[lang].cards.title1, - }, - { - title: BFBannerText[lang].cards.title2, - }, - { - title: BFBannerText[lang].cards.title3, - }, - { - title: BFBannerText[lang].cards.title4, - }, - { - title: BFBannerText[lang].cards.title5, - }, - { - title: BFBannerText[lang].cards.title6, - }, - ]; - - return ( - showBanner && ( - //Background -
- {/* Banner */} -
- -
-
-
-

{BFBannerText[lang].head}

-

{BFBannerText[lang].title}

-
-
- -
-
-
-
-
- {cards.map((card) => ( -
- -

{card.title}

-
- ))} -
-
-
-
-
-
-
- ) - ); -}; - -export default BFBanner; diff --git a/src/components/layout/Layout.tsx b/src/components/layout/Layout.tsx index 35a31c248..3c231b3c5 100644 --- a/src/components/layout/Layout.tsx +++ b/src/components/layout/Layout.tsx @@ -1,4 +1,4 @@ -import React, { useEffect } from 'react'; +import { useEffect } from 'react'; import Head from 'next/head'; import { useRouter } from 'next/router'; import Script from 'next/script'; @@ -33,7 +33,6 @@ interface LayoutProps { readonly segmentName?: string | null; readonly disableMailerlite?: boolean; readonly disableDrift?: boolean; - readonly isProduction?: boolean; readonly specialOffer?: string; readonly isBannerFixed?: boolean; readonly lang?: string; @@ -50,7 +49,6 @@ export default function Layout({ specialOffer, disableDrift = true, isBannerFixed, - isProduction = process.env.NODE_ENV === 'production', }: // lang LayoutProps) { const pageURL = segmentName === 'home' ? '' : segmentName; @@ -179,7 +177,7 @@ LayoutProps) { - + @@ -193,7 +191,7 @@ LayoutProps) { @@ -255,7 +253,7 @@ LayoutProps) { {!disableDrift && @@ -52,7 +53,7 @@ const AboutUs = ({ lang, textContent, footerLang, navbarLang, metatagsDescriptio ); }; -export async function getServerSideProps(ctx) { +export async function getServerSideProps(ctx: GetServerSidePropsContext) { const lang = ctx.locale; const metatagsDescriptions = require(`@/assets/lang/${lang}/metatags-descriptions.json`); const footerLang = require(`@/assets/lang/${lang}/footer.json`); diff --git a/src/pages/affiliates/[filename].tsx b/src/pages/affiliates/[filename].tsx index 57f03f406..75805a5d9 100644 --- a/src/pages/affiliates/[filename].tsx +++ b/src/pages/affiliates/[filename].tsx @@ -7,6 +7,7 @@ import Layout from '@/components/layout/Layout'; import { MinimalNavbar } from '@/components/layout/navbars/MinimalNavbar'; import { HeroSectionForPartner } from '@/components/affiliates/affiliates-partners-template/HeroSection'; import { CouponType } from '@/lib/types'; +import { GetServerSidePropsContext } from 'next'; const SecondFeaturesSection = dynamic( () => import('@/components/home/SecondFeaturesSection').then((mod) => mod.default), @@ -190,14 +191,14 @@ const AffiliateTemplates = ({ langJson, homeJson, lang, metatagsDescriptions, fo ); }; -export async function getServerSideProps(ctx) { +export async function getServerSideProps(ctx: GetServerSidePropsContext) { const lang = 'en'; - const pathname = ctx.params.filename; + const pathname = ctx.params?.filename; - const metatagsDescriptions = require(`@/assets/lang/en/metatags-descriptions.json`); - const langJson = require(`@/assets/lang/en/affiliates-partners-template.json`); - const homeJson = require(`@/assets/lang/en/home.json`); - const footerLang = require(`@/assets/lang/en/footer.json`); + const metatagsDescriptions = require('@/assets/lang/en/metatags-descriptions.json'); + const langJson = require('@/assets/lang/en/affiliates-partners-template.json'); + const homeJson = require('@/assets/lang/en/home.json'); + const footerLang = require('@/assets/lang/en/footer.json'); return { props: { diff --git a/src/pages/affiliates/index.tsx b/src/pages/affiliates/index.tsx index b3c6e913d..e0524d277 100644 --- a/src/pages/affiliates/index.tsx +++ b/src/pages/affiliates/index.tsx @@ -9,6 +9,7 @@ import Footer from '@/components/layout/footers/Footer'; import Layout from '@/components/layout/Layout'; import Navbar from '@/components/layout/navbars/Navbar'; import CtaSection from '@/components/shared/CtaSection'; +import { GetServerSidePropsContext } from 'next'; const Affiliates = ({ langJson, lang, metatagsDescriptions, navbarLang, footerLang }) => { const metatags = metatagsDescriptions.filter((item) => item.id === 'affiliates'); @@ -43,13 +44,13 @@ const Affiliates = ({ langJson, lang, metatagsDescriptions, navbarLang, footerLa ); }; -export async function getServerSideProps(ctx) { +export async function getServerSideProps(ctx: GetServerSidePropsContext) { const lang = ctx.locale; - const metatagsDescriptions = require(`@/assets/lang/en/metatags-descriptions.json`); - const langJson = require(`@/assets/lang/en/affiliates.json`); - const navbarLang = require(`@/assets/lang/en/navbar.json`); - const footerLang = require(`@/assets/lang/en/footer.json`); + const metatagsDescriptions = require('@/assets/lang/en/metatags-descriptions.json'); + const langJson = require('@/assets/lang/en/affiliates.json'); + const navbarLang = require('@/assets/lang/en/navbar.json'); + const footerLang = require('@/assets/lang/en/footer.json'); return { props: { diff --git a/src/pages/annual.tsx b/src/pages/annual.tsx index af61690ae..87eee62fa 100644 --- a/src/pages/annual.tsx +++ b/src/pages/annual.tsx @@ -6,6 +6,7 @@ import PaymentSection from '@/components/annual/PaymentSection'; import FeatureSection from '@/components/annual/FeatureSection'; import InfoSection from '@/components/home/InfoSection'; import CtaSection from '@/components/pricing/CtaSection'; +import { GetServerSidePropsContext } from 'next'; const Annual = ({ metatagsDescriptions, langJson, navbarLang, footerLang, infoSectionLang }) => { const metatags = metatagsDescriptions.filter((desc) => desc.id === 'pricing'); @@ -31,7 +32,7 @@ const Annual = ({ metatagsDescriptions, langJson, navbarLang, footerLang, infoSe ); }; -export async function getServerSideProps(ctx) { +export async function getServerSideProps(ctx: GetServerSidePropsContext) { const lang = ctx.locale; const metatagsDescriptions = require(`@/assets/lang/${lang}/metatags-descriptions.json`); diff --git a/src/pages/b.tsx b/src/pages/b.tsx index 517a7a796..63607a6f3 100644 --- a/src/pages/b.tsx +++ b/src/pages/b.tsx @@ -9,6 +9,7 @@ import CtaSection from '@/components/shared/CtaSection'; import FAQSection from '@/components/shared/FaqSection'; import { MarqueeComponent } from '@/components/specialoffer/MarqueeComponent'; import cookies from '@/lib/cookies'; +import { GetServerSidePropsContext } from 'next'; import { useRouter } from 'next/router'; const HomePageV2 = ({ metatagsDescriptions, langJson, lang, navbarLang, footerLang }) => { @@ -51,7 +52,7 @@ const HomePageV2 = ({ metatagsDescriptions, langJson, lang, navbarLang, footerLa ); }; -export async function getServerSideProps(ctx) { +export async function getServerSideProps(ctx: GetServerSidePropsContext) { const lang = ctx.locale; const metatagsDescriptions = require(`@/assets/lang/${lang}/metatags-descriptions.json`); diff --git a/src/pages/black-friday.tsx b/src/pages/black-friday.tsx index 073e4be7e..beedabaf5 100644 --- a/src/pages/black-friday.tsx +++ b/src/pages/black-friday.tsx @@ -12,6 +12,7 @@ import FaqSection from '@/components/black-friday/FAQSection'; import BestStorageSection from '@/components/black-friday/BestStorageSection'; import LoginBFBanner from '@/components/banners/LoginBFBanner'; import FooterSection from '@/components/black-friday/FooterSection'; +import { GetServerSidePropsContext } from 'next'; const BLACK_FRIDAY_METATAG_ID = 'black-friday'; @@ -53,8 +54,8 @@ const BlackFriday = ({ lang, metatagsDescriptions, langJson, navbarLang }) => { ); }; -export async function getServerSideProps(ctx) { - const language = ctx.locale; +export async function getServerSideProps(ctx: GetServerSidePropsContext) { + const language = ctx.locale as string; const allowedLanguages = ['en', 'fr']; diff --git a/src/pages/byte-converter.tsx b/src/pages/byte-converter.tsx index 875508d57..df1bbba01 100644 --- a/src/pages/byte-converter.tsx +++ b/src/pages/byte-converter.tsx @@ -13,6 +13,7 @@ import TryInternxtBanner from '@/components/banners/TryInternxtBanner'; import { sm_faq, sm_breadcrumb } from '@/components/utils/schema-markup-generator'; import { ToolsSection } from '@/components/shared/ToolsSection'; +import { GetServerSidePropsContext } from 'next'; const CONVERTER_TOOL_METATAG_ID = 'converter-tool'; @@ -21,11 +22,11 @@ const ConverterTool = ({ lang, metatagsDescriptions, navbarLang, langJson, tools return ( <> - - @@ -65,7 +66,7 @@ const ConverterTool = ({ lang, metatagsDescriptions, navbarLang, langJson, tools ); }; -export async function getServerSideProps(ctx) { +export async function getServerSideProps(ctx: GetServerSidePropsContext) { const lang = ctx.locale; const metatagsDescriptions = require(`@/assets/lang/${lang}/metatags-descriptions.json`); diff --git a/src/pages/cloud-storage-comparison.tsx b/src/pages/cloud-storage-comparison.tsx index 37c11b158..8c5e5b623 100644 --- a/src/pages/cloud-storage-comparison.tsx +++ b/src/pages/cloud-storage-comparison.tsx @@ -15,6 +15,7 @@ import ThirdFeaturesSection from '@/components/home/ThirdFeaturesSection'; import CtaSection from '@/components/shared/CtaSection'; import { ComparisonHeader } from '@/components/comparison/ComparisonHeader'; import { SIGNUP_DRIVE_WEB } from '@/constants'; +import { GetServerSidePropsContext } from 'next'; const URL_REDIRECT = 'https://drive.internxt.com/new'; @@ -23,11 +24,11 @@ const CloudStorageComparison = ({ metatagsDescriptions, langJson, navbarLang, fo return ( <> - - @@ -61,7 +62,7 @@ const CloudStorageComparison = ({ metatagsDescriptions, langJson, navbarLang, fo ); }; -export async function getServerSideProps(ctx) { +export async function getServerSideProps(ctx: GetServerSidePropsContext) { const lang = ctx.locale; const metatagsDescriptions = require(`@/assets/lang/${lang}/metatags-descriptions.json`); diff --git a/src/pages/cloud-storage-for-education.tsx b/src/pages/cloud-storage-for-education.tsx index a05ae23a6..a7bb12831 100644 --- a/src/pages/cloud-storage-for-education.tsx +++ b/src/pages/cloud-storage-for-education.tsx @@ -11,6 +11,7 @@ import BenefitsOfInternxtSection from '@/components/cloud-storage-for-education/ import WhyChooseInternxtSection from '@/components/cloud-storage-for-education/WhyChooseInternxtSection'; import ClaimYourDiscountSection from '@/components/cloud-storage-for-education/ClaimYourDiscountSection'; import IntercomTicketCreatedBanner from '@/components/banners/IntercomTicketCreatedBanner'; +import { GetServerSidePropsContext } from 'next'; const CloudStorageForEducation = ({ lang, metatagsDescriptions, navbar, textContent, footer }) => { const metatags = metatagsDescriptions.filter((desc) => desc.id === 'cloud-storage-for-education'); @@ -53,7 +54,7 @@ const CloudStorageForEducation = ({ lang, metatagsDescriptions, navbar, textCont ); }; -export async function getServerSideProps(ctx) { +export async function getServerSideProps(ctx: GetServerSidePropsContext) { const lang = ctx.locale || ctx.defaultLocale; const metatagsDescriptions = require(`@/assets/lang/${lang}/metatags-descriptions.json`); diff --git a/src/pages/cloudwards.tsx b/src/pages/cloudwards.tsx index 96173716f..f69884db6 100644 --- a/src/pages/cloudwards.tsx +++ b/src/pages/cloudwards.tsx @@ -8,6 +8,7 @@ import TestimonialsSection from '@/components/home/TestimonialsSection'; import { MinimalFooter } from '@/components/layout/footers/MinimalFooter'; import { CtaSection } from '@/components/affiliates/affiliates-partners-template/CtaSection'; import { CouponType } from '@/lib/types'; +import { GetServerSidePropsContext } from 'next'; export type CardsType = 'all' | 'one'; @@ -76,13 +77,13 @@ const Cloudwards = ({ langJson, homeJson, lang, metatagsDescriptions, footerLang ); }; -export async function getServerSideProps(ctx) { +export async function getServerSideProps(ctx: GetServerSidePropsContext) { const lang = ctx.locale; - const metatagsDescriptions = require(`@/assets/lang/en/metatags-descriptions.json`); - const langJson = require(`@/assets/lang/en/affiliates-partners-template.json`); - const homeJson = require(`@/assets/lang/en/home.json`); - const footerLang = require(`@/assets/lang/en/footer.json`); + const metatagsDescriptions = require('@/assets/lang/en/metatags-descriptions.json'); + const langJson = require('@/assets/lang/en/affiliates-partners-template.json'); + const homeJson = require('@/assets/lang/en/home.json'); + const footerLang = require('@/assets/lang/en/footer.json'); return { props: { diff --git a/src/pages/cyber-awareness.tsx b/src/pages/cyber-awareness.tsx index dfa3fdba0..23feae293 100644 --- a/src/pages/cyber-awareness.tsx +++ b/src/pages/cyber-awareness.tsx @@ -17,17 +17,18 @@ import { sm_faq, sm_breadcrumb } from '@/components/utils/schema-markup-generato import FileParallaxSection from '@/components/home/FileParallaxSection'; import FeatureSection from '@/components/cyber-awareness/FeatureSection'; import QuizSection from '@/components/cyber-awareness/QuizSection'; +import { GetServerSidePropsContext } from 'next'; const CyberAwareness = ({ metatagsDescriptions, textContent, footerLang, navbarLang, lang, bannerText }) => { const metatags = metatagsDescriptions.filter((desc) => desc.id === 'cyber-awareness'); return ( <> - - @@ -80,7 +81,7 @@ const CyberAwareness = ({ metatagsDescriptions, textContent, footerLang, navbarL ); }; -export async function getServerSideProps(ctx) { +export async function getServerSideProps(ctx: GetServerSidePropsContext) { const lang = ctx.locale; const metatagsDescriptions = require(`@/assets/lang/${lang}/metatags-descriptions.json`); diff --git a/src/pages/cyber-security-quiz.tsx b/src/pages/cyber-security-quiz.tsx index bde450b6c..e29401590 100644 --- a/src/pages/cyber-security-quiz.tsx +++ b/src/pages/cyber-security-quiz.tsx @@ -3,6 +3,7 @@ import Layout from '@/components/layout/Layout'; import Navbar from '@/components/layout/navbars/Navbar'; import QuizSection from '@/components/CybersecurityQuiz/QuizSection'; import { CyberSecurityQuizViews } from '@/lib/types'; +import { GetServerSidePropsContext } from 'next'; const CyberSecurityQuiz = ({ metatagsDescriptions, navbarLang, textContent, lang }) => { const metatags = metatagsDescriptions.filter((desc) => desc.id === 'cyber-security-quiz'); @@ -36,12 +37,12 @@ const CyberSecurityQuiz = ({ metatagsDescriptions, navbarLang, textContent, lang ); }; -export async function getServerSideProps(ctx) { +export async function getServerSideProps(ctx: GetServerSidePropsContext) { const lang = ctx.locale; - const metatagsDescriptions = require(`@/assets/lang/en/metatags-descriptions.json`); - const navbarLang = require(`@/assets/lang/en/navbar.json`); - const textContent = require(`@/assets/lang/en/cyber-security-quiz.json`); + const metatagsDescriptions = require('@/assets/lang/en/metatags-descriptions.json'); + const navbarLang = require('@/assets/lang/en/navbar.json'); + const textContent = require('@/assets/lang/en/cyber-security-quiz.json'); return { props: { diff --git a/src/pages/dealfuel.tsx b/src/pages/dealfuel.tsx index cfc650c6a..1339b9900 100644 --- a/src/pages/dealfuel.tsx +++ b/src/pages/dealfuel.tsx @@ -13,6 +13,7 @@ import PaymentSection from '@/components/lifetime/PaymentSection'; import moment from 'moment'; import HeroSection from '@/components/lifetime/HeroSection'; import { MinimalFooter } from '@/components/layout/footers/MinimalFooter'; +import { GetServerSidePropsContext } from 'next'; const Techcult = ({ lang, metatagsDescriptions, langJson, footerLang, navbarLang }) => { const metatags = metatagsDescriptions.filter((desc) => desc.id === 'lifetime'); @@ -30,15 +31,15 @@ const Techcult = ({ lang, metatagsDescriptions, langJson, footerLang, navbarLang description={metatags[0].description} segmentName="DealFuel" lang={lang} - specialOffer={`https://internxt.com/images/previewLink/LifetimePreviewLink.png`} + specialOffer={'https://internxt.com/images/previewLink/LifetimePreviewLink.png'} > {openDialog ? ( -
+
- setOpenDialog(false)} /> + setOpenDialog(false)} />
@@ -66,13 +67,13 @@ const Techcult = ({ lang, metatagsDescriptions, langJson, footerLang, navbarLang ); }; -export async function getServerSideProps(ctx) { +export async function getServerSideProps(ctx: GetServerSidePropsContext) { const lang = ctx.locale; - const metatagsDescriptions = require(`@/assets/lang/en/metatags-descriptions.json`); - const langJson = require(`@/assets/lang/en/techcult.json`); - const navbarLang = require(`@/assets/lang/en/navbar.json`); - const footerLang = require(`@/assets/lang/en/footer.json`); + const metatagsDescriptions = require('@/assets/lang/en/metatags-descriptions.json'); + const langJson = require('@/assets/lang/en/techcult.json'); + const navbarLang = require('@/assets/lang/en/navbar.json'); + const footerLang = require('@/assets/lang/en/footer.json'); cookies.setReferralCookie(ctx); diff --git a/src/pages/dealmirror.tsx b/src/pages/dealmirror.tsx index 466f28a07..8bcf64e5a 100644 --- a/src/pages/dealmirror.tsx +++ b/src/pages/dealmirror.tsx @@ -13,6 +13,7 @@ import SignUp from '@/components/auth/SignUp'; import { X } from '@phosphor-icons/react'; import moment from 'moment'; import { MinimalFooter } from '@/components/layout/footers/MinimalFooter'; +import { GetServerSidePropsContext } from 'next'; const DealMirror = ({ lang, metatagsDescriptions, langJson, footerLang, deviceLang, navbarLang }) => { const metatags = metatagsDescriptions.filter((desc) => desc.id === 'lifetime'); @@ -37,15 +38,15 @@ const DealMirror = ({ lang, metatagsDescriptions, langJson, footerLang, deviceLa description={metatags[0].description} segmentName="DealMirror" lang={lang} - specialOffer={`https://internxt.com/images/previewLink/LifetimePreviewLink.png`} + specialOffer={'https://internxt.com/images/previewLink/LifetimePreviewLink.png'} > {openDialog ? ( -
+
- setOpenDialog(false)} /> + setOpenDialog(false)} />
@@ -68,14 +69,14 @@ const DealMirror = ({ lang, metatagsDescriptions, langJson, footerLang, deviceLa ); }; -export async function getServerSideProps(ctx) { +export async function getServerSideProps(ctx: GetServerSidePropsContext) { const lang = ctx.locale; const deviceLang = ctx.locale; - const metatagsDescriptions = require(`@/assets/lang/en/metatags-descriptions.json`); - const langJson = require(`@/assets/lang/en/techcult.json`); - const navbarLang = require(`@/assets/lang/en/navbar.json`); - const footerLang = require(`@/assets/lang/en/footer.json`); + const metatagsDescriptions = require('@/assets/lang/en/metatags-descriptions.json'); + const langJson = require('@/assets/lang/en/techcult.json'); + const navbarLang = require('@/assets/lang/en/navbar.json'); + const footerLang = require('@/assets/lang/en/footer.json'); cookies.setReferralCookie(ctx); diff --git a/src/pages/drive.tsx b/src/pages/drive.tsx index 6b4402719..ca36db63c 100644 --- a/src/pages/drive.tsx +++ b/src/pages/drive.tsx @@ -16,17 +16,18 @@ import { downloadDriveLinks } from '@/lib/get-download-url'; import { sm_faq, sm_breadcrumb } from '@/components/utils/schema-markup-generator'; import { CliCard } from '@/components/drive/CliCard'; +import { GetServerSidePropsContext } from 'next'; const Drive = ({ metatagsDescriptions, download, langJson, navbarLang, footerLang, lang }) => { const metatags = metatagsDescriptions.filter((desc) => desc.id === 'drive'); return ( <> - - @@ -59,7 +60,7 @@ const Drive = ({ metatagsDescriptions, download, langJson, navbarLang, footerLan ); }; -export async function getServerSideProps(ctx) { +export async function getServerSideProps(ctx: GetServerSidePropsContext) { const download = await downloadDriveLinks(); const lang = ctx.locale; diff --git a/src/pages/file-converter/[filename].tsx b/src/pages/file-converter/[filename].tsx index bf77b82ac..7925137a8 100644 --- a/src/pages/file-converter/[filename].tsx +++ b/src/pages/file-converter/[filename].tsx @@ -7,6 +7,7 @@ import { ToolsSection } from '@/components/shared/ToolsSection'; import { ConverterSection } from '@/components/file-converter/ConverterSection'; import { FeaturesSection } from '@/components/file-converter/FeaturesSection'; import CtaSection from '@/components/shared/CtaSection'; +import { GetServerSidePropsContext } from 'next'; const FileConverter = ({ metatagsDescriptions, @@ -43,10 +44,10 @@ const FileConverter = ({ ); }; -export async function getServerSideProps(ctx) { +export async function getServerSideProps(ctx: GetServerSidePropsContext) { const lang = ctx.locale; const textLang = lang === 'es' ? lang : 'en'; - const pathname = ctx.params.filename; + const pathname = ctx.params?.filename; const metatagsDescriptions = require(`@/assets/lang/${textLang}/metatags-descriptions.json`); const navbarLang = require(`@/assets/lang/${textLang}/navbar.json`); diff --git a/src/pages/file-converter/index.tsx b/src/pages/file-converter/index.tsx index 52a6aa8f3..0a98e7027 100644 --- a/src/pages/file-converter/index.tsx +++ b/src/pages/file-converter/index.tsx @@ -8,6 +8,7 @@ import { FeaturesSection } from '@/components/file-converter/main-state/Features import CtaSection from '@/components/shared/CtaSection'; import QASection from '@/components/shared/FaqSection'; import Footer from '@/components/layout/footers/Footer'; +import { GetServerSidePropsContext } from 'next'; const FileConverter = ({ metatagsDescriptions, @@ -45,7 +46,7 @@ const FileConverter = ({ ); }; -export async function getServerSideProps(ctx) { +export async function getServerSideProps(ctx: GetServerSidePropsContext) { const lang = ctx.locale; const textLang = lang === 'es' ? lang : 'en'; diff --git a/src/pages/freemonth.tsx b/src/pages/freemonth.tsx deleted file mode 100644 index c6a92c2c3..000000000 --- a/src/pages/freemonth.tsx +++ /dev/null @@ -1,52 +0,0 @@ -import HeroSection from '@/components/partnerships/freemonth/HeroSection'; -import FeatureSection from '@/components/partnerships/freemonth/FeatureSection'; -import Footer from '@/components/layout/footers/Footer'; -import Navbar from '@/components/layout/navbars/Navbar'; -import Layout from '@/components/layout/Layout'; -import cookies from '@/lib/cookies'; - -const SpecialOffer = ({ metatagsDescriptions, langJson, navbarLang, footerLang, deviceLang, lang }) => { - const metatags = metatagsDescriptions.filter((desc) => desc.id === 'freemonth'); - - return ( - - - - - - - -
- - ); -}; - -export async function getServerSideProps(ctx) { - const lang = ctx.locale; - const deviceLang = ctx.locale; - - const metatagsDescriptions = require(`@/assets/lang/${lang}/metatags-descriptions.json`); - const langJson = require(`@/assets/lang/${lang}/partnerships.json`); - const navbarLang = require(`@/assets/lang/${lang}/navbar.json`); - const footerLang = require(`@/assets/lang/${lang}/footer.json`); - - cookies.setReferralCookie(ctx); - - return { - props: { - lang, - deviceLang, - metatagsDescriptions, - langJson, - navbarLang, - footerLang, - }, - }; -} - -export default SpecialOffer; diff --git a/src/pages/index.tsx b/src/pages/index.tsx index 7ec1deda7..5a21daa3a 100644 --- a/src/pages/index.tsx +++ b/src/pages/index.tsx @@ -16,6 +16,7 @@ import { CouponType } from '@/lib/types'; import FirstWhatWeDoSection from '@/components/home/FirstWhatWeDoSection'; import SecondWhatWeDoSection from '@/components/home/SecondWhatWeDoSection'; import { useRouter } from 'next/router'; +import { GetServerSidePropsContext } from 'next'; const Home = ({ metatagsDescriptions, langJson, lang, navbarLang, footerLang }) => { const metatags = metatagsDescriptions.filter((desc) => desc.id === 'home'); @@ -71,7 +72,7 @@ const Home = ({ metatagsDescriptions, langJson, lang, navbarLang, footerLang }) ); }; -export async function getServerSideProps(ctx) { +export async function getServerSideProps(ctx: GetServerSidePropsContext) { const lang = ctx.locale; const metatagsDescriptions = require(`@/assets/lang/${lang}/metatags-descriptions.json`); diff --git a/src/pages/legal.tsx b/src/pages/legal.tsx index d1242dafd..ee004c620 100644 --- a/src/pages/legal.tsx +++ b/src/pages/legal.tsx @@ -3,6 +3,7 @@ import Navbar from '@/components/layout/navbars/Navbar'; import Layout from '@/components/layout/Layout'; import cookies from '@/lib/cookies'; import TermsAndConditionsOverview from '@/components/legal/TermsAndConditionsOverview'; +import { GetServerSidePropsContext } from 'next'; const Legal = ({ lang, metatagsDescriptions, textContent, navbarLang, footerLang }) => { const metatags = metatagsDescriptions.filter((desc) => desc.id === 'legal'); @@ -18,7 +19,7 @@ const Legal = ({ lang, metatagsDescriptions, textContent, navbarLang, footerLang ); }; -export async function getServerSideProps(ctx) { +export async function getServerSideProps(ctx: GetServerSidePropsContext) { const lang = ctx.locale; const metatagsDescriptions = require(`@/assets/lang/${lang}/metatags-descriptions.json`); diff --git a/src/pages/lifetime/celebration/[filename].tsx b/src/pages/lifetime/celebration/[filename].tsx index 5fdf11890..c269d634f 100644 --- a/src/pages/lifetime/celebration/[filename].tsx +++ b/src/pages/lifetime/celebration/[filename].tsx @@ -12,6 +12,7 @@ import { useRouter } from 'next/router'; import { useEffect } from 'react'; import Navbar from '@/components/layout/navbars/Navbar'; import { MinimalFooter } from '@/components/layout/footers/MinimalFooter'; +import { GetServerSidePropsContext } from 'next'; const ALLOWED_PATHS = ['canada', 'usa', 'france', 'belgium']; @@ -66,7 +67,7 @@ const LifetimeCelebrationTemplate = ({ description={metatags[0].description} segmentName="Lifetime" lang={lang} - specialOffer={`https://internxt.com/images/previewLink/LifetimePreviewLink.png`} + specialOffer={'https://internxt.com/images/previewLink/LifetimePreviewLink.png'} > @@ -100,9 +101,9 @@ const LifetimeCelebrationTemplate = ({ ); }; -export async function getServerSideProps(ctx) { +export async function getServerSideProps(ctx: GetServerSidePropsContext) { let lang = 'en'; - const pathname = ctx.params.filename; + const pathname = ctx.params?.filename as string; if (['france', 'belgium'].includes(pathname)) { lang = 'fr'; diff --git a/src/pages/lifetime/index.tsx b/src/pages/lifetime/index.tsx index fb0792ad2..98514e595 100644 --- a/src/pages/lifetime/index.tsx +++ b/src/pages/lifetime/index.tsx @@ -8,8 +8,9 @@ import Navbar from '@/components/layout/navbars/Navbar'; import CtaSection from '@/components/lifetime/CtaSection'; import TestimonialsSection from '@/components/home/TestimonialsSection'; import { MinimalFooter } from '@/components/layout/footers/MinimalFooter'; +import { GetServerSidePropsContext } from 'next'; -const Lifetime = ({ lang, metatagsDescriptions, langJson, testimonialsJson, footerLang, deviceLang, navbarLang }) => { +const Lifetime = ({ lang, metatagsDescriptions, langJson, testimonialsJson, footerLang, navbarLang }) => { const metatags = metatagsDescriptions.filter((desc) => desc.id === 'lifetime'); const discount = 0.25; @@ -19,7 +20,7 @@ const Lifetime = ({ lang, metatagsDescriptions, langJson, testimonialsJson, foot description={metatags[0].description} segmentName="Lifetime" lang={lang} - specialOffer={`https://internxt.com/images/previewLink/LifetimePreviewLink.png`} + specialOffer={'https://internxt.com/images/previewLink/LifetimePreviewLink.png'} > @@ -51,9 +52,8 @@ const Lifetime = ({ lang, metatagsDescriptions, langJson, testimonialsJson, foot ); }; -export async function getServerSideProps(ctx) { +export async function getServerSideProps(ctx: GetServerSidePropsContext) { const lang = ctx.locale; - const deviceLang = ctx.locale; const metatagsDescriptions = require(`@/assets/lang/${lang}/metatags-descriptions.json`); const langJson = require(`@/assets/lang/${lang}/lifetime.json`); @@ -66,7 +66,6 @@ export async function getServerSideProps(ctx) { return { props: { lang, - deviceLang, metatagsDescriptions, langJson, testimonialsJson, diff --git a/src/pages/lifetime_special.tsx b/src/pages/lifetime_special.tsx index 014ed5df0..687a080e2 100644 --- a/src/pages/lifetime_special.tsx +++ b/src/pages/lifetime_special.tsx @@ -9,6 +9,7 @@ import CtaSection from '@/components/lifetime/CtaSection'; import TestimonialsSection from '@/components/home/TestimonialsSection'; import moment from 'moment'; import { MinimalFooter } from '@/components/layout/footers/MinimalFooter'; +import { GetServerSidePropsContext } from 'next'; const LifetimeSpecial = ({ lang, @@ -28,7 +29,7 @@ const LifetimeSpecial = ({ description={metatags[0].description} segmentName="Lifetime" lang={lang} - specialOffer={`https://internxt.com/images/previewLink/LifetimePreviewLink.png`} + specialOffer={'https://internxt.com/images/previewLink/LifetimePreviewLink.png'} > @@ -54,7 +55,7 @@ const LifetimeSpecial = ({ ); }; -export async function getServerSideProps(ctx) { +export async function getServerSideProps(ctx: GetServerSidePropsContext) { const lang = ctx.locale; const deviceLang = ctx.locale; diff --git a/src/pages/locker.tsx b/src/pages/locker.tsx index 41f068799..09ac1e67d 100644 --- a/src/pages/locker.tsx +++ b/src/pages/locker.tsx @@ -10,6 +10,7 @@ import PriceTable from '@/components/annual-plans-for-affiliates/components/Pric import { checkout } from '@/lib/auth'; import { CouponType } from '@/lib/types'; import usePricing from '@/hooks/usePricing'; +import { GetServerSidePropsContext } from 'next'; export default function Locker({ metatagsDescriptions, navbarLang, footerLang, lang, textContent }) { const metatags = metatagsDescriptions.filter((desc) => desc.id === 'pricing'); @@ -48,12 +49,12 @@ export default function Locker({ metatagsDescriptions, navbarLang, footerLang, l ); } -export async function getServerSideProps(ctx) { +export async function getServerSideProps(ctx: GetServerSidePropsContext) { const lang = ctx.locale; - const metatagsDescriptions = require(`@/assets/lang/en/metatags-descriptions.json`); - const textContent = require(`@/assets/lang/en/locker.json`); - const footerLang = require(`@/assets/lang/en/footer.json`); - const navbarLang = require(`@/assets/lang/en/navbar.json`); + const metatagsDescriptions = require('@/assets/lang/en/metatags-descriptions.json'); + const textContent = require('@/assets/lang/en/locker.json'); + const footerLang = require('@/assets/lang/en/footer.json'); + const navbarLang = require('@/assets/lang/en/navbar.json'); return { props: { diff --git a/src/pages/media-area.tsx b/src/pages/media-area.tsx index ef8accce9..a27bd22fc 100644 --- a/src/pages/media-area.tsx +++ b/src/pages/media-area.tsx @@ -10,6 +10,7 @@ import SocialProofSection from '@/components/home/SocialProofSection'; import ThirdFeaturesSection from '@/components/media-area/FeatureSection'; import InternxtInTheNews from '@/components/media-area/InternxtInTheNews'; import AnalysisSection from '@/components/media-area/AnalysisSection'; +import { GetServerSidePropsContext } from 'next'; const MediaArea = ({ metatagsDescriptions, langJson, lang, navbarLang, footerLang, downloadURL }) => { const metatags = metatagsDescriptions.filter((desc) => desc.id === 'media-area'); @@ -43,13 +44,13 @@ const MediaArea = ({ metatagsDescriptions, langJson, lang, navbarLang, footerLan ); }; -export async function getServerSideProps(ctx) { +export async function getServerSideProps(ctx: GetServerSidePropsContext) { const lang = ctx.locale; - const metatagsDescriptions = require(`@/assets/lang/en/metatags-descriptions.json`); - const langJson = require(`@/assets/lang/en/media-area.json`); - const navbarLang = require(`@/assets/lang/en/navbar.json`); - const footerLang = require(`@/assets/lang/en/footer.json`); + const metatagsDescriptions = require('@/assets/lang/en/metatags-descriptions.json'); + const langJson = require('@/assets/lang/en/media-area.json'); + const navbarLang = require('@/assets/lang/en/navbar.json'); + const footerLang = require('@/assets/lang/en/footer.json'); return { props: { diff --git a/src/pages/mightydeals.tsx b/src/pages/mightydeals.tsx index e09661684..fc6c34faf 100644 --- a/src/pages/mightydeals.tsx +++ b/src/pages/mightydeals.tsx @@ -13,6 +13,7 @@ import SignUp from '@/components/auth/SignUp'; import { X } from '@phosphor-icons/react'; import Link from 'next/link'; import moment from 'moment'; +import { GetServerSidePropsContext } from 'next'; const MightyDeals = ({ lang, metatagsDescriptions, langJson, footerLang, deviceLang, navbarLang }) => { const [openDialog, setOpenDialog] = useState(false); @@ -30,15 +31,15 @@ const MightyDeals = ({ lang, metatagsDescriptions, langJson, footerLang, deviceL description={metatags[0].description} segmentName="MightyDeals" lang={lang} - specialOffer={`https://internxt.com/images/previewLink/LifetimePreviewLink.png`} + specialOffer={'https://internxt.com/images/previewLink/LifetimePreviewLink.png'} > {openDialog ? ( -
+
- setOpenDialog(false)} /> + setOpenDialog(false)} />
@@ -63,9 +64,9 @@ const MightyDeals = ({ lang, metatagsDescriptions, langJson, footerLang, deviceL
- Internxt logo + Internxt logo -

+

{footerLang.FooterSection.copyright.line1 + year + footerLang.FooterSection.copyright.line2}

@@ -73,14 +74,14 @@ const MightyDeals = ({ lang, metatagsDescriptions, langJson, footerLang, deviceL ); }; -export async function getServerSideProps(ctx) { +export async function getServerSideProps(ctx: GetServerSidePropsContext) { const lang = ctx.locale; const deviceLang = ctx.locale; - const metatagsDescriptions = require(`@/assets/lang/en/metatags-descriptions.json`); - const langJson = require(`@/assets/lang/en/techcult.json`); - const navbarLang = require(`@/assets/lang/en/navbar.json`); - const footerLang = require(`@/assets/lang/en/footer.json`); + const metatagsDescriptions = require('@/assets/lang/en/metatags-descriptions.json'); + const langJson = require('@/assets/lang/en/techcult.json'); + const navbarLang = require('@/assets/lang/en/navbar.json'); + const footerLang = require('@/assets/lang/en/footer.json'); cookies.setReferralCookie(ctx); diff --git a/src/pages/newsletter-subscribe.tsx b/src/pages/newsletter-subscribe.tsx index d6ecc6e92..6f29db108 100644 --- a/src/pages/newsletter-subscribe.tsx +++ b/src/pages/newsletter-subscribe.tsx @@ -6,6 +6,7 @@ import FileParallaxSection from '@/components/home/FileParallaxSection'; import MakePrivacySection from '@/components/newsletter/MakePrivacySection'; import WhatGetSection from '@/components/newsletter/WhatGetSection'; import CtaSection from '@/components/shared/CtaSection'; +import { GetServerSidePropsContext } from 'next'; const Newsletter = ({ lang, metatagsDescriptions, textContent, navbar, footer }) => { const metatags = metatagsDescriptions.filter((desc) => desc.id === 'newsletter-subscribe'); @@ -28,13 +29,13 @@ const Newsletter = ({ lang, metatagsDescriptions, textContent, navbar, footer }) ); }; -export async function getServerSideProps(ctx) { +export async function getServerSideProps(ctx: GetServerSidePropsContext) { const lang = ctx.locale; - const metatagsDescriptions = require(`@/assets/lang/en/metatags-descriptions.json`); - const navbar = require(`@/assets/lang/en/navbar.json`); - const textContent = require(`@/assets/lang/en/newsletter.json`); - const footer = require(`@/assets/lang/en/footer.json`); + const metatagsDescriptions = require('@/assets/lang/en/metatags-descriptions.json'); + const navbar = require('@/assets/lang/en/navbar.json'); + const textContent = require('@/assets/lang/en/newsletter.json'); + const footer = require('@/assets/lang/en/footer.json'); return { props: { diff --git a/src/pages/open-source.tsx b/src/pages/open-source.tsx index fa7088a3a..0df6855c9 100644 --- a/src/pages/open-source.tsx +++ b/src/pages/open-source.tsx @@ -10,8 +10,9 @@ import WhatAreTheBenefits from '@/components/open-source/WhatAreTheBenefits'; import WhatIsOSS from '@/components/open-source/WhatIsOSS'; import CtaSection from '@/components/shared/CtaSection'; import { downloadDriveLinks } from '@/lib/get-download-url'; +import { GetServerSidePropsContext } from 'next'; -const CTA_SIGNUP_URL = `https://drive.internxt.com/new`; +const CTA_SIGNUP_URL = 'https://drive.internxt.com/new'; const GITHUB_URL = 'https://github.com/internxt'; @@ -46,7 +47,7 @@ const OpenSource = ({ lang, metatagsDescriptions, langJson, navbarLang, footerLa ); }; -export async function getServerSideProps(ctx) { +export async function getServerSideProps(ctx: GetServerSidePropsContext) { const lang = ctx.locale; const download = await downloadDriveLinks(); diff --git a/src/pages/partner-discount.tsx b/src/pages/partner-discount.tsx index a9483e0b2..ac594f5f5 100644 --- a/src/pages/partner-discount.tsx +++ b/src/pages/partner-discount.tsx @@ -18,7 +18,7 @@ const Annual = ({ metatagsDescriptions, langJson, navbarLang, footerLang, infoSe - + @@ -31,12 +31,12 @@ const Annual = ({ metatagsDescriptions, langJson, navbarLang, footerLang, infoSe ); }; -export async function getServerSideProps(ctx) { - const metatagsDescriptions = require(`@/assets/lang/en/metatags-descriptions.json`); - const langJson = require(`@/assets/lang/en/partner-discount.json`); - const infoSectionLang = require(`@/assets/lang/en/home.json`); - const navbarLang = require(`@/assets/lang/en/navbar.json`); - const footerLang = require(`@/assets/lang/en/footer.json`); +export async function getServerSideProps() { + const metatagsDescriptions = require('@/assets/lang/en/metatags-descriptions.json'); + const langJson = require('@/assets/lang/en/partner-discount.json'); + const infoSectionLang = require('@/assets/lang/en/home.json'); + const navbarLang = require('@/assets/lang/en/navbar.json'); + const footerLang = require('@/assets/lang/en/footer.json'); return { props: { diff --git a/src/pages/password-checker.tsx b/src/pages/password-checker.tsx index 638df665d..3ec3100b7 100644 --- a/src/pages/password-checker.tsx +++ b/src/pages/password-checker.tsx @@ -12,6 +12,7 @@ import { sm_faq, sm_breadcrumb } from '@/components/utils/schema-markup-generato import { ToolsSection } from '@/components/shared/ToolsSection'; import CtaSection from '@/components/shared/CtaSection'; import InfoSection from '@/components/password-generator/InfoSection'; +import { GetServerSidePropsContext } from 'next'; const PasswordChecker = ({ metatagsDescriptions, @@ -26,11 +27,11 @@ const PasswordChecker = ({ return ( <> - - @@ -61,11 +62,7 @@ const PasswordChecker = ({ - + @@ -79,7 +76,7 @@ const PasswordChecker = ({ ); }; -export async function getServerSideProps(ctx) { +export async function getServerSideProps(ctx: GetServerSidePropsContext) { const lang = ctx.locale; const metatagsDescriptions = require(`@/assets/lang/${lang}/metatags-descriptions.json`); diff --git a/src/pages/password-generator.tsx b/src/pages/password-generator.tsx index 841f8297a..6c330aa59 100644 --- a/src/pages/password-generator.tsx +++ b/src/pages/password-generator.tsx @@ -10,6 +10,7 @@ import { ToolsSection } from '@/components/shared/ToolsSection'; import FAQSection from '@/components/shared/FaqSection'; import { sm_breadcrumb, sm_faq } from '@/components/utils/schema-markup-generator'; import Script from 'next/script'; +import { GetServerSidePropsContext } from 'next'; const DRIVE_URL = 'https://drive.internxt.com/new'; @@ -26,11 +27,11 @@ const PasswordGenerator = ({ return ( <> - - @@ -60,7 +61,7 @@ const PasswordGenerator = ({ ); }; -export async function getServerSideProps(ctx) { +export async function getServerSideProps(ctx: GetServerSidePropsContext) { const downloadURL = await downloadDriveLinks(); const lang = ctx.locale; diff --git a/src/pages/pccomponentes-products.tsx b/src/pages/pccomponentes-products.tsx index 14c2bbb01..056bb00d5 100644 --- a/src/pages/pccomponentes-products.tsx +++ b/src/pages/pccomponentes-products.tsx @@ -8,6 +8,7 @@ import CardSkeleton from '@/components/components/CardSkeleton'; import PriceCard from '@/components/prices/PriceCard'; import usePricing from '@/hooks/usePricing'; import { CouponType } from '@/lib/types'; +import { GetServerSidePropsContext } from 'next'; const PCComponentesProducts = ({ metatagsDescriptions, textContent, lang }) => { const metatags = metatagsDescriptions.filter((desc) => desc.id === 'pricing'); @@ -42,7 +43,7 @@ const PCComponentesProducts = ({ metatagsDescriptions, textContent, lang }) => {
- {/* Switch buttons (Individual plans | Lifetime plans | Business) */} + {/* Switch buttons (Individual plans | Lifetime plans | Business) */}
+ {view === 'wheel' ? ( + setView('congratulations')} setResult={setResult} /> + ) : view === 'congratulations' ? ( +
+
+

Congratulations!

+

Choose your plan and activate your offer with code:

+
+
+
+ +
+ +
+
+ +

+ Go to the pricing page and choose your subscription to activate your discount. +

+
+
+ ) : null} +
+
+ ); +}; + +export default WheelBanner; diff --git a/src/components/banners/components/WheelComponent.tsx b/src/components/banners/components/WheelComponent.tsx new file mode 100644 index 000000000..a66f5db88 --- /dev/null +++ b/src/components/banners/components/WheelComponent.tsx @@ -0,0 +1,148 @@ +import { LockKey, WarningCircle } from '@phosphor-icons/react'; +import TextInput from '@/components/components/TextInput'; +import CheckboxItem from '@/components/shared/CheckboxItem'; +import { useEffect, useState } from 'react'; +import { Roulette, useRoulette } from 'react-hook-roulette'; +import axios, { AxiosError } from 'axios'; + +const WheelComponent = ({ onViewChange, setResult }) => { + const [email, setEmail] = useState(''); + const [firstCheckbox, setFirstCheckbox] = useState(false); + const [error, setError] = useState(false); + + const items = [ + { name: '10% OFF', bg: '#001D6C' }, + { name: '15% OFF', bg: '#002D9C' }, + { name: '25% OFF', bg: '#0043CE' }, + { name: '30% OFF', bg: '#0066FF' }, + { name: '45% OFF', bg: '#4589FF' }, + { name: '50% OFF', bg: '#78A9FF' }, + ]; + const { roulette, onStart, onStop, result } = useRoulette({ + items, + options: { + size: 300, + style: { + label: { + defaultColor: '#fff', + }, + }, + }, + }); + + // Stop the roulette after random seconds between 4 and 6 seconds + useEffect(() => { + setTimeout(() => { + onStop(); + }, Math.floor(Math.random() * 2000) + 4000); + }, [onStart]); + + useEffect(() => { + if (result) { + setResult(result); + onViewChange('congratulations'); + } + }, [result]); + + useEffect(() => { + if (error) { + setTimeout(() => { + setError(false); + }, 3000); + } + }, [error]); + + const onEmailInputChange = (e) => { + setEmail(e.target.value); + }; + + const onCheckboxChange = () => { + setFirstCheckbox(!firstCheckbox); + }; + + const handleOnButtonClick = (e) => { + e.preventDefault(); + axios + .post('/api/authenticate', { + userEmail: email, + }) + .then(() => { + setError(true); + }) + .catch((error: AxiosError) => { + if (error.response?.status === 404 || error.response?.status === 403) { + onStart(); + } else { + console.error('[ERROR]: ', 'You are not authorized to access this resource'); + } + }); + }; + + return ( +
+
+ {/* Icon */} +
+ +
+ {/* Text */} +
+

Safer Internet Day!

+

Subscribe, spin, and save on a subscription of your choice!*

+
+
+

*Offer is for free accounts or new customers

+
+
+ {/* Wheel and mobile view */} +
+ {/* Title */} +
+

Safer Internet Day!

+

Spin, save, and secure your data!

+
+
+ +
+ {/* Text input and button */} +
+ + {error && ( +
+ +

Offer unavailable for paid users

+
+ )} + + + {/* Checkbox and privacy policy */} +
+ +
+

*Offer is for free accounts or new customers

+
+
+
+
+ ); +}; + +export default WheelComponent; diff --git a/src/components/components/Countdown.tsx b/src/components/components/Countdown.tsx index d808fbf23..5059db0bb 100644 --- a/src/components/components/Countdown.tsx +++ b/src/components/components/Countdown.tsx @@ -28,6 +28,7 @@ const Countdown: React.FC = ({ textColor, dt }) => { const minute = second * 60; const hour = minute * 60; const day = hour * 24; + let timer: NodeJS.Timeout; const showRemaining = () => { const now = new Date(); @@ -47,7 +48,7 @@ const Countdown: React.FC = ({ textColor, dt }) => { setSeconds(seconds); }; - const timer = setInterval(showRemaining, 1000); + timer = setInterval(showRemaining, 1000); return () => clearInterval(timer); }; @@ -80,19 +81,19 @@ const Countdown: React.FC = ({ textColor, dt }) => { return (
-
+
{days < 10 ? `0${days}` : days}
-

:

-
+

:

+
{hours < 10 ? `0${hours}` : hours}
-

:

-
+

:

+
{minutes < 10 ? `0${minutes}` : minutes}
-

:

-
+

:

+
{seconds < 10 ? `0${seconds}` : seconds}
diff --git a/src/components/dealfuel/PriceCard.tsx b/src/components/dealfuel/PriceCard.tsx index 15ffb469b..73844cf63 100644 --- a/src/components/dealfuel/PriceCard.tsx +++ b/src/components/dealfuel/PriceCard.tsx @@ -1,12 +1,11 @@ -interface PriceCardProps { - planType: string; - storage: string; - price: number; - country: string; - popular: boolean; -} +/* eslint-disable jsx-a11y/no-noninteractive-tabindex */ +/* eslint-disable jsx-a11y/no-static-element-interactions */ +/* eslint-disable prefer-destructuring */ +/* eslint-disable no-restricted-globals */ +/* eslint-disable no-nested-ternary */ +import React from 'react'; -const PriceCard = ({ planType, storage, price, country, popular }: PriceCardProps): JSX.Element => { +const PriceCard = ({ planType, storage, price, cta, country, popular }) => { const currency = () => { switch (country) { case 'US': @@ -18,7 +17,7 @@ const PriceCard = ({ planType, storage, price, country, popular }: PriceCardProp } }; - const contentText = require('../../assets/lang/en/priceCard.json'); + const contentText = require(`../../assets/lang/en/priceCard.json`); return (
-
+
{storage}

-
+
-

+

{currency()} {price}

diff --git a/src/components/dealfuel/PriceTable.tsx b/src/components/dealfuel/PriceTable.tsx index dcaa376eb..141433037 100644 --- a/src/components/dealfuel/PriceTable.tsx +++ b/src/components/dealfuel/PriceTable.tsx @@ -1,3 +1,4 @@ +import React from 'react'; import PriceCard from './PriceCard'; import { Coin, CreditCard, Detective } from '@phosphor-icons/react'; @@ -88,6 +89,7 @@ const PriceTable = ({ lang, country, textContent }) => { planType="individual" storage={prices.TB2.storage} price={billingPrice(prices.TB2.price)} + cta={['checkout', 'lifetime2TB']} popular={prices.TB2.popular} country={country} /> @@ -95,6 +97,7 @@ const PriceTable = ({ lang, country, textContent }) => { planType="individual" storage={prices.TB5.storage} price={billingPrice(prices.TB5.price)} + cta={['checkout', 'lifetime5TB']} popular={prices.TB5.popular} country={country} /> @@ -102,6 +105,7 @@ const PriceTable = ({ lang, country, textContent }) => { planType="individual" storage={prices.TB10.storage} price={billingPrice(prices.TB10.price)} + cta={['checkout', 'lifetime10TB']} popular={prices.TB10.popular} country={country} /> diff --git a/src/components/home/InfoSection.tsx b/src/components/home/InfoSection.tsx index 0ade83ba4..383594507 100644 --- a/src/components/home/InfoSection.tsx +++ b/src/components/home/InfoSection.tsx @@ -1,9 +1,11 @@ +import React from 'react'; import RevealY from '@/components/components/RevealY'; import { CaretRight, Eye, Fingerprint, LockKey, ShieldCheck } from '@phosphor-icons/react'; import { useRouter } from 'next/router'; const InfoSection = ({ textContent, + lang, withoutCta, backgroundColor, redirect, diff --git a/src/components/home/SocialProofSection.tsx b/src/components/home/SocialProofSection.tsx index 3d1e9cc72..68b623f60 100644 --- a/src/components/home/SocialProofSection.tsx +++ b/src/components/home/SocialProofSection.tsx @@ -1,3 +1,4 @@ +/* eslint-disable react/jsx-no-target-blank */ import { getImage } from '@/lib/getImage'; import Image from 'next/image'; diff --git a/src/components/home/TestimonialsSection.tsx b/src/components/home/TestimonialsSection.tsx index 7f358dcda..97cd40383 100644 --- a/src/components/home/TestimonialsSection.tsx +++ b/src/components/home/TestimonialsSection.tsx @@ -2,12 +2,7 @@ import { getImage } from '@/lib/getImage'; import Image from 'next/image'; import { FiveStars } from '../shared/StarsRate'; -interface TestimonialsSectionProps { - textContent: Record; - bgColor?: string; -} - -const AvatarAndText = ({ testimonial }): JSX.Element => ( +const AvatarAndText = ({ testimonial }) => (
FixThePhoto Avatar @@ -19,7 +14,7 @@ const AvatarAndText = ({ testimonial }): JSX.Element => (
); -const TestimonialsSection = ({ textContent, bgColor }: TestimonialsSectionProps): JSX.Element => { +const TestimonialsSection = ({ textContent, bgColor }: { textContent: any; bgColor?: string }) => { const testimonials = [ { review: textContent.cards[0].review, diff --git a/src/components/home/ThirdFeaturesSection.tsx b/src/components/home/ThirdFeaturesSection.tsx index 2f5260ef5..6d08071f9 100644 --- a/src/components/home/ThirdFeaturesSection.tsx +++ b/src/components/home/ThirdFeaturesSection.tsx @@ -1,21 +1,15 @@ import Image from 'next/legacy/image'; import { Gift } from '@phosphor-icons/react'; +import React from 'react'; import RevealX from '@/components/components/RevealX'; -import { getImage } from '@/lib/getImage'; -import Link from 'next/link'; -import { SIGNUP_DRIVE_WEB } from '@/constants'; -interface ThirdFeaturesSectionProps { - textContent: Record; -} - -const ThirdFeaturesSection = ({ textContent }: ThirdFeaturesSectionProps): JSX.Element => { +const ThirdFeaturesSection = ({ textContent }) => { return (
{textContent.title}

{textContent.description}

- { + window.open('https://drive.internxt.com/new', '_blank', 'noopener noreferrer'); + }} > {textContent.cta} - +
diff --git a/src/components/home/components/FileItem.tsx b/src/components/home/components/FileItem.tsx index adb1f9bf3..707283f88 100644 --- a/src/components/home/components/FileItem.tsx +++ b/src/components/home/components/FileItem.tsx @@ -1,19 +1,23 @@ import { DotsThree } from '@phosphor-icons/react'; import moment from 'moment'; +import React from 'react'; -interface FileItemProps { +const FileItem = ({ + encrypted, + className, + title, + ItemImg, +}: { title: string; className: string; ItemImg: any; encrypted?: boolean; -} - -const FileItem = ({ encrypted, className, title, ItemImg }: FileItemProps): JSX.Element => { +}) => { const fileYear = moment().year(); return (
-
+
diff --git a/src/components/home/components/Label.tsx b/src/components/home/components/Label.tsx index 46b534de3..3ff91a1e5 100644 --- a/src/components/home/components/Label.tsx +++ b/src/components/home/components/Label.tsx @@ -1,12 +1,7 @@ import { CaretRight } from '@phosphor-icons/react'; import { useRouter } from 'next/navigation'; -interface LabelProps { - label: string; - path: string; -} - -export const Label = ({ label, path }: LabelProps): JSX.Element => { +export const Label = ({ label, path }) => { const router = useRouter(); return ( diff --git a/src/components/home/components/heroSection/TitleAndSignup.tsx b/src/components/home/components/heroSection/TitleAndSignup.tsx index a2d5bc546..09ce36539 100644 --- a/src/components/home/components/heroSection/TitleAndSignup.tsx +++ b/src/components/home/components/heroSection/TitleAndSignup.tsx @@ -2,11 +2,7 @@ import SignUpInline from '@/components/auth/SignUpInline'; import Header from '@/components/shared/Header'; import { goToSignUpURL } from '@/lib/auth'; -interface TitleAndSignupProps { - textContent: Record; -} - -export const TitleAndSignup = ({ textContent }: TitleAndSignupProps): JSX.Element => { +export const TitleAndSignup = ({ textContent }) => { return (
diff --git a/src/components/home/components/heroSection/TitleAndSurvey.tsx b/src/components/home/components/heroSection/TitleAndSurvey.tsx index 552a560f2..ca37cdb88 100644 --- a/src/components/home/components/heroSection/TitleAndSurvey.tsx +++ b/src/components/home/components/heroSection/TitleAndSurvey.tsx @@ -3,11 +3,7 @@ import Header from '@/components/shared/Header'; import { FiveStars } from '@/components/shared/StarsRate'; import { useRouter } from 'next/router'; -interface TitleAndSurveyProps { - textContent: Record; -} - -export const TitleAndSurvey = ({ textContent }: TitleAndSurveyProps): JSX.Element => { +export const TitleAndSurvey = ({ textContent }) => { const router = useRouter(); const handleOnPlanButtonClicked = () => { @@ -43,7 +39,7 @@ export const TitleAndSurvey = ({ textContent }: TitleAndSurveyProps): JSX.Elemen {/* // TODO: Manage the buttons logic */}
{textContent.buttonLabel.map((label) => ( -
+
))} diff --git a/src/components/layout/BFBanner.tsx b/src/components/layout/BFBanner.tsx new file mode 100644 index 000000000..2b66d0ae3 --- /dev/null +++ b/src/components/layout/BFBanner.tsx @@ -0,0 +1,113 @@ +import { CircleWavyCheck, X } from '@phosphor-icons/react'; +import { useState, useEffect } from 'react'; +import styles from '../black-friday/BF-HeroSection.module.scss'; +import { useRouter } from 'next/router'; +import { buttonDeal, buttonLink, BFBannerText } from '../TextWithoutJson'; + +const BFBanner = () => { + const [showBanner, setShowBanner] = useState(false); + const router = useRouter(); + const lang = router.locale; + + const handleClose = () => { + localStorage.setItem('hideBanner', 'true'); + setShowBanner(false); + }; + + useEffect(() => { + setTimeout(() => { + if (router.pathname !== '/black-friday') { + setShowBanner(true); + } + }, 20000); + }, []); + + useEffect(() => { + const hideBanner = localStorage.getItem('hideBanner'); + if (showBanner) { + window.dispatchEvent(new Event('CloseSquare')); + } + if (hideBanner) { + setShowBanner(false); + } + window.addEventListener('unload', function (e) { + e.preventDefault(); + localStorage.removeItem('hideBanner'); + }); + return () => { + window.removeEventListener('unload', () => {}); + }; + }, [showBanner]); + + const cards = [ + { + title: BFBannerText[lang].cards.title1, + }, + { + title: BFBannerText[lang].cards.title2, + }, + { + title: BFBannerText[lang].cards.title3, + }, + { + title: BFBannerText[lang].cards.title4, + }, + { + title: BFBannerText[lang].cards.title5, + }, + { + title: BFBannerText[lang].cards.title6, + }, + ]; + + return ( + showBanner && ( + //Background +
+ {/* Banner */} +
+ +
+
+
+

{BFBannerText[lang].head}

+

{BFBannerText[lang].title}

+
+
+ +
+
+
+
+
+ {cards.map((card) => ( +
+ +

{card.title}

+
+ ))} +
+
+
+
+
+
+
+ ) + ); +}; + +export default BFBanner; diff --git a/src/components/layout/Layout.tsx b/src/components/layout/Layout.tsx index 3c231b3c5..35a31c248 100644 --- a/src/components/layout/Layout.tsx +++ b/src/components/layout/Layout.tsx @@ -1,4 +1,4 @@ -import { useEffect } from 'react'; +import React, { useEffect } from 'react'; import Head from 'next/head'; import { useRouter } from 'next/router'; import Script from 'next/script'; @@ -33,6 +33,7 @@ interface LayoutProps { readonly segmentName?: string | null; readonly disableMailerlite?: boolean; readonly disableDrift?: boolean; + readonly isProduction?: boolean; readonly specialOffer?: string; readonly isBannerFixed?: boolean; readonly lang?: string; @@ -49,6 +50,7 @@ export default function Layout({ specialOffer, disableDrift = true, isBannerFixed, + isProduction = process.env.NODE_ENV === 'production', }: // lang LayoutProps) { const pageURL = segmentName === 'home' ? '' : segmentName; @@ -177,7 +179,7 @@ LayoutProps) { - + @@ -191,7 +193,7 @@ LayoutProps) { @@ -253,7 +255,7 @@ LayoutProps) { {!disableDrift && @@ -53,7 +52,7 @@ const AboutUs = ({ lang, textContent, footerLang, navbarLang, metatagsDescriptio ); }; -export async function getServerSideProps(ctx: GetServerSidePropsContext) { +export async function getServerSideProps(ctx) { const lang = ctx.locale; const metatagsDescriptions = require(`@/assets/lang/${lang}/metatags-descriptions.json`); const footerLang = require(`@/assets/lang/${lang}/footer.json`); diff --git a/src/pages/affiliates/[filename].tsx b/src/pages/affiliates/[filename].tsx index 75805a5d9..57f03f406 100644 --- a/src/pages/affiliates/[filename].tsx +++ b/src/pages/affiliates/[filename].tsx @@ -7,7 +7,6 @@ import Layout from '@/components/layout/Layout'; import { MinimalNavbar } from '@/components/layout/navbars/MinimalNavbar'; import { HeroSectionForPartner } from '@/components/affiliates/affiliates-partners-template/HeroSection'; import { CouponType } from '@/lib/types'; -import { GetServerSidePropsContext } from 'next'; const SecondFeaturesSection = dynamic( () => import('@/components/home/SecondFeaturesSection').then((mod) => mod.default), @@ -191,14 +190,14 @@ const AffiliateTemplates = ({ langJson, homeJson, lang, metatagsDescriptions, fo ); }; -export async function getServerSideProps(ctx: GetServerSidePropsContext) { +export async function getServerSideProps(ctx) { const lang = 'en'; - const pathname = ctx.params?.filename; + const pathname = ctx.params.filename; - const metatagsDescriptions = require('@/assets/lang/en/metatags-descriptions.json'); - const langJson = require('@/assets/lang/en/affiliates-partners-template.json'); - const homeJson = require('@/assets/lang/en/home.json'); - const footerLang = require('@/assets/lang/en/footer.json'); + const metatagsDescriptions = require(`@/assets/lang/en/metatags-descriptions.json`); + const langJson = require(`@/assets/lang/en/affiliates-partners-template.json`); + const homeJson = require(`@/assets/lang/en/home.json`); + const footerLang = require(`@/assets/lang/en/footer.json`); return { props: { diff --git a/src/pages/affiliates/index.tsx b/src/pages/affiliates/index.tsx index e0524d277..b3c6e913d 100644 --- a/src/pages/affiliates/index.tsx +++ b/src/pages/affiliates/index.tsx @@ -9,7 +9,6 @@ import Footer from '@/components/layout/footers/Footer'; import Layout from '@/components/layout/Layout'; import Navbar from '@/components/layout/navbars/Navbar'; import CtaSection from '@/components/shared/CtaSection'; -import { GetServerSidePropsContext } from 'next'; const Affiliates = ({ langJson, lang, metatagsDescriptions, navbarLang, footerLang }) => { const metatags = metatagsDescriptions.filter((item) => item.id === 'affiliates'); @@ -44,13 +43,13 @@ const Affiliates = ({ langJson, lang, metatagsDescriptions, navbarLang, footerLa ); }; -export async function getServerSideProps(ctx: GetServerSidePropsContext) { +export async function getServerSideProps(ctx) { const lang = ctx.locale; - const metatagsDescriptions = require('@/assets/lang/en/metatags-descriptions.json'); - const langJson = require('@/assets/lang/en/affiliates.json'); - const navbarLang = require('@/assets/lang/en/navbar.json'); - const footerLang = require('@/assets/lang/en/footer.json'); + const metatagsDescriptions = require(`@/assets/lang/en/metatags-descriptions.json`); + const langJson = require(`@/assets/lang/en/affiliates.json`); + const navbarLang = require(`@/assets/lang/en/navbar.json`); + const footerLang = require(`@/assets/lang/en/footer.json`); return { props: { diff --git a/src/pages/annual.tsx b/src/pages/annual.tsx index 87eee62fa..af61690ae 100644 --- a/src/pages/annual.tsx +++ b/src/pages/annual.tsx @@ -6,7 +6,6 @@ import PaymentSection from '@/components/annual/PaymentSection'; import FeatureSection from '@/components/annual/FeatureSection'; import InfoSection from '@/components/home/InfoSection'; import CtaSection from '@/components/pricing/CtaSection'; -import { GetServerSidePropsContext } from 'next'; const Annual = ({ metatagsDescriptions, langJson, navbarLang, footerLang, infoSectionLang }) => { const metatags = metatagsDescriptions.filter((desc) => desc.id === 'pricing'); @@ -32,7 +31,7 @@ const Annual = ({ metatagsDescriptions, langJson, navbarLang, footerLang, infoSe ); }; -export async function getServerSideProps(ctx: GetServerSidePropsContext) { +export async function getServerSideProps(ctx) { const lang = ctx.locale; const metatagsDescriptions = require(`@/assets/lang/${lang}/metatags-descriptions.json`); diff --git a/src/pages/b.tsx b/src/pages/b.tsx index 63607a6f3..517a7a796 100644 --- a/src/pages/b.tsx +++ b/src/pages/b.tsx @@ -9,7 +9,6 @@ import CtaSection from '@/components/shared/CtaSection'; import FAQSection from '@/components/shared/FaqSection'; import { MarqueeComponent } from '@/components/specialoffer/MarqueeComponent'; import cookies from '@/lib/cookies'; -import { GetServerSidePropsContext } from 'next'; import { useRouter } from 'next/router'; const HomePageV2 = ({ metatagsDescriptions, langJson, lang, navbarLang, footerLang }) => { @@ -52,7 +51,7 @@ const HomePageV2 = ({ metatagsDescriptions, langJson, lang, navbarLang, footerLa ); }; -export async function getServerSideProps(ctx: GetServerSidePropsContext) { +export async function getServerSideProps(ctx) { const lang = ctx.locale; const metatagsDescriptions = require(`@/assets/lang/${lang}/metatags-descriptions.json`); diff --git a/src/pages/black-friday.tsx b/src/pages/black-friday.tsx index beedabaf5..073e4be7e 100644 --- a/src/pages/black-friday.tsx +++ b/src/pages/black-friday.tsx @@ -12,7 +12,6 @@ import FaqSection from '@/components/black-friday/FAQSection'; import BestStorageSection from '@/components/black-friday/BestStorageSection'; import LoginBFBanner from '@/components/banners/LoginBFBanner'; import FooterSection from '@/components/black-friday/FooterSection'; -import { GetServerSidePropsContext } from 'next'; const BLACK_FRIDAY_METATAG_ID = 'black-friday'; @@ -54,8 +53,8 @@ const BlackFriday = ({ lang, metatagsDescriptions, langJson, navbarLang }) => { ); }; -export async function getServerSideProps(ctx: GetServerSidePropsContext) { - const language = ctx.locale as string; +export async function getServerSideProps(ctx) { + const language = ctx.locale; const allowedLanguages = ['en', 'fr']; diff --git a/src/pages/byte-converter.tsx b/src/pages/byte-converter.tsx index df1bbba01..875508d57 100644 --- a/src/pages/byte-converter.tsx +++ b/src/pages/byte-converter.tsx @@ -13,7 +13,6 @@ import TryInternxtBanner from '@/components/banners/TryInternxtBanner'; import { sm_faq, sm_breadcrumb } from '@/components/utils/schema-markup-generator'; import { ToolsSection } from '@/components/shared/ToolsSection'; -import { GetServerSidePropsContext } from 'next'; const CONVERTER_TOOL_METATAG_ID = 'converter-tool'; @@ -22,11 +21,11 @@ const ConverterTool = ({ lang, metatagsDescriptions, navbarLang, langJson, tools return ( <> - - @@ -66,7 +65,7 @@ const ConverterTool = ({ lang, metatagsDescriptions, navbarLang, langJson, tools ); }; -export async function getServerSideProps(ctx: GetServerSidePropsContext) { +export async function getServerSideProps(ctx) { const lang = ctx.locale; const metatagsDescriptions = require(`@/assets/lang/${lang}/metatags-descriptions.json`); diff --git a/src/pages/cloud-storage-comparison.tsx b/src/pages/cloud-storage-comparison.tsx index 8c5e5b623..37c11b158 100644 --- a/src/pages/cloud-storage-comparison.tsx +++ b/src/pages/cloud-storage-comparison.tsx @@ -15,7 +15,6 @@ import ThirdFeaturesSection from '@/components/home/ThirdFeaturesSection'; import CtaSection from '@/components/shared/CtaSection'; import { ComparisonHeader } from '@/components/comparison/ComparisonHeader'; import { SIGNUP_DRIVE_WEB } from '@/constants'; -import { GetServerSidePropsContext } from 'next'; const URL_REDIRECT = 'https://drive.internxt.com/new'; @@ -24,11 +23,11 @@ const CloudStorageComparison = ({ metatagsDescriptions, langJson, navbarLang, fo return ( <> - - @@ -62,7 +61,7 @@ const CloudStorageComparison = ({ metatagsDescriptions, langJson, navbarLang, fo ); }; -export async function getServerSideProps(ctx: GetServerSidePropsContext) { +export async function getServerSideProps(ctx) { const lang = ctx.locale; const metatagsDescriptions = require(`@/assets/lang/${lang}/metatags-descriptions.json`); diff --git a/src/pages/cloud-storage-for-education.tsx b/src/pages/cloud-storage-for-education.tsx index a7bb12831..a05ae23a6 100644 --- a/src/pages/cloud-storage-for-education.tsx +++ b/src/pages/cloud-storage-for-education.tsx @@ -11,7 +11,6 @@ import BenefitsOfInternxtSection from '@/components/cloud-storage-for-education/ import WhyChooseInternxtSection from '@/components/cloud-storage-for-education/WhyChooseInternxtSection'; import ClaimYourDiscountSection from '@/components/cloud-storage-for-education/ClaimYourDiscountSection'; import IntercomTicketCreatedBanner from '@/components/banners/IntercomTicketCreatedBanner'; -import { GetServerSidePropsContext } from 'next'; const CloudStorageForEducation = ({ lang, metatagsDescriptions, navbar, textContent, footer }) => { const metatags = metatagsDescriptions.filter((desc) => desc.id === 'cloud-storage-for-education'); @@ -54,7 +53,7 @@ const CloudStorageForEducation = ({ lang, metatagsDescriptions, navbar, textCont ); }; -export async function getServerSideProps(ctx: GetServerSidePropsContext) { +export async function getServerSideProps(ctx) { const lang = ctx.locale || ctx.defaultLocale; const metatagsDescriptions = require(`@/assets/lang/${lang}/metatags-descriptions.json`); diff --git a/src/pages/cloudwards.tsx b/src/pages/cloudwards.tsx index f69884db6..96173716f 100644 --- a/src/pages/cloudwards.tsx +++ b/src/pages/cloudwards.tsx @@ -8,7 +8,6 @@ import TestimonialsSection from '@/components/home/TestimonialsSection'; import { MinimalFooter } from '@/components/layout/footers/MinimalFooter'; import { CtaSection } from '@/components/affiliates/affiliates-partners-template/CtaSection'; import { CouponType } from '@/lib/types'; -import { GetServerSidePropsContext } from 'next'; export type CardsType = 'all' | 'one'; @@ -77,13 +76,13 @@ const Cloudwards = ({ langJson, homeJson, lang, metatagsDescriptions, footerLang ); }; -export async function getServerSideProps(ctx: GetServerSidePropsContext) { +export async function getServerSideProps(ctx) { const lang = ctx.locale; - const metatagsDescriptions = require('@/assets/lang/en/metatags-descriptions.json'); - const langJson = require('@/assets/lang/en/affiliates-partners-template.json'); - const homeJson = require('@/assets/lang/en/home.json'); - const footerLang = require('@/assets/lang/en/footer.json'); + const metatagsDescriptions = require(`@/assets/lang/en/metatags-descriptions.json`); + const langJson = require(`@/assets/lang/en/affiliates-partners-template.json`); + const homeJson = require(`@/assets/lang/en/home.json`); + const footerLang = require(`@/assets/lang/en/footer.json`); return { props: { diff --git a/src/pages/cyber-awareness.tsx b/src/pages/cyber-awareness.tsx index 23feae293..dfa3fdba0 100644 --- a/src/pages/cyber-awareness.tsx +++ b/src/pages/cyber-awareness.tsx @@ -17,18 +17,17 @@ import { sm_faq, sm_breadcrumb } from '@/components/utils/schema-markup-generato import FileParallaxSection from '@/components/home/FileParallaxSection'; import FeatureSection from '@/components/cyber-awareness/FeatureSection'; import QuizSection from '@/components/cyber-awareness/QuizSection'; -import { GetServerSidePropsContext } from 'next'; const CyberAwareness = ({ metatagsDescriptions, textContent, footerLang, navbarLang, lang, bannerText }) => { const metatags = metatagsDescriptions.filter((desc) => desc.id === 'cyber-awareness'); return ( <> - - @@ -81,7 +80,7 @@ const CyberAwareness = ({ metatagsDescriptions, textContent, footerLang, navbarL ); }; -export async function getServerSideProps(ctx: GetServerSidePropsContext) { +export async function getServerSideProps(ctx) { const lang = ctx.locale; const metatagsDescriptions = require(`@/assets/lang/${lang}/metatags-descriptions.json`); diff --git a/src/pages/cyber-security-quiz.tsx b/src/pages/cyber-security-quiz.tsx index e29401590..bde450b6c 100644 --- a/src/pages/cyber-security-quiz.tsx +++ b/src/pages/cyber-security-quiz.tsx @@ -3,7 +3,6 @@ import Layout from '@/components/layout/Layout'; import Navbar from '@/components/layout/navbars/Navbar'; import QuizSection from '@/components/CybersecurityQuiz/QuizSection'; import { CyberSecurityQuizViews } from '@/lib/types'; -import { GetServerSidePropsContext } from 'next'; const CyberSecurityQuiz = ({ metatagsDescriptions, navbarLang, textContent, lang }) => { const metatags = metatagsDescriptions.filter((desc) => desc.id === 'cyber-security-quiz'); @@ -37,12 +36,12 @@ const CyberSecurityQuiz = ({ metatagsDescriptions, navbarLang, textContent, lang ); }; -export async function getServerSideProps(ctx: GetServerSidePropsContext) { +export async function getServerSideProps(ctx) { const lang = ctx.locale; - const metatagsDescriptions = require('@/assets/lang/en/metatags-descriptions.json'); - const navbarLang = require('@/assets/lang/en/navbar.json'); - const textContent = require('@/assets/lang/en/cyber-security-quiz.json'); + const metatagsDescriptions = require(`@/assets/lang/en/metatags-descriptions.json`); + const navbarLang = require(`@/assets/lang/en/navbar.json`); + const textContent = require(`@/assets/lang/en/cyber-security-quiz.json`); return { props: { diff --git a/src/pages/dealfuel.tsx b/src/pages/dealfuel.tsx index 1339b9900..cfc650c6a 100644 --- a/src/pages/dealfuel.tsx +++ b/src/pages/dealfuel.tsx @@ -13,7 +13,6 @@ import PaymentSection from '@/components/lifetime/PaymentSection'; import moment from 'moment'; import HeroSection from '@/components/lifetime/HeroSection'; import { MinimalFooter } from '@/components/layout/footers/MinimalFooter'; -import { GetServerSidePropsContext } from 'next'; const Techcult = ({ lang, metatagsDescriptions, langJson, footerLang, navbarLang }) => { const metatags = metatagsDescriptions.filter((desc) => desc.id === 'lifetime'); @@ -31,15 +30,15 @@ const Techcult = ({ lang, metatagsDescriptions, langJson, footerLang, navbarLang description={metatags[0].description} segmentName="DealFuel" lang={lang} - specialOffer={'https://internxt.com/images/previewLink/LifetimePreviewLink.png'} + specialOffer={`https://internxt.com/images/previewLink/LifetimePreviewLink.png`} > {openDialog ? ( -
+
- setOpenDialog(false)} /> + setOpenDialog(false)} />
@@ -67,13 +66,13 @@ const Techcult = ({ lang, metatagsDescriptions, langJson, footerLang, navbarLang ); }; -export async function getServerSideProps(ctx: GetServerSidePropsContext) { +export async function getServerSideProps(ctx) { const lang = ctx.locale; - const metatagsDescriptions = require('@/assets/lang/en/metatags-descriptions.json'); - const langJson = require('@/assets/lang/en/techcult.json'); - const navbarLang = require('@/assets/lang/en/navbar.json'); - const footerLang = require('@/assets/lang/en/footer.json'); + const metatagsDescriptions = require(`@/assets/lang/en/metatags-descriptions.json`); + const langJson = require(`@/assets/lang/en/techcult.json`); + const navbarLang = require(`@/assets/lang/en/navbar.json`); + const footerLang = require(`@/assets/lang/en/footer.json`); cookies.setReferralCookie(ctx); diff --git a/src/pages/dealmirror.tsx b/src/pages/dealmirror.tsx index 8bcf64e5a..466f28a07 100644 --- a/src/pages/dealmirror.tsx +++ b/src/pages/dealmirror.tsx @@ -13,7 +13,6 @@ import SignUp from '@/components/auth/SignUp'; import { X } from '@phosphor-icons/react'; import moment from 'moment'; import { MinimalFooter } from '@/components/layout/footers/MinimalFooter'; -import { GetServerSidePropsContext } from 'next'; const DealMirror = ({ lang, metatagsDescriptions, langJson, footerLang, deviceLang, navbarLang }) => { const metatags = metatagsDescriptions.filter((desc) => desc.id === 'lifetime'); @@ -38,15 +37,15 @@ const DealMirror = ({ lang, metatagsDescriptions, langJson, footerLang, deviceLa description={metatags[0].description} segmentName="DealMirror" lang={lang} - specialOffer={'https://internxt.com/images/previewLink/LifetimePreviewLink.png'} + specialOffer={`https://internxt.com/images/previewLink/LifetimePreviewLink.png`} > {openDialog ? ( -
+
- setOpenDialog(false)} /> + setOpenDialog(false)} />
@@ -69,14 +68,14 @@ const DealMirror = ({ lang, metatagsDescriptions, langJson, footerLang, deviceLa ); }; -export async function getServerSideProps(ctx: GetServerSidePropsContext) { +export async function getServerSideProps(ctx) { const lang = ctx.locale; const deviceLang = ctx.locale; - const metatagsDescriptions = require('@/assets/lang/en/metatags-descriptions.json'); - const langJson = require('@/assets/lang/en/techcult.json'); - const navbarLang = require('@/assets/lang/en/navbar.json'); - const footerLang = require('@/assets/lang/en/footer.json'); + const metatagsDescriptions = require(`@/assets/lang/en/metatags-descriptions.json`); + const langJson = require(`@/assets/lang/en/techcult.json`); + const navbarLang = require(`@/assets/lang/en/navbar.json`); + const footerLang = require(`@/assets/lang/en/footer.json`); cookies.setReferralCookie(ctx); diff --git a/src/pages/drive.tsx b/src/pages/drive.tsx index ca36db63c..6b4402719 100644 --- a/src/pages/drive.tsx +++ b/src/pages/drive.tsx @@ -16,18 +16,17 @@ import { downloadDriveLinks } from '@/lib/get-download-url'; import { sm_faq, sm_breadcrumb } from '@/components/utils/schema-markup-generator'; import { CliCard } from '@/components/drive/CliCard'; -import { GetServerSidePropsContext } from 'next'; const Drive = ({ metatagsDescriptions, download, langJson, navbarLang, footerLang, lang }) => { const metatags = metatagsDescriptions.filter((desc) => desc.id === 'drive'); return ( <> - - @@ -60,7 +59,7 @@ const Drive = ({ metatagsDescriptions, download, langJson, navbarLang, footerLan ); }; -export async function getServerSideProps(ctx: GetServerSidePropsContext) { +export async function getServerSideProps(ctx) { const download = await downloadDriveLinks(); const lang = ctx.locale; diff --git a/src/pages/file-converter/[filename].tsx b/src/pages/file-converter/[filename].tsx index 7925137a8..bf77b82ac 100644 --- a/src/pages/file-converter/[filename].tsx +++ b/src/pages/file-converter/[filename].tsx @@ -7,7 +7,6 @@ import { ToolsSection } from '@/components/shared/ToolsSection'; import { ConverterSection } from '@/components/file-converter/ConverterSection'; import { FeaturesSection } from '@/components/file-converter/FeaturesSection'; import CtaSection from '@/components/shared/CtaSection'; -import { GetServerSidePropsContext } from 'next'; const FileConverter = ({ metatagsDescriptions, @@ -44,10 +43,10 @@ const FileConverter = ({ ); }; -export async function getServerSideProps(ctx: GetServerSidePropsContext) { +export async function getServerSideProps(ctx) { const lang = ctx.locale; const textLang = lang === 'es' ? lang : 'en'; - const pathname = ctx.params?.filename; + const pathname = ctx.params.filename; const metatagsDescriptions = require(`@/assets/lang/${textLang}/metatags-descriptions.json`); const navbarLang = require(`@/assets/lang/${textLang}/navbar.json`); diff --git a/src/pages/file-converter/index.tsx b/src/pages/file-converter/index.tsx index 0a98e7027..52a6aa8f3 100644 --- a/src/pages/file-converter/index.tsx +++ b/src/pages/file-converter/index.tsx @@ -8,7 +8,6 @@ import { FeaturesSection } from '@/components/file-converter/main-state/Features import CtaSection from '@/components/shared/CtaSection'; import QASection from '@/components/shared/FaqSection'; import Footer from '@/components/layout/footers/Footer'; -import { GetServerSidePropsContext } from 'next'; const FileConverter = ({ metatagsDescriptions, @@ -46,7 +45,7 @@ const FileConverter = ({ ); }; -export async function getServerSideProps(ctx: GetServerSidePropsContext) { +export async function getServerSideProps(ctx) { const lang = ctx.locale; const textLang = lang === 'es' ? lang : 'en'; diff --git a/src/pages/freemonth.tsx b/src/pages/freemonth.tsx new file mode 100644 index 000000000..c6a92c2c3 --- /dev/null +++ b/src/pages/freemonth.tsx @@ -0,0 +1,52 @@ +import HeroSection from '@/components/partnerships/freemonth/HeroSection'; +import FeatureSection from '@/components/partnerships/freemonth/FeatureSection'; +import Footer from '@/components/layout/footers/Footer'; +import Navbar from '@/components/layout/navbars/Navbar'; +import Layout from '@/components/layout/Layout'; +import cookies from '@/lib/cookies'; + +const SpecialOffer = ({ metatagsDescriptions, langJson, navbarLang, footerLang, deviceLang, lang }) => { + const metatags = metatagsDescriptions.filter((desc) => desc.id === 'freemonth'); + + return ( + + + + + + + +