File tree Expand file tree Collapse file tree 4 files changed +12
-12
lines changed
src/components/inputs/InputIntlPhone/CountrySelector Expand file tree Collapse file tree 4 files changed +12
-12
lines changed Original file line number Diff line number Diff line change 34
34
"react-icons" : " ^5.4.0"
35
35
},
36
36
"peerDependencies" : {
37
- "antd" : " ^5.23.3 " ,
37
+ "antd" : " ^5.23.4 " ,
38
38
"react" : " ^19.0.0" ,
39
39
"react-dom" : " ^19.0.0"
40
40
},
58
58
"@vitejs/plugin-react-swc" : " ^3.7.2" ,
59
59
"@vitest/coverage-v8" : " ^3.0.5" ,
60
60
"ajv" : " ^8.17.1" ,
61
- "biome-extends" : " ^1.1 .0" ,
61
+ "biome-extends" : " ^1.2 .0" ,
62
62
"chromatic" : " ^11.25.2" ,
63
63
"concurrently" : " ^9.1.2" ,
64
64
"git-cz" : " ^4.9.0" ,
65
- "happy-dom" : " ^16.8.1 " ,
65
+ "happy-dom" : " ^17.0.0 " ,
66
66
"knip" : " ^5.43.6" ,
67
67
"lefthook" : " ^1.10.10" ,
68
68
"semantic-release" : " ^24.2.1" ,
69
69
"storybook" : " ^8.5.3" ,
70
70
"typescript" : " ^5.7.3" ,
71
- "vite" : " ^6.0.11 " ,
71
+ "vite" : " ^6.1.0 " ,
72
72
"vite-plugin-dts" : " ^4.5.0" ,
73
73
"vitest" : " ^3.0.5" ,
74
74
"wait-on" : " ^8.0.2" ,
Original file line number Diff line number Diff line change 1
1
import { Space } from 'antd' ;
2
2
import { CountryFlag } from 'src/components' ;
3
3
import { useInputIntlPhoneContext } from '../InputIntlPhoneContext' ;
4
- import type { OptionRender } from './types' ;
4
+ import type { Option } from './types' ;
5
5
6
- export const CountryRender : OptionRender = ( props ) => {
7
- const data = props . data ;
6
+ export function CountryRender ( props : { option : Option } ) {
7
+ const option = props . option ;
8
8
const { customRegions } = useInputIntlPhoneContext ( ) ;
9
- const customEmoji = customRegions ?. find ( ( region ) => region . value === data . value ) ?. emoji ;
9
+ const customEmoji = customRegions ?. find ( ( region ) => region . value === option . value ) ?. emoji ;
10
10
11
11
return (
12
12
< Space >
13
- < CountryFlag countryCode = { data . value } emoji = { customEmoji } width = { 24 } />
14
- { data . label }
13
+ < CountryFlag countryCode = { option . value } emoji = { customEmoji } width = { 24 } />
14
+ { option . label }
15
15
</ Space >
16
16
) ;
17
- } ;
17
+ }
Original file line number Diff line number Diff line change @@ -68,7 +68,7 @@ export function CountrySelector() {
68
68
showSearch
69
69
placeholder = 'Search Country'
70
70
filterOption = { filterOption }
71
- optionRender = { CountryRender }
71
+ optionRender = { ( opt , info ) => < CountryRender option = { opt . data } key = { info . index } /> }
72
72
onSelect = { onSelect }
73
73
options = { options }
74
74
value = { state . countryCode }
You can’t perform that action at this time.
0 commit comments