-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathTabbedServicePrice.js
97 lines (90 loc) · 2.97 KB
/
TabbedServicePrice.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
import React, { Fragment } from "react";
import { connect, styled, css } from "frontity";
import * as Mixins from "../../../styles/Mixins";
import * as Variables from "../../../styles/Variables";
const TabbedServicePrice = ({ state, isWindowTint, prices }) => {
return (
<div>
{state.theme.tabbedServiceInfo.typeButtons.map((isActive, typeIndex) => {
if (isActive) {
return state.theme.tabbedServiceInfo.locationButtons.map(
(isActive, locationIndex) => {
if (isActive && prices?.[typeIndex]?.[locationIndex]) {
return (
<Fragment key={`price-${typeIndex}-${locationIndex}`}>
{!isWindowTint && (
<>
<PriceHeading>Starting from</PriceHeading>
<Price isWindowTint={isWindowTint}>
${prices?.[typeIndex]?.[locationIndex]}
</Price>
</>
)}
{isWindowTint && (
<WTContainer>
<WTPriceContainer>
<PriceHeading>
<strong>EVOLVE</strong> Starting from
</PriceHeading>
<Price isWindowTint={isWindowTint}>
$
{prices?.[typeIndex]?.[locationIndex].split("/")[0]}
</Price>
</WTPriceContainer>
<WTPriceContainer>
<PriceHeading>
<strong>CERAMIC IR</strong> Starting from
</PriceHeading>
<Price isWindowTint={isWindowTint}>
$
{prices?.[typeIndex]?.[locationIndex].split("/")[1]}
</Price>
</WTPriceContainer>
</WTContainer>
)}
</Fragment>
);
}
}
);
}
})}
</div>
);
};
export default connect(TabbedServicePrice);
const PriceHeading = styled.span`
font-family: trade-gothic-next-compressed, sans-serif;
font-weight: 400;
font-size: 1.5rem;
animation: ${Variables.fadeIn} 1s ease;
`;
const Price = styled.h4`
${(props) =>
props.isWindowTint
? css`
${Mixins.addHeadingFont(700, 6.5)};
`
: css`
${Mixins.addHeadingFont(700, 8)}
`}
color: ${Variables.colorRed};
line-height: 1;
padding-bottom: 2rem;
animation: ${Variables.fadeIn} 1s ease;
`;
const WTContainer = styled.ul`
display: flex;
justify-content: space-around;
gap: 3rem;
text-align: center;
@media (max-width: ${Variables.query450}) {
flex-direction: column;
justify-content: flex-start;
gap: 0;
}
`;
const WTPriceContainer = styled.li`
${Mixins.liCleanUp};
cursor: auto !important;
`;