@@ -8,36 +8,85 @@ 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 = { {
17+ minWidth : 150 ,
18+ "& .MuiInputLabel-root" : { color : "white" } , // label
19+ "& .MuiOutlinedInput-notchedOutline" : { borderColor : "white" } , // outline
20+ "& .MuiSelect-icon" : { color : "white" } , // dropdown arrow
21+ "& .MuiSelect-select" : { color : "white" } , // selected text
22+ "&:hover .MuiOutlinedInput-notchedOutline" : { borderColor : "white" } ,
23+ "&.Mui-focused .MuiOutlinedInput-notchedOutline" : { borderColor : "white" } ,
24+
25+ } } >
26+ < InputLabel > Currency</ InputLabel >
27+ < Select
28+ value = { currency }
29+ sx = { {
30+
31+
32+ } }
33+ onChange = { ( e ) => setCurrency ( e . target . value ) }
34+ label = "Currency"
35+ renderValue = { ( value ) => (
36+ < Box sx = { { display : "flex" , alignItems : "center" , gap : 1 , color : "#fff" } } >
37+ < Typography variant = "body1" > { Currencies [ value ] . symbol } </ Typography >
38+ < Typography variant = "body2" >
39+ { Currencies [ value ] . name }
40+ </ Typography >
41+ </ Box >
42+ ) }
43+ >
44+ { Object . entries ( Currencies ) . map ( ( [ code , { symbol, name } ] ) => (
45+ < MenuItem key = { code } value = { code } >
46+ < Box sx = { { display : "flex" , alignItems : "center" , gap : 1 } } >
47+ < Typography variant = "body1" > { symbol } </ Typography >
48+ < Typography variant = "body2" >
49+ { name }
50+ </ Typography >
51+ </ Box >
52+ </ MenuItem >
53+ ) ) }
54+ </ Select >
55+ </ FormControl >
56+ ) ;
57+ } ;
1158
1259const Pricing = ( ) => {
1360 // const [monthly, setMonthly] = useState(false);
1461 const [ isYearly , setIsYearly ] = useState ( false ) ;
62+ const [ currency , setCurrency ] = useState ( "USD" ) ;
1563
1664 return (
1765 < PricingWrapper >
1866 < div className = "headers" >
1967 < h1 className = "header-heading" > Plans For Every Team Size</ h1 >
2068
21- < SubscriptionToggle isYearly = { isYearly } setIsYearly = { setIsYearly } />
69+ < div style = { { display : "flex" , "gap" : "1rem" , alignItems : "center" , "justifyContent" : "flex-end" , width : "85%" } } >
70+ < CurrencySelect currency = { currency } setCurrency = { setCurrency } />
71+
72+ < SubscriptionToggle isYearly = { isYearly } setIsYearly = { setIsYearly } />
73+ </ div >
2274
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> */ }
2775 </ div >
2876
2977 < div className = "wrapper" >
30- < PlanCard planData = { options } isYearly = { isYearly } />
78+ < PlanCard planData = { options } isYearly = { isYearly } currency = { currency } />
3179 </ div >
3280 < div style = { { marginTop : "7rem" , marginBottom : "3rem" } } >
33- < PricingAddons isYearly = { isYearly } setIsYearly = { setIsYearly } enterprisePlan = { options . filter ( opt => opt . tier == "Enterprise" ) [ 0 ] } />
81+ < PricingAddons isYearly = { isYearly } setIsYearly = { setIsYearly } currency = { currency } enterprisePlan = { options . filter ( opt => opt . tier == "Enterprise" ) [ 0 ] } />
3482 </ div >
3583 < Comparison />
3684 < Reviews />
3785 < OpenSourceBanner />
3886 < FAQ category = { [ "Pricing" , "Billing" ] } />
3987 </ PricingWrapper >
4088 ) ;
89+
4190} ;
4291
4392
0 commit comments