Skip to content

Commit 4813f05

Browse files
committed
slider updates
Signed-off-by: Namanv509 <namanverma00260@gmail.com>
1 parent a1d21ae commit 4813f05

3 files changed

Lines changed: 62 additions & 48 deletions

File tree

src/components/Pricing/PricingAddons/index.js

Lines changed: 44 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,7 @@ export const PricingAddons = ({ isYearly = false, setIsYearly ,currency,enterpri
177177
const enterpriseUserSeats = enterpriseUsers > 0 ? ` and ${enterpriseUsers} enterprise user${enterpriseUsers > 1 ? "s" : ""}` : "";
178178
return {
179179
link: matchingPlanLink.link,
180-
name: `Subscribe (${currentLearnerCount} learners${targetSubAddonName ? " " + targetSubAddonName : ""}${enterpriseUserSeats})`
180+
name: `Subscribe For Add-on`
181181
};
182182
}
183183

@@ -191,7 +191,7 @@ export const PricingAddons = ({ isYearly = false, setIsYearly ,currency,enterpri
191191

192192
return {
193193
link: "#",
194-
name: `Subscribe to ${selectedAddon.name}`
194+
name: `Subscribe For Add-on`
195195
};
196196
};
197197

@@ -361,7 +361,7 @@ export const PricingAddons = ({ isYearly = false, setIsYearly ,currency,enterpri
361361
const option = targetSubAddon.pricing[value];
362362
const pricePerUser = isYearly ? option.yearlyPerUser : option.monthlyPerUser;
363363
const totalPrice = pricePerUser * option.learners;
364-
const period = isYearly ? "/month" : "/month";
364+
const period = isYearly ? "/year" : "/month";
365365
return `${option.learners} learners - ${formatPrice(totalPrice)}${period}`;
366366
}
367367
return "";
@@ -409,7 +409,7 @@ export const PricingAddons = ({ isYearly = false, setIsYearly ,currency,enterpri
409409
})()}
410410
/>
411411
<Box sx={boxStyles.disclaimerSection}>
412-
<Typography variant="body2" sx={typographyStyles.italic}>
412+
<Typography variant="body2" sx={typographyStyles.italic }>
413413
Looking for a plan larger than 2,500 learners? Great! <a href="/company/contact">Let us know</a>.
414414
</Typography>
415415
</Box>
@@ -420,39 +420,48 @@ export const PricingAddons = ({ isYearly = false, setIsYearly ,currency,enterpri
420420
{selectedAddon !== null && selectedAddon.id !== "academy" && (
421421
<>
422422
<Box sx={boxStyles.unitQuantitySection}>
423-
<Typography variant="h6" fontWeight="600" sx={boxStyles.unitQuantityTitle}>
423+
<Typography variant="h6" sx={boxStyles.unitQuantityTitle}>
424424
{selectedAddon.pricing?.[quantityIndex]?.units || 0} {selectedAddon?.unitLabel}
425425
</Typography>
426426
<Slider
427-
value={quantityIndex}
428-
onChange={(event, newValue) => setQuantityIndex(newValue)}
429-
min={0}
430-
max={selectedAddon?.pricing?.length - 1 || 0}
431-
step={null}
432-
valueLabelDisplay="auto"
433-
valueLabelFormat={(value) => {
434-
if (selectedAddon?.pricing && selectedAddon.pricing[value]) {
435-
const option = selectedAddon.pricing[value];
436-
const unitPrice = isYearly ? option.yearlyPerUnit : option.monthlyPerUnit;
437-
const totalPrice = unitPrice * option.units;
438-
const period = isYearly ? "/year" : "/month";
439-
return `${option.units} ${selectedAddon?.unitLabel?.slice(0, -1) || "unit"} - ${formatPrice(totalPrice)}${period}`;
440-
}
441-
return "";
442-
}}
443-
sx={getSliderStyle(sliderStyles.baseOther, "14px")}
444-
marks={selectedAddon?.pricing?.map((option, index) => ({
445-
value: index,
446-
label: (
447-
<Box sx={boxStyles.sliderMarks}>
448-
<Box>{option.units}</Box>
449-
<Box sx={boxStyles.sliderPriceText}>
450-
{formatPrice(isYearly ? option.yearlyPerUnit * option.units : option.monthlyPerUnit * option.units)}
427+
value={quantityIndex}
428+
onChange={(event, newValue) => setQuantityIndex(newValue)}
429+
min={0}
430+
valueLabelDisplay="auto"
431+
valueLabelFormat={(value) => {
432+
const option = selectedAddon?.pricing?.[value];
433+
if (option) {
434+
const pricePerUnit = isYearly ? option.yearlyPerUnit : option.monthlyPerUnit;
435+
const totalPrice = pricePerUnit * option.units;
436+
const period = isYearly ? "/year" : "/month";
437+
return `${option.units} ${selectedAddon.unitLabel?.slice(0, -1) || "unit"} - ${formatPrice(totalPrice)}${period}`;
438+
}
439+
return "";
440+
}}
441+
max={(selectedAddon?.pricing?.length - 1) || 0}
442+
step={null}
443+
sx={getSliderStyle(sliderStyles.baseOther, "1rem")} // ← use same style as academy
444+
marks={selectedAddon?.pricing?.map((option, index) => ({
445+
value: index,
446+
label: (
447+
<Box sx={{ textAlign: "center", fontSize: "1.25rem", fontWeight: "bold" }}>
448+
<Box>{option.units}</Box>
449+
<Box
450+
sx={{
451+
color: "text.secondary",
452+
mb: 1.5,
453+
fontSize: {
454+
xs: "0.75rem",
455+
sm: "0.9rem",
456+
}
457+
}}>
458+
{formatPrice(isYearly ? option.yearlyPerUnit : option.monthlyPerUnit)}<br />{selectedAddon.unitLabel?.slice(0, -1) || "unit"}/{isYearly ? "year" : "month"}
459+
</Box>
451460
</Box>
452-
</Box>
453-
),
454-
})) || []}
455-
/>
461+
)
462+
}))}
463+
/>
464+
456465
</Box>
457466
</>
458467
)}
@@ -468,7 +477,7 @@ export const PricingAddons = ({ isYearly = false, setIsYearly ,currency,enterpri
468477
>
469478
<Box sx={{ ...boxStyles.flexBetween, ...boxStyles.pricingHeader }}>
470479
<Typography variant="h6" sx={typographyStyles.subheading} gutterBottom>
471-
Add-on × Quantity per Subscription Duration
480+
Add-on × Quantity / per Subscription Duration
472481
</Typography>
473482
<Typography variant="h6" sx={typographyStyles.subheading} gutterBottom>
474483
SUBTOTAL
@@ -543,9 +552,7 @@ export const PricingAddons = ({ isYearly = false, setIsYearly ,currency,enterpri
543552
{formatPrice((isYearly ? enterprisePlan.yearlyprice : enterprisePlan.monthlyprice) * (enterpriseUsers > 0 ? enterpriseUsers : 1))}/{isYearly ? "monthly" : "yearly"}
544553
</Typography>
545554
</Box>
546-
<Typography variant="h6" sx={typographyStyles.subheading} gutterBottom>
547-
TOTAL
548-
</Typography>
555+
549556
<Box sx={boxStyles.flexBetween}>
550557
<Typography variant="body1" gutterBottom sx={typographyStyles.subheading}>
551558
{isYearly ? "Yearly" : "Monthly"} Cost

src/components/Pricing/PricingAddons/pricingData.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -70,8 +70,8 @@ export const getAddOns = () => [
7070
monthlyPrice: 64,
7171
yearlyPrice: 653, // ~15% discount for yearly
7272
iconType: "cloud", // Reference to icon type instead of component
73-
unitLabel: "servers",
74-
unitLabelSingular: "server",
73+
unitLabel: "Servers",
74+
unitLabelSingular: "Server",
7575
maxUnits: 50,
7676
pricing: [
7777
{ units: 1, monthlyPerUnit: 64, yearlyPerUnit: 54.40, currency: "$" },
@@ -87,8 +87,8 @@ export const getAddOns = () => [
8787
monthlyPrice: 1.50,
8888
yearlyPrice: 15.30, // ~15% discount for yearly
8989
iconType: "group", // Reference to icon type instead of component
90-
unitLabel: "collaborators",
91-
unitLabelSingular: "collaborator",
90+
unitLabel: "Collaborators",
91+
unitLabelSingular: "Collaborator",
9292
maxUnits: 200,
9393
pricing: [
9494
{ units: 1, monthlyPerUnit: 2, yearlyPerUnit: 1.70, currency: "$" },

src/components/Pricing/PricingAddons/styles.js

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
// Common styles for PricingAddons component
22

3+
import { CurrencyYenRounded } from "@mui/icons-material";
4+
35
export const QANELAS_FONT = "\"Qanelas Soft\", \"Open Sans\", sans-serif";
46

57
// Typography styles
@@ -24,7 +26,8 @@ export const typographyStyles = {
2426
italic: {
2527
fontFamily: QANELAS_FONT,
2628
fontStyle: "italic",
27-
color: "text.secondary"
29+
color: "text.secondary",
30+
marginTop: 5
2831
},
2932
headerTitle: {
3033
fontSize: 16,
@@ -53,7 +56,9 @@ export const typographyStyles = {
5356
fontSize: "0.8rem",
5457
fontStyle: "italic",
5558
fontFamily: QANELAS_FONT,
56-
color: "text.secondary"
59+
color: "text.secondary",
60+
marginTop: 5,
61+
marginBottom: 5,
5762
},
5863
pricingItemLeft: {
5964
marginLeft: 0.5,
@@ -192,8 +197,10 @@ export const boxStyles = {
192197
justifyContent: "center"
193198
},
194199
unitQuantityTitle: {
195-
fontSize: "1rem",
196-
mb: 1
200+
justifySelf: "center",
201+
textAlign: "center",
202+
width: "100%",
203+
fontFamily: QANELAS_FONT
197204
},
198205
pricingPaper: {
199206
p: 2.5,
@@ -217,7 +224,7 @@ export const boxStyles = {
217224
alignItems: "center"
218225
},
219226
enterpriseUserInput: {
220-
width: "5rem",
227+
width: "4rem",
221228
ml: 1,
222229
"& .MuiInputBase-input": {
223230
py: "0.25rem"
@@ -284,8 +291,8 @@ export const sliderStyles = {
284291
justifyContent: "center"
285292
},
286293
baseOther: {
287-
mb: 4,
288-
ml: 6,
294+
mb: 6,
295+
ml: 7,
289296
width: "80%",
290297
display: "flex",
291298
justifyContent: "center"

0 commit comments

Comments
 (0)