Skip to content

Commit 90302ec

Browse files
author
Michał Gryczka
committed
Enhance Pricing Page: Added optional subtitle to PricingCards component, improved layout with a new header row, and updated styles for better responsiveness. Introduced a comprehensive feature comparison section in the pricing page for clearer user guidance.
1 parent dd5a882 commit 90302ec

File tree

4 files changed

+594
-60
lines changed

4 files changed

+594
-60
lines changed

src/components/pricing/Pricing.tsx

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,15 @@ type PricingData = PricingSchema & { content: string; id: string | number };
1111

1212
type PricingProps = {
1313
data: PricingData[];
14+
subtitle?: string;
1415
};
1516

1617
enum PricingPlan {
1718
ANNUAL,
1819
MONTHLY,
1920
}
2021

21-
export const PricingCards = ({ data }: PricingProps) => {
22+
export const PricingCards = ({ data, subtitle }: PricingProps) => {
2223
const annualEnabled = useMemo(
2324
() => data.filter((p) => p.annualPrice !== undefined).length > 0,
2425
[data],
@@ -27,13 +28,18 @@ export const PricingCards = ({ data }: PricingProps) => {
2728

2829
return (
2930
<div id="pricing-container">
30-
{annualEnabled && (
31-
<PricingToggle
32-
onChange={(v) => {
33-
setPlan(v);
34-
}}
35-
state={plan}
36-
/>
31+
{(subtitle || annualEnabled) && (
32+
<div className="pricing-header-row">
33+
{subtitle && <h2 className="pricing-subtitle">{subtitle}</h2>}
34+
{annualEnabled && (
35+
<PricingToggle
36+
onChange={(v) => {
37+
setPlan(v);
38+
}}
39+
state={plan}
40+
/>
41+
)}
42+
</div>
3743
)}
3844
<div className="plans">
3945
{data.map((pricingData) => (

src/components/pricing/style.scss

Lines changed: 66 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,33 @@
77
padding: 0 20px;
88
box-sizing: border-box;
99

10+
.pricing-header-row {
11+
width: 100%;
12+
display: flex;
13+
flex-flow: row wrap;
14+
align-items: center;
15+
justify-content: space-between;
16+
margin-bottom: 24px;
17+
gap: 16px;
18+
19+
@include break-down(sm) {
20+
flex-direction: column;
21+
align-items: center;
22+
text-align: center;
23+
}
24+
25+
.pricing-subtitle {
26+
font-size: 1.5rem;
27+
color: var(--text-body-secondary, #555);
28+
font-weight: 300;
29+
margin: 0;
30+
31+
@include break-up(md) {
32+
font-size: 1.75rem;
33+
}
34+
}
35+
}
36+
1037
#pricing-toggle {
1138
display: flex;
1239
flex-flow: row;
@@ -15,7 +42,6 @@
1542
border: 1px solid var(--text-body-primary);
1643
border-radius: 50px;
1744
min-height: 38px;
18-
margin-bottom: 50px;
1945

2046
& > button {
2147
box-sizing: border-box;
@@ -51,34 +77,34 @@
5177
}
5278

5379
@include break-up(sm) {
54-
grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
55-
column-gap: 15px;
56-
row-gap: 30px;
80+
grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
81+
column-gap: 12px;
82+
row-gap: 24px;
5783
justify-content: center;
5884
}
5985

6086
@include break-up(md) {
61-
grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
62-
column-gap: 20px;
63-
row-gap: 30px;
87+
grid-template-columns: repeat(2, minmax(220px, 280px));
88+
column-gap: 16px;
89+
row-gap: 24px;
6490
justify-content: center;
65-
max-width: 620px;
91+
max-width: 600px;
6692
margin: 0 auto;
6793
}
6894

6995
@include break-up(lg) {
70-
grid-template-columns: repeat(4, minmax(280px, 320px));
71-
column-gap: 30px;
72-
row-gap: 30px;
96+
grid-template-columns: repeat(4, minmax(200px, 260px));
97+
column-gap: 16px;
98+
row-gap: 24px;
7399
justify-content: center;
74100
max-width: none;
75101
margin: 0;
76102
}
77103

78104
@include break-up(xl) {
79-
grid-template-columns: repeat(4, 320px);
80-
column-gap: 30px;
81-
row-gap: 30px;
105+
grid-template-columns: repeat(4, 260px);
106+
column-gap: 20px;
107+
row-gap: 24px;
82108
justify-content: center;
83109
}
84110

@@ -95,10 +121,10 @@
95121
align-items: center;
96122
justify-content: center;
97123
box-sizing: border-box;
98-
padding: 20px;
124+
padding: 16px;
99125

100126
p {
101-
font-size: 18px;
127+
font-size: 16px;
102128
font-weight: 500;
103129
line-height: 1.4;
104130
color: var(--text-body-primary);
@@ -112,8 +138,8 @@
112138
flex-flow: column;
113139
align-items: center;
114140
justify-content: flex-start;
115-
row-gap: 10px;
116-
padding: 20px 0;
141+
row-gap: 8px;
142+
padding: 16px 0;
117143

118144
& > .price {
119145
display: flex;
@@ -135,7 +161,7 @@
135161

136162
.free {
137163
font-family: "Poppins";
138-
font-size: 30px;
164+
font-size: 24px;
139165
font-weight: 600;
140166
color: var(--text-body-primary);
141167
}
@@ -158,7 +184,7 @@
158184
.monthly {
159185
font-family: "Poppins";
160186
font-weight: 600;
161-
font-size: 30px;
187+
font-size: 24px;
162188
}
163189

164190
.annually {
@@ -167,13 +193,13 @@
167193
}
168194

169195
& > .annual-message {
170-
font-size: 12px;
171-
line-height: 1.5;
196+
font-size: 11px;
197+
line-height: 1.4;
172198
color: var(--text-body-primary);
173199
text-align: center;
174200
text-wrap: balance;
175201
box-sizing: border-box;
176-
padding: 0 20px;
202+
padding: 0 14px;
177203
}
178204

179205
& > .action-container {
@@ -189,13 +215,13 @@
189215
flex-flow: row nowrap;
190216
align-items: center;
191217
justify-content: center;
192-
min-width: calc(86.5px + (32 * 2px));
218+
min-width: calc(70px + (24 * 2px));
193219
border-radius: 25px;
194220
border: 1px solid var(--surface-main-primary);
195221
background-color: var(--surface-main-primary);
196222
box-sizing: border-box;
197223
text-decoration: none;
198-
padding: 10px;
224+
padding: 8px 12px;
199225
transition: border-color 0.2s, color 0.2s, background-color 0.2s;
200226

201227
&:hover, &:focus {
@@ -209,7 +235,7 @@
209235
}
210236

211237
span {
212-
font-size: 14px;
238+
font-size: 13px;
213239
font-weight: 500;
214240
line-height: 1.4;
215241
color: var(--text-button-secondary);
@@ -278,35 +304,35 @@
278304
.pricing-card {
279305
.content-container {
280306
box-sizing: border-box;
281-
padding: 20px;
307+
padding: 14px;
282308

283309
// Override typography for pricing page specific smaller fonts
284310
strong {
285-
font-size: 14px;
311+
font-size: 12px;
286312
font-weight: 600;
287-
line-height: 1.8;
313+
line-height: 1.6;
288314
display: block;
289-
margin-bottom: 12px;
315+
margin-bottom: 8px;
290316
color: var(--text-body-primary);
291317
}
292318

293319
ul {
294320
margin: 0;
295321
padding: 0;
296-
padding-left: 15px;
297-
line-height: 1.8;
322+
padding-left: 14px;
323+
line-height: 1.6;
298324

299325
li {
300-
font-size: 14px;
326+
font-size: 12px;
301327
font-weight: 400;
302-
line-height: 1.7;
303-
margin-bottom: 10px;
328+
line-height: 1.5;
329+
margin-bottom: 6px;
304330
text-wrap: balance;
305331

306332
& > span {
307333
display: block;
308-
font-size: 12px;
309-
line-height: 1.5;
334+
font-size: 11px;
335+
line-height: 1.4;
310336
color: var(--text-body-primary);
311337
}
312338
}
@@ -325,9 +351,9 @@
325351

326352
// Optimize paragraph spacing
327353
p {
328-
font-size: 14px;
329-
line-height: 1.6;
330-
margin-bottom: 12px;
354+
font-size: 12px;
355+
line-height: 1.5;
356+
margin-bottom: 8px;
331357
}
332358
}
333359
}

src/data/nav.json

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26,12 +26,8 @@
2626
"url": null,
2727
"children": [
2828
{
29-
"display": "Compare vs. Fortinet",
29+
"display": "Fortigate VPN Replacement",
3030
"url": "/defguard-vs-fortinet"
31-
},
32-
{
33-
"display": "Enterprise Features",
34-
"url": "https://docs.defguard.net/enterprise/license"
3531
}
3632
]
3733
},

0 commit comments

Comments
 (0)