@@ -7,6 +7,7 @@ import { useColorPalates } from '../../providers/theme-provider/hooks';
7
7
import { useConfig } from '../../hooks/useConfig' ;
8
8
import { AppContext } from '../../context' ;
9
9
import router from 'next/router' ;
10
+ import { NewLanguagePicker } from '@samagra-x/stencil-molecules/lib/language-picker/languagePicker' ;
10
11
11
12
const LanguagePicker = ( ) => {
12
13
const config = useConfig ( 'component' , 'sidebar' ) ;
@@ -31,40 +32,57 @@ const LanguagePicker = () => {
31
32
} ;
32
33
const theme = useColorPalates ( ) ;
33
34
34
- const languages = [
35
+ const languages : Array < {
36
+ name : string ;
37
+ value : string ;
38
+ } > = [
35
39
{ name : config ?. languageName1 , value : config ?. languageCode1 } ,
36
40
{ name : config ?. languageName2 , value : config ?. languageCode2 } ,
37
41
] ;
38
42
return (
39
- < FormControl
40
- sx = { {
41
- m : 1 ,
42
- background : theme ?. primary ?. main ,
43
- border : 'none' ,
44
- borderRadius : '10px' ,
45
- height : '36px' ,
46
- } }
47
- size = "small"
48
- data-testid = "language-picker"
49
- >
50
- < Select
51
- value = { activeLanguage }
52
- onChange = { handleChange }
53
- displayEmpty
54
- inputProps = { { 'aria-label' : 'Without label' } }
55
- sx = { {
56
- color : theme ?. primary ?. contrastText ,
43
+ // <FormControl
44
+ // sx={{
45
+ // m: 1,
46
+ // background: theme?.primary?.main,
47
+ // border: 'none',
48
+ // borderRadius: '10px',
49
+ // height: '36px',
50
+ // }}
51
+ // size="small"
52
+ // data-testid="language-picker"
53
+ // >
54
+ < NewLanguagePicker
55
+ activeLanguage = { activeLanguage }
56
+ handleLanguageClick = { handleChange }
57
+ languages = { languages }
58
+ customStyles = { {
59
+ formControlStyle : {
60
+ background : theme ?. primary ?. main ,
57
61
border : 'none' ,
58
62
borderRadius : '10px' ,
59
- width : '85px' ,
60
63
height : '36px' ,
61
- } }
62
- >
63
- { map ( languages , ( lang ) => (
64
- < MenuItem value = { lang ?. value } > { lang ?. name } </ MenuItem >
65
- ) ) }
66
- </ Select >
67
- </ FormControl >
64
+ } ,
65
+ } }
66
+ />
67
+
68
+ // <Select
69
+ // value={activeLanguage}
70
+ // onChange={handleChange}
71
+ // displayEmpty
72
+ // inputProps={{ 'aria-label': 'Without label' }}
73
+ // sx={{
74
+ // color: theme?.primary?.contrastText,
75
+ // border: 'none',
76
+ // borderRadius: '10px',
77
+ // width: '85px',
78
+ // height: '36px',
79
+ // }}
80
+ // >
81
+ // {map(languages, (lang) => (
82
+ // <MenuItem value={lang?.value}>{lang?.name}</MenuItem>
83
+ // ))}
84
+ // </Select>
85
+ // </FormControl>
68
86
) ;
69
87
} ;
70
88
0 commit comments