Skip to content

Commit

Permalink
fix: label comment addressed
Browse files Browse the repository at this point in the history
  • Loading branch information
Pritish Budhiraja committed Apr 18, 2024
1 parent d14006e commit 162d704
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 9 deletions.
12 changes: 6 additions & 6 deletions src/Components/DropdownField.res
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@ let updateArrayOfStringToOptionsTypeArray = arrayOfString =>
value: item,
})

let defaultValue = {
value: "",
}

open RecoilAtoms
@react.component
let make = (
Expand Down Expand Up @@ -43,9 +47,7 @@ let make = (
let findDisplayValue =
options
->Array.find((ele: optionType) => ele.value === value)
->Option.getOr({
value: "",
})
->Option.getOr(defaultValue)

switch setDisplayValue {
| Some(setDisplayValueFun) =>
Expand All @@ -63,9 +65,7 @@ let make = (
(
options
->Array.get(0)
->Option.getOr({
value: "",
})
->Option.getOr(defaultValue)
).value
)
}
Expand Down
4 changes: 1 addition & 3 deletions src/Components/PhoneNumberPaymentInput.res
Original file line number Diff line number Diff line change
Expand Up @@ -73,9 +73,7 @@ let make = () => {
let findDisplayValue =
phoneNumberCodeOptions
->Array.find(ele => ele.value === valueDropDown)
->Option.getOr({
value: "",
})
->Option.getOr(DropdownField.defaultValue)
setDisplayValue(_ =>
findDisplayValue.displayValue->Option.getOr(
findDisplayValue.label->Option.getOr(findDisplayValue.value),
Expand Down

0 comments on commit 162d704

Please sign in to comment.