Skip to content
This repository was archived by the owner on Apr 19, 2021. It is now read-only.

Commit f08ab76

Browse files
committed
adjust the pricing boxes.
1 parent d1f6a71 commit f08ab76

File tree

2 files changed

+61
-39
lines changed

2 files changed

+61
-39
lines changed

src/components/PricingBox.tsx

Lines changed: 18 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -10,16 +10,16 @@ interface StyledPricingBoxProps {
1010
hideButton?: boolean
1111
banner?: string
1212
bannerColor?: string
13-
backgroundColor?: string
1413
btnBackground?: boolean
14+
isTitleOutside?: boolean
1515
}
1616

1717
const StyledPricingBox = styled.div<StyledPricingBoxProps>`
1818
position: relative;
1919
margin: 2rem 1rem;
2020
padding: 3rem 2.8rem;
2121
font-size: 95%;
22-
min-height: 48rem;
22+
min-height: ${({ isTitleOutside }) => isTitleOutside ? '35rem' : '48rem'};
2323
min-width: 20rem;
2424
max-width: 26rem;
2525
width: 25%;
@@ -29,7 +29,7 @@ const StyledPricingBox = styled.div<StyledPricingBoxProps>`
2929
background-size: ${({ background }) => background ? 'cover' : null};
3030
background-position: ${({ background }) => background ? 'left' : null};
3131
border: 1px solid ${colors.offWhite2};
32-
background-color: ${({ backgroundColor }) => backgroundColor ? backgroundColor : null};
32+
background-color: ${colors.offWhite};
3333
3434
@media(min-width: ${sizes.breakpoints.md}) {
3535
z-index: ${({ transform }) => transform ? '1' : null};
@@ -43,6 +43,11 @@ const StyledPricingBox = styled.div<StyledPricingBoxProps>`
4343
min-height: 50rem;
4444
padding: 3rem 2rem;
4545
margin-bottom: 5rem;
46+
min-height: ${({ isTitleOutside }) => isTitleOutside ? '38rem' : '50rem'};
47+
48+
&:not(:last-of-type) {
49+
margin-bottom: ${({ isTitleOutside }) => isTitleOutside ? '8rem' : '5rem'};
50+
}
4651
}
4752
4853
@media(max-width: 1096px) {
@@ -54,7 +59,7 @@ const StyledPricingBox = styled.div<StyledPricingBoxProps>`
5459
}
5560
5661
@media(max-width: ${sizes.breakpoints.md}) {
57-
min-height: 45rem;
62+
min-height: ${({ isTitleOutside }) => isTitleOutside ? '35rem' : '45rem'};
5863
min-width: 30rem;
5964
padding: 2rem 3rem;
6065
}
@@ -74,6 +79,7 @@ const StyledPricingBox = styled.div<StyledPricingBoxProps>`
7479
7580
h4 {
7681
font-size: 1.8rem;
82+
margin: ${({ isTitleOutside }) => isTitleOutside ? '-7rem 0 6rem' : '' }
7783
}
7884
7985
img, object {
@@ -82,6 +88,8 @@ const StyledPricingBox = styled.div<StyledPricingBoxProps>`
8288
height: 8rem;
8389
width: 8rem;
8490
91+
display: ${({ isTitleOutside }) => isTitleOutside ? 'none' : '' };
92+
8593
@media(max-width: ${sizes.breakpoints.md}) {
8694
margin: 1.5rem 0 1rem;
8795
}
@@ -239,10 +247,10 @@ export interface PricingBoxProps {
239247
hideButton?: true
240248
btn?: JSX.Element
241249
text?: string
242-
banner?: string,
243-
bannerColor?: string,
244-
backgroundColor?: string,
250+
banner?: string
251+
bannerColor?: string
245252
subAction?: JSX.Element
253+
isTitleOutside?: boolean
246254
}
247255

248256
const PricingBox: React.SFC<PricingBoxProps> = ({
@@ -262,17 +270,17 @@ const PricingBox: React.SFC<PricingBoxProps> = ({
262270
text,
263271
banner,
264272
bannerColor,
265-
backgroundColor,
266-
subAction
273+
subAction,
274+
isTitleOutside
267275
}) => (
268276
<StyledPricingBox
269277
transform={transform}
270278
background={background}
271279
hideButton={hideButton}
272280
banner={banner}
273281
bannerColor={bannerColor}
274-
backgroundColor={backgroundColor}
275282
btnBackground={btnBackground}
283+
isTitleOutside={isTitleOutside}
276284
>
277285
<h4>{title}</h4>
278286
{img ? img : null}

src/components/pricing/PricingBoxes.tsx

Lines changed: 43 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ import PricingBox from '../PricingBox'
1212
import { isEurope } from '../../utils/helpers'
1313
import Cloud from '../../resources/cloud.svg'
1414
import Tabs from './Tabs'
15+
import { Link } from 'gatsby'
1516

1617
const Styled = styled.div`
1718
@@ -115,19 +116,28 @@ const plans: PricingBoxProps[] = [
115116

116117
const PricingContainer = styled.div`
117118
background-color: ${colors.white};
118-
padding: 3rem 0;
119-
justify-content: flex-start;
120119
border: 1px solid ${colors.offWhite2};
121-
border-left: none;
122-
border-right: none;
120+
padding: 6rem 0;
121+
122+
.cards {
123+
border-left: none;
124+
border-right: none;
125+
justify-content: flex-start;
126+
padding: 3rem 0;
127+
128+
.hide {
129+
display: none;
130+
}
123131
124-
.hide {
125-
display: none;
132+
.show {
133+
display: flex;
134+
flex-wrap: wrap;
135+
}
126136
}
127137
128-
.show {
129-
display: flex;
130-
flex-wrap: wrap;
138+
p {
139+
text-align: center;
140+
font-size: 130%;
131141
}
132142
`;
133143

@@ -143,33 +153,37 @@ const PricingBoxes = ({ isRendered, changeIsRendered }: PricingBoxesProps) => {
143153
<div className="grey-container container--1">
144154
<div className="row">
145155
<h1 className="sub">Plans &amp; Pricing</h1>
146-
<Tabs
156+
<Tabs
147157
isRendered={isRendered}
148158
changeIsRendered={changeIsRendered}
149159
/>
150160
</div>
151161
</div>
152162
<PricingContainer>
153-
<div
154-
className={`pricing__boxes ${isRendered ? 'hide' : 'show'}`}
155-
>
156-
{plans.map(
157-
(plan, i) => <PricingBox
158-
key={i}
159-
{...plan}
160-
/>
161-
)}
162-
</div>
163-
<div
164-
className={`pricing__boxes ${isRendered ? 'show' : 'hide'}`}
165-
>
166-
{selfHostedPlans.map(
167-
(plan, i) => <PricingBox
168-
key={i}
169-
{...plan}
170-
/>
171-
)}
163+
<div className="cards">
164+
<div
165+
className={`pricing__boxes ${isRendered ? 'hide' : 'show'}`}
166+
>
167+
{plans.map(
168+
(plan, i) => <PricingBox
169+
key={i}
170+
{...plan}
171+
/>
172+
)}
173+
</div>
174+
<div
175+
className={`pricing__boxes ${isRendered ? 'show' : 'hide'}`}
176+
>
177+
{selfHostedPlans.map(
178+
(plan, i) => <PricingBox
179+
key={i}
180+
{...plan}
181+
isTitleOutside={true}
182+
/>
183+
)}
184+
</div>
172185
</div>
186+
<p>Do you still have questions? Please, <Link to="/contact/">Get in Touch.</Link></p>
173187
</PricingContainer>
174188
</section>
175189
</Styled>;

0 commit comments

Comments
 (0)