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
28 changes: 23 additions & 5 deletions _headers
Original file line number Diff line number Diff line change
@@ -1,17 +1,35 @@
# Cache static resources for 10 months
# Default: no cache for HTML files (allow fresh content)
/*.html
Cache-Control: public, max-age=3600, must-revalidate

# Cache immutable assets (with content hash) for 1 year
/framework-*.js
/app-*.js
/*.js
/*.css
Cache-Control: public, max-age=31536000, immutable

# Cache images and fonts for 1 year
/*.woff2
/*.webp
/*.jpeg
/*.webp
/*.gif
/*.svg
Cache-Control: public, max-age=25920000
/images/*
/fonts/*
Cache-Control: public, max-age=31536000, immutable

# Cache HTML files for 10 months
/*.html
Cache-Control: public, max-age=25920000
# Cache static files
/static/*
Cache-Control: public, max-age=31536000, immutable

# Security headers
/*
X-Frame-Options: SAMEORIGIN
X-Content-Type-Options: nosniff
X-XSS-Protection: 1; mode=block
Referrer-Policy: strict-origin-when-cross-origin



6 changes: 1 addition & 5 deletions src/components/Pricing/PlanCard/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ const PlanCard = ({ planData, isYearly, currency }) => {

const formatPrice = (price) => {
const formattedPrice = formatAndConvertPrice(price, currency);
// Remove the currency symbol by extracting only the numeric part
return parseFloat(formattedPrice.replace(/[^0-9.]/g, ""));
};
const getCurrencySymbol = (currency) => {
Expand All @@ -30,7 +29,6 @@ const PlanCard = ({ planData, isYearly, currency }) => {
<Container>
<Row $Hcenter className="plan-card-row">
{planData.map((x) => (
// <Col $xl={4} $lg={2} $md={1} $sm={1} key={x.tier}>
<Col key={x.tier} className="plan-card-col">
<div className={`${x.featured ? "featured" : ""} pricing-table`}>

Expand Down Expand Up @@ -64,7 +62,6 @@ const PlanCard = ({ planData, isYearly, currency }) => {


<Button
// disabled={x.tier === "Team Operator"}
$primary
className={
x.button[0] === "Coming Soon"
Expand All @@ -81,7 +78,6 @@ const PlanCard = ({ planData, isYearly, currency }) => {
<div className="pricing-features">
{x.summary &&
x.summary.map((t, index) => {
// Check if this is the first add-on feature
const isFirstAddOn = t.categoryOrder === "add-on" &&
(index === 0 || x.summary[index - 1].categoryOrder !== "add-on");

Expand Down Expand Up @@ -115,4 +111,4 @@ const PlanCard = ({ planData, isYearly, currency }) => {
);
};

export default PlanCard;
export default React.memo(PlanCard);
28 changes: 11 additions & 17 deletions src/components/Pricing/PricingAddons/index.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
/* eslint-disable indent */
import React, { useState, useEffect } from "react";
import React, { useState, useEffect, useCallback, useMemo } from "react";
import {
Container,
Card,
Expand Down Expand Up @@ -41,9 +40,8 @@ import {
} from "./styles";
import { formatAndConvertPrice, formatSliderPrice } from "../../../utils/currencies";

export const PricingAddons = ({ isYearly = false, setIsYearly, currency, enterprisePlan }) => {
export const PricingAddons = React.memo(({ isYearly = false, setIsYearly, currency, enterprisePlan }) => {
const [selectedAddon, setSelectedAddon] = useState(null);
// const [quantity, setQuantity] = useState(1);
const quantity = 1;
const [selectedSubAddOns, setSelectedSubAddOns] = useState({});
const [totalPrice, setTotalPrice] = useState(0);
Expand All @@ -62,7 +60,6 @@ export const PricingAddons = ({ isYearly = false, setIsYearly, currency, enterpr
return learners.toLocaleString("en-US");
};

// Helper function to render icons based on type
const renderIcon = (iconType) => {
switch (iconType) {
case "academy":
Expand Down Expand Up @@ -128,27 +125,26 @@ export const PricingAddons = ({ isYearly = false, setIsYearly, currency, enterpr
}
}, [selectedAddon, quantity, quantityIndex, selectedSubAddOns, isYearly, enterpriseUsers, enterprisePlan]);

const handleAddonChange = (addonId) => {
const handleAddonChange = useCallback((addonId) => {
const addon = addOns.find((a) => a.id === addonId);
setSelectedAddon(addon || null);
setQuantityIndex(0);

// Always select "academy-theory" if academy is chosen
if (addon?.id === "academy") {
setSelectedSubAddOns({ "academy-theory": true });
} else {
setSelectedSubAddOns({});
}
};
}, [addOns]);

const handleSubAddOnToggle = (subAddOnId, isChecked) => {
const handleSubAddOnToggle = useCallback((subAddOnId, isChecked) => {
setSelectedSubAddOns(prev => ({
...prev,
[subAddOnId]: isChecked
}));
};
}, []);

const getPlanLinkForAcademy = () => {
const getPlanLinkForAcademy = useCallback(() => {
if (!selectedAddon || selectedAddon.id !== "academy") {
return { link: "#", name: "Subscribe" };
}
Expand Down Expand Up @@ -180,9 +176,9 @@ export const PricingAddons = ({ isYearly = false, setIsYearly, currency, enterpr
}

return { link: "#", name: "Subscribe" };
};
}, [selectedAddon, quantityIndex, isYearly]);

const getPlanLinkForOtherAddons = () => {
const getPlanLinkForOtherAddons = useCallback(() => {
if (!selectedAddon || selectedAddon.id === "academy") {
return { link: "#", name: "Subscribe" };
}
Expand All @@ -191,7 +187,7 @@ export const PricingAddons = ({ isYearly = false, setIsYearly, currency, enterpr
link: "#",
name: "Subscribe"
};
};
}, [selectedAddon]);

return (
<SistentThemeProvider initialMode={isDark ? "dark" : "light"}>
Expand Down Expand Up @@ -337,7 +333,6 @@ export const PricingAddons = ({ isYearly = false, setIsYearly, currency, enterpr
min={0}
valueLabelDisplay="auto"
valueLabelFormat={(value) => {
// Determine which sub-addon to show pricing for
let targetSubAddon = null;
if (selectedSubAddOns["academy-practical"]) {
targetSubAddon = selectedAddon?.subAddOns?.find(sub => sub.id === "academy-practical");
Expand All @@ -356,7 +351,6 @@ export const PricingAddons = ({ isYearly = false, setIsYearly, currency, enterpr
return "";
}}
max={(() => {
// Determine which sub-addon to use for max value
let targetSubAddon = null;
if (selectedSubAddOns["academy-practical"]) {
targetSubAddon = selectedAddon?.subAddOns?.find(sub => sub.id === "academy-practical");
Expand Down Expand Up @@ -576,4 +570,4 @@ export const PricingAddons = ({ isYearly = false, setIsYearly, currency, enterpr
</CssBaseline>
</SistentThemeProvider>
);
};
});
1 change: 0 additions & 1 deletion src/html.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ export default function HTML(props) {
content="width=device-width, initial-scale=1, shrink-to-fit=no"
/>
{ }
<link rel="preconnect" href="https://fonts.gstatic.com/" crossOrigin="anonymous" />
<link
rel="preload"
as="style"
Expand Down
8 changes: 4 additions & 4 deletions src/reusecore/Blockquote/Blockquote-image/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ const Customers = (props) => {
<section className="bq-section">
<div className="type-one-wrapper type-one-wrapper-boxed">
<div className="bq-quote type-one-quote">
<div className="type-one-quote-userpic"><img src={props.image}></img></div>
<div className="type-one-quote-userpic"><img src={props.image} alt={props.person} loading="lazy"></img></div>
<div className="type-one-quote-qmark">
&#10077;
</div>
Expand Down Expand Up @@ -41,7 +41,7 @@ const Customers = (props) => {
</div>
</div>

<div className="type-two-quote-userpic"><img src={props.image} alt=""></img></div>
<div className="type-two-quote-userpic"><img src={props.image} alt={props.person} loading="lazy"></img></div>

<div className="type-two-quote-base">
<blockquote className="type-two-quote-text">
Expand Down Expand Up @@ -71,7 +71,7 @@ const Customers = (props) => {
{props.quote}
</blockquote>
<div className="type-three-quote-meta">
<div className="type-three-quote-userpic"><img src={props.image}></img></div>
<div className="type-three-quote-userpic"><img src={props.image} alt={props.person} loading="lazy"></img></div>
<div className="type-three-quote-meta-info">
<div className="type-three-quote-author"><cite>{props.person ? props.person : ""}</cite></div>
<div className="type-three-quote-source"><span>{props.title ? props.title : ""}</span></div>
Expand All @@ -87,4 +87,4 @@ const Customers = (props) => {
);
};

export default Customers;
export default React.memo(Customers);
3 changes: 1 addition & 2 deletions src/sections/Pricing/comparison.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import React from "react";
import styled from "styled-components";
import details from "./generateDetails";
import { Container } from "../../reusecore/Layout";
// import FeatureDetails from "./collapsible-details";
import FeatureDetails from "../../components/Pricing/PlanCard/collapsible-details";


Expand Down Expand Up @@ -244,4 +243,4 @@ const Comparison = () => {
);
};

export default Comparison;
export default React.memo(Comparison);
Loading