@@ -8,36 +8,71 @@ import PlanCard from "../../components/Pricing/PlanCard";
88import OpenSourceBanner from "./openSource" ;
99import { PricingAddons } from "../../components/Pricing/PricingAddons" ;
1010import SubscriptionToggle from "./SubscriptionToggle" ;
11+ import { Box , FormControl , InputLabel , MenuItem , Select , Typography } from "@sistent/sistent" ;
12+ import { Currencies } from "../../utils/currencies" ;
13+
14+ export const CurrencySelect = ( { currency, setCurrency } ) => {
15+ return (
16+ < FormControl variant = "outlined" size = "small" sx = { { minWidth : 150 } } >
17+ < InputLabel > Currency</ InputLabel >
18+ < Select
19+ value = { currency }
20+ sx = { { } }
21+ onChange = { ( e ) => setCurrency ( e . target . value ) }
22+ label = "Currency"
23+ renderValue = { ( value ) => (
24+ < Box sx = { { display : "flex" , alignItems : "center" , gap : 1 } } >
25+ < Typography variant = "body1" > { Currencies [ value ] . symbol } </ Typography >
26+ < Typography variant = "body2" color = "text.secondary" >
27+ { Currencies [ value ] . name }
28+ </ Typography >
29+ </ Box >
30+ ) }
31+ >
32+ { Object . entries ( Currencies ) . map ( ( [ code , { symbol, name } ] ) => (
33+ < MenuItem key = { code } value = { code } >
34+ < Box sx = { { display : "flex" , alignItems : "center" , gap : 1 } } >
35+ < Typography variant = "body1" > { symbol } </ Typography >
36+ < Typography variant = "body2" color = "text.secondary" >
37+ { name }
38+ </ Typography >
39+ </ Box >
40+ </ MenuItem >
41+ ) ) }
42+ </ Select >
43+ </ FormControl >
44+ ) ;
45+ }
1146
1247const Pricing = ( ) => {
13- // const [monthly, setMonthly] = useState(false);
14- const [ isYearly , setIsYearly ] = useState ( false ) ;
15-
16- return (
17- < PricingWrapper >
18- < div className = "headers" >
19- < h1 className = "header-heading" > Plans For Every Team Size </ h1 >
20-
21- < SubscriptionToggle isYearly = { isYearly } setIsYearly = { setIsYearly } />
22-
23- { /* <svg className="header-svg" aria-hidden="true" role="presentation" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100" preserveAspectRatio="none">
24- <polygon fill="white" points="0,100 100,0 100,100" />
25- <polygon fill="rgba(0,179,159,0.2)" points="50,50 100,0 100,100"/>
26- </svg> */ }
27- </ div >
28-
29- < div className = "wrapper" >
30- < PlanCard planData = { options } isYearly = { isYearly } / >
31- </ div >
32- < div style = { { marginTop : "7rem" , marginBottom : "3rem" } } >
33- < PricingAddons isYearly = { isYearly } setIsYearly = { setIsYearly } enterprisePlan = { options . filter ( opt => opt . tier == "Enterprise" ) [ 0 ] } / >
34- </ div >
35- < Comparison />
36- < Reviews />
37- < OpenSourceBanner />
38- < FAQ category = { [ "Pricing" , "Billing" ] } / >
39- </ PricingWrapper >
40- ) ;
48+ // const [monthly, setMonthly] = useState(false);
49+ const [ isYearly , setIsYearly ] = useState ( false ) ;
50+ const [ currency , setCurrency ] = useState ( "USD" ) ;
51+
52+ return (
53+ < PricingWrapper >
54+ < div className = "headers" >
55+ < h1 className = "header-heading" > Plans For Every Team Size </ h1 >
56+
57+ < CurrencySelect currency = { currency } setCurrency = { setCurrency } />
58+
59+ < SubscriptionToggle isYearly = { isYearly } setIsYearly = { setIsYearly } />
60+
61+ </ div >
62+
63+ < div className = "wrapper" >
64+ < PlanCard planData = { options } isYearly = { isYearly } currency = { currency } / >
65+ </ div >
66+ < div style = { { marginTop : "7rem" , marginBottom : "3rem" } } >
67+ < PricingAddons isYearly = { isYearly } setIsYearly = { setIsYearly } currency = { currency } / >
68+ </ div >
69+ < Comparison / >
70+ < Reviews />
71+ < OpenSourceBanner />
72+ < FAQ category = { [ "Pricing" , "Billing" ] } />
73+ </ PricingWrapper >
74+ ) ;
75+
4176} ;
4277
4378
0 commit comments