Skip to content
Merged
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
48 changes: 23 additions & 25 deletions src/components/partnersTemplate/HeroSection.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ interface HeroSectionForPartnerProps {
darkMode?: boolean;
image?: any;
isValentinesMode?: boolean;
isClubic?: boolean;
}

export default function HeroSection({
Expand All @@ -31,6 +32,7 @@ export default function HeroSection({
darkMode = false,
isValentinesMode = false,
image = 'internxt-private-cloud',
isClubic = false,
}: Readonly<HeroSectionForPartnerProps>): JSX.Element {
const [currency, setCurrency] = useState<string>('€');

Expand All @@ -57,31 +59,7 @@ export default function HeroSection({
return typeof text === 'string' ? text.replace(/{{discount}}/g, percentOff) : text;
};

const StyledTitle = ({ rawText }: { rawText: string }) => {
const parts = rawText.split(/(\/\/.*?\/\/|\*\*.*?\*\*)/g);

return (
<>
{parts.map((part, index) => {
if (part.startsWith('//') && part.endsWith('//')) {
return (
<span key={index} style={{ color: '#E93D82' }}>
{part.slice(2, -2)}
</span>
);
}
if (part.startsWith('**') && part.endsWith('**')) {
return (
<span key={index} style={{ color: '#007bff' }}>
{part.slice(2, -2)}
</span>
);
}
return part;
})}
</>
);
};


return (
<section
Expand Down Expand Up @@ -115,6 +93,26 @@ export default function HeroSection({
</div>
)}

{isClubic && (
<div className="flex flex-row items-center justify-center space-x-3.5 lg:justify-start ">
<Image
src={getImage('/images/partnerships/Clubic.webp')}
width={117}
height={27}
alt="Clubic logo"
/>
<X size={16} />
<Image
loading="lazy"
className="select-none"
src={`../../logos/internxt/cool-gray-90.svg`}
alt="Internxt logo"
width={130}
height={16}
/>
</div>
)}

<div className="flex w-full flex-wrap items-start justify-start gap-2 lg:flex-nowrap lg:justify-between">
{products.map((feature, index) => (
<div
Expand Down
6 changes: 6 additions & 0 deletions src/hooks/useSpecialOfferConfig.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ export const ALLOWED_PATHS = [
'cninternxtl',
'cooltechzone',
'lifetime',
'clubic',
];
export const ALTERNATE_RECOMENDATED_PLAN_PATHS = new Set<string>([]);
export const DARK_MODE_PATHS = new Set<string>(['baity', 'xavier', 'oscar', 'rimembah', 'believemy', 'ghareeb']);
Expand Down Expand Up @@ -91,6 +92,7 @@ export const COUPON_CODES = {
cninternxtl: PromoCodeName.cninternxtl,
cooltechzone: PromoCodeName.CTZ,
lifetime: PromoCodeName.lifetime,
clubic: PromoCodeName.DRIVE87,
};

interface OfferConfig {
Expand All @@ -103,6 +105,7 @@ interface OfferConfig {
ultimateAndPremiumPlans: boolean;
annualPlans: boolean;
lifetimePlans: boolean;
isClubic: boolean;
}

export const useOfferConfig = (pathname: string): OfferConfig => {
Expand All @@ -120,6 +123,7 @@ export const useOfferConfig = (pathname: string): OfferConfig => {
ultimateAndPremiumPlans: false,
annualPlans: false,
lifetimePlans: false,
isClubic: false,
};
}

Expand All @@ -130,6 +134,7 @@ export const useOfferConfig = (pathname: string): OfferConfig => {
const ultimateAndPremiumPlans = ULTIMATE_PREMIUM_PLANS_PATHS.has(selectedPathname);
const annualPlans = ANNUAL_PLANS_PATHS.has(selectedPathname);
const lifetimePlans = LIFETIME_PLANS_PATHS.has(selectedPathname);
const isClubic = selectedPathname === 'clubic';

const alternativeImages = ALTERNATIVE_IMAGES_PATHS.has(selectedPathname)
? selectedPathname
Expand All @@ -145,6 +150,7 @@ export const useOfferConfig = (pathname: string): OfferConfig => {
ultimateAndPremiumPlans,
annualPlans,
lifetimePlans,
isClubic,
};
}, [pathname]);
};
Expand Down
5 changes: 4 additions & 1 deletion src/pages/[filename].tsx
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@ const LANG_MAP = {
cninternxtl:'en',
cooltechzone:'en',
lifetime:'en',
clubic:'fr'
};

function CombinedSpecialOffer({
Expand All @@ -108,7 +109,8 @@ function CombinedSpecialOffer({
onlyUltimatePlan,
ultimateAndPremiumPlans,
annualPlans,
lifetimePlans
lifetimePlans,
isClubic
} = useOfferConfig(pathname);
const {
products,
Expand Down Expand Up @@ -181,6 +183,7 @@ function CombinedSpecialOffer({
percentOff={percentOff}
darkMode={isDarkMode}
image={alternativeImages}
isClubic={isClubic}
/>

<ReviewsSection textContent={langJson.ReviewSection} darkMode={isDarkMode} />
Expand Down
Loading