Skip to content

Commit 06fee7d

Browse files
committed
fix: 🐛 intl phone
1 parent 35f93c6 commit 06fee7d

File tree

4 files changed

+12
-12
lines changed

4 files changed

+12
-12
lines changed

bun.lockb

772 Bytes
Binary file not shown.

package.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
"react-icons": "^5.4.0"
3535
},
3636
"peerDependencies": {
37-
"antd": "^5.23.3",
37+
"antd": "^5.23.4",
3838
"react": "^19.0.0",
3939
"react-dom": "^19.0.0"
4040
},
@@ -58,17 +58,17 @@
5858
"@vitejs/plugin-react-swc": "^3.7.2",
5959
"@vitest/coverage-v8": "^3.0.5",
6060
"ajv": "^8.17.1",
61-
"biome-extends": "^1.1.0",
61+
"biome-extends": "^1.2.0",
6262
"chromatic": "^11.25.2",
6363
"concurrently": "^9.1.2",
6464
"git-cz": "^4.9.0",
65-
"happy-dom": "^16.8.1",
65+
"happy-dom": "^17.0.0",
6666
"knip": "^5.43.6",
6767
"lefthook": "^1.10.10",
6868
"semantic-release": "^24.2.1",
6969
"storybook": "^8.5.3",
7070
"typescript": "^5.7.3",
71-
"vite": "^6.0.11",
71+
"vite": "^6.1.0",
7272
"vite-plugin-dts": "^4.5.0",
7373
"vitest": "^3.0.5",
7474
"wait-on": "^8.0.2",
Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
11
import { Space } from 'antd';
22
import { CountryFlag } from 'src/components';
33
import { useInputIntlPhoneContext } from '../InputIntlPhoneContext';
4-
import type { OptionRender } from './types';
4+
import type { Option } from './types';
55

6-
export const CountryRender: OptionRender = (props) => {
7-
const data = props.data;
6+
export function CountryRender(props: { option: Option }) {
7+
const option = props.option;
88
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;
1010

1111
return (
1212
<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}
1515
</Space>
1616
);
17-
};
17+
}

src/components/inputs/InputIntlPhone/CountrySelector/CountrySelector.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ export function CountrySelector() {
6868
showSearch
6969
placeholder='Search Country'
7070
filterOption={filterOption}
71-
optionRender={CountryRender}
71+
optionRender={(opt, info) => <CountryRender option={opt.data} key={info.index} />}
7272
onSelect={onSelect}
7373
options={options}
7474
value={state.countryCode}

0 commit comments

Comments
 (0)