Skip to content

Commit

Permalink
chore: update merchant name after sbx onbaording (#1987)
Browse files Browse the repository at this point in the history
Co-authored-by: Gitanjli Chopra <[email protected]>
Co-authored-by: prajwalnl0 <[email protected]>
  • Loading branch information
3 people authored Dec 30, 2024
1 parent 0138abe commit 1cc440b
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions src/screens/OMPSwitch/MerchantSwitch.res
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,9 @@ let make = () => {
let {userInfo: {merchantId}} = React.useContext(UserInfoProvider.defaultContext)
let (showModal, setShowModal) = React.useState(_ => false)
let (merchantList, setMerchantList) = Recoil.useRecoilState(HyperswitchAtom.merchantListAtom)
let merchantDetailsTypedValue = Recoil.useRecoilValueFromAtom(
HyperswitchAtom.merchantDetailsValueAtom,
)
let (showSwitchingMerch, setShowSwitchingMerch) = React.useState(_ => false)
let (arrow, setArrow) = React.useState(_ => false)

Expand Down Expand Up @@ -189,6 +192,11 @@ let make = () => {
setArrow(prev => !prev)
}

let subHeading =
merchantDetailsTypedValue.merchant_name->Option.isNone
? currentOMPName(merchantList, merchantId)
: merchantDetailsTypedValue.merchant_name->Option.getOr("")

<div className="w-fit">
<SelectBox.BaseDropdown
allowMultiSelect=false
Expand All @@ -202,9 +210,7 @@ let make = () => {
addButton=false
customStyle="rounded w-fit"
searchable=false
baseComponent={<ListBaseComp
heading="Merchant" subHeading={currentOMPName(merchantList, merchantId)} arrow
/>}
baseComponent={<ListBaseComp heading="Merchant" subHeading arrow />}
baseComponentCustomStyle="bg-white rounded"
bottomComponent={<AddNewOMPButton user=#Merchant setShowModal customStyle addItemBtnStyle />}
optionClass="text-gray-600 text-fs-14"
Expand Down

0 comments on commit 1cc440b

Please sign in to comment.