@@ -45,49 +45,56 @@ const getCustomToggleButtonStyle = (isActive, baseStyle) => ({
4545export const CurrencySelect = ( { currency, setCurrency } ) => {
4646 return (
4747 < FormControl
48- variant = "outlined"
49- size = "small"
50- sx = { {
51- minWidth : 150 ,
52- "& .MuiInputLabel-root" : { color : "white" } ,
53- "& .MuiInputLabel-root.Mui-focused" : { color : "#00B39F" } ,
54- "& .MuiOutlinedInput-notchedOutline" : { borderColor : "white" } ,
55- "& .MuiSelect-icon" : { color : "white" } ,
56- "& .MuiSelect-select" : { color : "white" } ,
57- "&:hover .MuiOutlinedInput-notchedOutline" : { borderColor : "white" } ,
58- } }
59- >
60- < InputLabel > Currency</ InputLabel >
61- < Select
62- value = { currency }
63- sx = { {
64- "&.Mui-focused .MuiOutlinedInput-notchedOutline" : {
65- borderColor : "#00B39F" ,
66- } ,
67- } }
68- onChange = { ( e ) => setCurrency ( e . target . value ) }
69- label = "Currency"
70- renderValue = { ( value ) => (
71- < Box sx = { { display : "flex" , alignItems : "center" , gap : 1 , color : "#fff" } } >
72- < Typography variant = "body1" > { Currencies [ value ] . symbol } </ Typography >
73- < Typography variant = "body2" >
74- { Currencies [ value ] . name }
75- </ Typography >
76- </ Box >
77- ) }
78- >
79- { Object . entries ( Currencies ) . map ( ( [ code , { symbol, name } ] ) => (
80- < MenuItem key = { code } value = { code } >
81- < Box sx = { { display : "flex" , alignItems : "center" , gap : 1 } } >
82- < Typography variant = "body1" > { symbol } </ Typography >
83- < Typography variant = "body2" >
84- { name }
85- </ Typography >
86- </ Box >
87- </ MenuItem >
88- ) ) }
89- </ Select >
90- </ FormControl >
48+ variant = "outlined"
49+ size = "small"
50+ sx = { {
51+ minWidth : 150 ,
52+ "& .MuiInputLabel-root" : {
53+ color : "white" ,
54+ "&.Mui-focused" : { color : "#00B39F" } ,
55+ } ,
56+ "& .MuiOutlinedInput-root" : {
57+ color : "white" ,
58+ "& .MuiSelect-icon" : { color : "white" } ,
59+ "& .MuiOutlinedInput-notchedOutline" : { borderColor : "white" } ,
60+ "&.Mui-focused .MuiOutlinedInput-notchedOutline" : {
61+ borderColor : "#00B39F" ,
62+ } ,
63+ } ,
64+ "&:hover" : {
65+ "& .MuiInputLabel-root" : { color : "#00B39F" } ,
66+ "& .MuiOutlinedInput-root .MuiOutlinedInput-notchedOutline" : {
67+ borderColor : "#00B39F" ,
68+ borderWidth : "2px" ,
69+ } ,
70+ } ,
71+ } }
72+ >
73+ < InputLabel id = "currency-selector-label" > Currency</ InputLabel >
74+ < Select
75+ labelId = "currency-selector-label"
76+ value = { currency }
77+ onChange = { ( e ) => {
78+ setCurrency ( e . target . value ) ;
79+ } }
80+ label = "Currency"
81+ renderValue = { ( value ) => (
82+ < Box sx = { { display : "flex" , alignItems : "center" , gap : 1 , color : "#fff" } } >
83+ < Typography variant = "body1" > { Currencies [ value ] ?. symbol } </ Typography >
84+ < Typography variant = "body2" > { Currencies [ value ] ?. name } </ Typography >
85+ </ Box >
86+ ) }
87+ >
88+ { Object . entries ( Currencies ) . map ( ( [ code , { symbol, name } ] ) => (
89+ < MenuItem key = { code } value = { code } >
90+ < Box sx = { { display : "flex" , alignItems : "center" , gap : 1 } } >
91+ < Typography variant = "body1" > { symbol } </ Typography >
92+ < Typography variant = "body2" > { name } </ Typography >
93+ </ Box >
94+ </ MenuItem >
95+ ) ) }
96+ </ Select >
97+ </ FormControl >
9198 ) ;
9299} ;
93100
0 commit comments