Skip to content
This repository was archived by the owner on Mar 13, 2025. It is now read-only.

Commit cf61433

Browse files
author
dengjun
committed
ci:fixing codes error
1 parent c131182 commit cf61433

File tree

2 files changed

+7
-6
lines changed

2 files changed

+7
-6
lines changed

src/components/Dropdown/index.jsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -93,8 +93,8 @@ Dropdown.defaultProps = {
9393
Dropdown.propTypes = {
9494
options: PT.arrayOf(
9595
PT.shape({
96-
label: PT.string.isRequired,
97-
selected: PT.bool.isRequired,
96+
label: PT.string,
97+
selected: PT.bool,
9898
})
9999
).isRequired,
100100
placeholder: PT.string,

src/utils/myGig.js

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -61,10 +61,11 @@ export function validatePhone(phoneNumber, country) {
6161
phoneNumber = phoneNumber.trim();
6262

6363
const code = codes.find((i) => i.isoCode3 === country);
64-
const regionCode = `+${code.countryCodes[0]}`;
65-
66-
error = !phoneNumber.startsWith(regionCode) && "Invalid country code";
67-
64+
let regionCode = "";
65+
if (code) {
66+
regionCode = `+${code.countryCodes[0]}`;
67+
error = !phoneNumber.startsWith(regionCode) && "Invalid country code";
68+
}
6869
if (!error) {
6970
const regexValidCharacters = /[\s0-9+-\.()]/g;
7071
error =

0 commit comments

Comments
 (0)