Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions src/hooks/useSpecialOfferConfig.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,10 +47,12 @@ export const ALLOWED_PATHS = [
'tukaram',
'f4mi',
'macho',
'heise'
'heise',
'world-backup-day',
'gentiluomodigitale'
];
export const ALTERNATE_RECOMENDATED_PLAN_PATHS = new Set<string>([]);
export const DARK_MODE_PATHS = new Set<string>(['baity', 'oscar', 'rimembah', 'believemy', 'ghareeb']);
export const DARK_MODE_PATHS = new Set<string>([ 'oscar', 'rimembah', 'believemy', 'ghareeb']);
export const ALTERNATIVE_IMAGES_PATHS = new Set<string>(['baity']);
export const ONLY_ULTIMATE_PLANS_PATHS = new Set<string>(['ultimate']);
export const ULTIMATE_PREMIUM_PLANS_PATHS = new Set<string>([]);
Expand Down Expand Up @@ -103,6 +105,8 @@ export const COUPON_CODES = {
f4mi: PromoCodeName.f4mi,
macho: PromoCodeName.macho,
heise: PromoCodeName.heise,
'world-backup-day': PromoCodeName.worldBackupDay,
gentiluomodigitale: PromoCodeName.gentiluomodigitale,
};

interface OfferConfig {
Expand Down
4 changes: 3 additions & 1 deletion src/lib/types/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,9 @@ export enum PromoCodeName {
tukaram = 'TUKARAM',
f4mi = 'F4MI',
macho = 'MACHO',
heise = 'HEISE'
heise = 'HEISE',
worldBackupDay = 'WORLDBACKUPDAY',
gentiluomodigitale = 'GENTILUOMODIGITALE',
}

export interface PromoCodeProps {
Expand Down
14 changes: 10 additions & 4 deletions src/pages/[filename].tsx
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,7 @@ const LANG_MAP = {
f4mi: 'en',
heise: 'de',
macho: 'en',
gentiluomodigitale: 'it',
};

function CombinedSpecialOffer({
Expand All @@ -120,7 +121,6 @@ function CombinedSpecialOffer({

const {
products,
loadingCards,
currency,
currencyValue,
coupon: individualCoupon,
Expand Down Expand Up @@ -181,7 +181,13 @@ function CombinedSpecialOffer({
};

return (
<Layout title={metatags!.title} description={metatags!.description} segmentName="Partners" lang={lang}>
<Layout
title={metatags!.title}
description={metatags!.description}
segmentName="Partners"
lang={lang}
robots={pathname === 'world-backup-day' ? 'noindex,follow' : undefined}
>
<Navbar lang={lang} textContent={navbarLang} cta={['payment']} isLinksHidden hideCTA hideLogoLink />

<HeroSection
Expand Down Expand Up @@ -221,7 +227,7 @@ function CombinedSpecialOffer({
lifetimeCoupons={lifetimeCoupons}
lang={lang}
products={products}
loadingCards={loadingCards}
loadingCards={false}
onCheckoutButtonClicked={onCheckoutButtonClicked}
hideBusinessCards
hideBusinessSelector
Expand Down Expand Up @@ -292,7 +298,7 @@ function CombinedSpecialOffer({

export async function getServerSideProps(ctx) {
const pathname = ctx.params.filename;
const lang = LANG_MAP[pathname] || 'es';
const lang = pathname === 'world-backup-day' && ctx.locale ? ctx.locale : (LANG_MAP[pathname] || 'es');

const metatagsDescriptions = require(`@/assets/lang/${lang}/metatags-descriptions.json`);
const navbarLang = require(`@/assets/lang/${lang}/navbar.json`);
Expand Down