Skip to content

Commit 2a20337

Browse files
committed
Refactor PricingAddons and SubscriptionToggle components
- Updated icon imports in pricingData.js from CloudOutlined to Cloud. - Removed commented-out academyPlans data and added tiered pricing directly in getAddOns function. - Modified secondaryFill color in AcademyIcon to a lighter shade. - Replaced monthlyPrice and yearlyPrice with a pricing array for better flexibility in add-ons. - Introduced SubscriptionToggle component to manage yearly/monthly toggle state. - Updated Pricing section to utilize SubscriptionToggle for better state management. - Added sliderThemeCustomization styles for consistent typography across various MUI components. Signed-off-by: Lee Calcote <lee.calcote@layer5.io>
1 parent c9bab8f commit 2a20337

7 files changed

Lines changed: 597 additions & 307 deletions

File tree

src/components/PlanCard/collapsible-details.js

Lines changed: 27 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -7,27 +7,44 @@ const FeatureDetailsWrapper = styled.div`
77
display: inline;
88
cursor: pointer;
99
10-
.open {
11-
margin: 0rem;
12-
list-style: none;
13-
height: auto !important;
14-
opacity: 1 !important;
10+
.details > * {
11+
max-height: 0;
12+
opacity: 0;
13+
margin: 0;
14+
visibility: hidden;
15+
overflow: hidden;
16+
transition: opacity 0.2s ease-in-out,
17+
max-height 0.3s ease-in-out 0.1s,
18+
margin 0.3s ease-in-out 0.1s,
19+
visibility 0s linear 0.4s;
20+
}
21+
22+
.details > .open {
23+
max-height: 200px;
24+
opacity: 1;
1525
margin-bottom: 1rem;
16-
transition: all 0.4s !important;
26+
visibility: visible;
27+
transition: visibility 0s linear,
28+
opacity 0.2s ease-in-out 0.1s,
29+
max-height 0.3s ease-in-out 0.2s,
30+
margin 0.3s ease-in-out 0.2s;
1731
}
1832
1933
.toggle-icon {
2034
width: 1.2rem;
2135
height: 1.2rem;
2236
fill: ${(props) => props.theme.primaryColor};
23-
transition: 0.8s cubic-bezier(0.2, 0.8, 0.2, 1);
37+
transition: transform 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
38+
}
39+
40+
.toggle-icon.expanded {
41+
transform: rotate(90deg);
2442
}
2543
2644
p {
2745
font-size: 0.9rem;
2846
margin: 0.5rem;
2947
color: ${(props) => props.theme.greyC1C1C1ToGreyB3B3B3};
30-
transition: 0.4s cubic-bezier(0.2, 0.8, 0.2, 1);
3148
}
3249
3350
.toggle-btn {
@@ -36,17 +53,6 @@ const FeatureDetailsWrapper = styled.div`
3653
vertical-align: middle;
3754
}
3855
39-
.closed {
40-
opacity: 1;
41-
height: 0;
42-
transition: none;
43-
visibility: hidden;
44-
}
45-
46-
.open {
47-
visibility: visible;
48-
}
49-
5056
h5 {
5157
display: inline-block;
5258
vertical-align: middle;
@@ -93,10 +99,10 @@ const FeatureDetails = ({ category, description, tier, children, onToggle }) =>
9399
</h5>
94100
<div className="details">
95101
{description && (
96-
<p className={`closed ${expand ? "open" : ""}`} dangerouslySetInnerHTML={{ __html: description }} />
102+
<p className={expand ? "open" : ""} dangerouslySetInnerHTML={{ __html: description }} />
97103
)}
98104
{children && (
99-
<div className={`closed ${expand ? "open" : ""}`}>
105+
<div className={expand ? "open" : ""}>
100106
{children}
101107
</div>
102108
)}

src/components/PlanCard/planCard.style.js

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -210,6 +210,17 @@ const PlanCardWrapper = styled.section`
210210
font-weight: 500;
211211
transition: 0.3s;
212212
background: ${(props) => props.theme.secondaryColor};
213+
214+
}
215+
.addon-chip {
216+
background-color: rgba(0, 179, 159, 0.15);
217+
color: ${(props) => props.theme.text.light};
218+
border: 1px solid;
219+
border-color: ${(props) => props.theme.secondaryColor};
220+
221+
}
222+
.addon-chip .MuiChip-icon {
223+
color: ${(props) => props.theme.secondaryColor};
213224
}
214225
`;
215226

0 commit comments

Comments
 (0)