Skip to content

Commit 4a345a2

Browse files
authored
Merge pull request #6904 from Namanv0509/pricing-update
Pricing page update
2 parents 3e47ceb + 8f28ea8 commit 4a345a2

3 files changed

Lines changed: 65 additions & 22 deletions

File tree

src/components/Pricing/PlanCard/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ const PlanCard = ({ planData, isYearly, currency }) => {
5151

5252
<div className="price">
5353
<span className="price-amount">
54-
<sup>{getCurrencySymbol(currency)}</sup>
54+
<sup><strong>{getCurrencySymbol(currency)}</strong></sup>
5555
{isYearly
5656
? formatPrice(x.yearlyprice)
5757
: formatPrice(x.monthlyprice)}

src/components/Pricing/PricingAddons/index.js

Lines changed: 18 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,6 @@ export const PricingAddons = ({ isYearly = false, setIsYearly, currency, enterpr
143143
}));
144144
};
145145

146-
147146
const getPlanLinkForAcademy = () => {
148147
if (!selectedAddon || selectedAddon.id !== "academy") {
149148
return { link: "#", name: "Subscribe" };
@@ -175,7 +174,7 @@ export const PricingAddons = ({ isYearly = false, setIsYearly, currency, enterpr
175174
const enterpriseUserSeats = enterpriseUsers > 0 ? ` and ${enterpriseUsers} enterprise user${enterpriseUsers > 1 ? "s" : ""}` : "";
176175
return {
177176
link: matchingPlanLink.link,
178-
name: "Subscribe"
177+
name: "Subscribe For Add-on"
179178
};
180179
}
181180

@@ -189,7 +188,7 @@ export const PricingAddons = ({ isYearly = false, setIsYearly, currency, enterpr
189188

190189
return {
191190
link: "#",
192-
name: "Subscribe For"
191+
name: "Subscribe For Add-on"
193192
};
194193
};
195194

@@ -390,28 +389,28 @@ export const PricingAddons = ({ isYearly = false, setIsYearly, currency, enterpr
390389
label: (
391390
<Box sx={{ textAlign: "center", fontSize: "1.25rem", fontWeight: "bold" }}>
392391
<Box>{option.learners === "2500+" ? "2,500+" : option.learners}</Box>
393-
<Box
394-
sx={{
395-
color: "text.secondary",
396-
mb: 1.5,
397-
fontSize: {
398-
xs: "0.75rem",
399-
sm: "0.9rem",
400-
}
401-
}}>
402-
{formatSliderPrice(isYearly ? option.yearlyPerUser : option.monthlyPerUser, currency)}<br />{targetSubAddon.unitLabelSingular}/{isYearly ? "year" : "month"}
403-
{isYearly && (
392+
{isYearly && (
404393
<Box
405394
sx={{
406395
fontSize: {
407-
xs: "0.7rem",
408-
sm: "0.7rem",
396+
xs: "0.75rem",
397+
sm: "0.9rem",
409398
}
410399
}}
411400
>
412-
{formatSliderPrice(option.yearlyPerUser / 12, currency)}/{targetSubAddon.unitLabelSingular}/month
401+
{formatSliderPrice(option.yearlyPerUser/12, currency)}<br/>{targetSubAddon.unitLabelSingular}/month
413402
</Box>
414403
)}
404+
<Box
405+
sx={{
406+
color: "text.secondary",
407+
mb: 1.5,
408+
fontSize: {
409+
xs: "0.75rem",
410+
sm: "0.8rem",
411+
}
412+
}}>
413+
{formatSliderPrice(isYearly ? option.yearlyPerUser : option.monthlyPerUser, currency)}/{targetSubAddon.unitLabelSingular}/{isYearly ? "year" : "month"}
415414
</Box>
416415
</Box>
417416
),
@@ -519,7 +518,7 @@ export const PricingAddons = ({ isYearly = false, setIsYearly, currency, enterpr
519518
}
520519
return formatPrice(0);
521520
}
522-
})()}/{isYearly ? "yearly" : "monthly"}
521+
})()} /{isYearly ? "yearly" : "monthly"}
523522
</Typography>
524523
</Box>
525524

@@ -595,4 +594,4 @@ export const PricingAddons = ({ isYearly = false, setIsYearly, currency, enterpr
595594
</CssBaseline>
596595
</SistentThemeProvider>
597596
);
598-
};
597+
};

src/sections/Pricing/index.js

Lines changed: 46 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,40 @@ import options from "./generatePlans";
77
import PlanCard from "../../components/Pricing/PlanCard";
88
import OpenSourceBanner from "./openSource";
99
import { PricingAddons } from "../../components/Pricing/PricingAddons";
10-
import SubscriptionToggle from "./SubscriptionToggle";
1110
import { Box, FormControl, InputLabel, MenuItem, Select, Typography } from "@sistent/sistent";
1211
import { Currencies } from "../../utils/currencies";
12+
import {
13+
toggleButtonStyles,
14+
getToggleButtonStyle,
15+
} from "../../components/Pricing/PricingAddons/styles.js";
16+
import { min } from "lodash";
17+
18+
const customToggleButtonStyles = {
19+
container: {
20+
...toggleButtonStyles.container,
21+
backgroundColor: "transparent",
22+
p: "6px",
23+
minHeight: "42px",
24+
minWidth: "50px",
25+
borderColor:"#ffffffff"
26+
},
27+
base: {
28+
py: 0.5,
29+
px: 4,
30+
fontSize: "4rem",
31+
...toggleButtonStyles.base,
32+
},
33+
};
34+
35+
const getCustomToggleButtonStyle = (isActive, baseStyle) => ({
36+
...getToggleButtonStyle(isActive, baseStyle),
37+
backgroundColor: isActive ? "#00B39F" : "transparent",
38+
color: isActive ? "#fffcfcff" : "#fff",
39+
fontSize: "1rem",
40+
"&:hover": {
41+
backgroundColor: isActive ? "#009B8A" : "transparent",
42+
},
43+
});
1344

1445
export const CurrencySelect = ({ currency, setCurrency }) => {
1546
return (
@@ -73,7 +104,20 @@ const Pricing = () => {
73104
<div style={{ display: "flex", "gap": "1rem", alignItems: "center", "justifyContent": "flex-end", width: "85%" }} >
74105
<CurrencySelect currency={currency} setCurrency={setCurrency} />
75106

76-
<SubscriptionToggle isYearly={isYearly} setIsYearly={setIsYearly} />
107+
<Box sx={customToggleButtonStyles.container}>
108+
<Box
109+
onClick={() => setIsYearly(false)}
110+
sx={getCustomToggleButtonStyle(!isYearly, customToggleButtonStyles.base)}
111+
>
112+
Monthly
113+
</Box>
114+
<Box
115+
onClick={() => setIsYearly(true)}
116+
sx={getCustomToggleButtonStyle(isYearly, customToggleButtonStyles.base)}
117+
>
118+
Yearly
119+
</Box>
120+
</Box>
77121
</div>
78122

79123
</div>

0 commit comments

Comments
 (0)