diff --git a/src/screens/HyperSwitch/Settings/BusinessMapping/BusinessMappingUtils.res b/src/screens/HyperSwitch/Settings/BusinessMapping/BusinessMappingUtils.res index 6a21fd6cd..6d2cdafd2 100644 --- a/src/screens/HyperSwitch/Settings/BusinessMapping/BusinessMappingUtils.res +++ b/src/screens/HyperSwitch/Settings/BusinessMapping/BusinessMappingUtils.res @@ -17,7 +17,7 @@ let labelField = FormRenderer.makeFieldInfo( (), ) -type modalState = Loading | Edit +type modalState = Loading | Edit | Successful let validateEmptyValue = (key, errors) => { switch key { diff --git a/src/screens/HyperSwitch/Settings/BusinessMapping/BusinessProfile.res b/src/screens/HyperSwitch/Settings/BusinessMapping/BusinessProfile.res index 4cea24ef1..ad54c171b 100644 --- a/src/screens/HyperSwitch/Settings/BusinessMapping/BusinessProfile.res +++ b/src/screens/HyperSwitch/Settings/BusinessMapping/BusinessProfile.res @@ -1,9 +1,30 @@ +module WarningArea = { + @react.component + let make = (~warningText) => { +

+ {"NOTE:"->React.string} + {warningText->React.string} +

+ } +} module AddEntryBtn = { @react.component - let make = (~onSubmit, ~modalState, ~showModal, ~setShowModal, ~list, ~isFromSettings=true) => { + let make = ( + ~onSubmit, + ~modalState, + ~showModal, + ~setShowModal, + ~list, + ~isFromSettings=true, + ~updatedProfileId, + ~setModalState, + ) => { open HSwitchUtils open BusinessMappingUtils - let initialValues = [("profile_name", "Default"->Js.Json.string)]->Js.Dict.fromArray + let initialValues = + [ + ("profile_name", `default${list->Js.Array2.length->string_of_int}`->Js.Json.string), + ]->Js.Dict.fromArray let modalBody =
{switch modalState { @@ -37,9 +58,34 @@ module AddEntryBtn = {
+ | Successful => +
+ +

+ {"Business Profile successfully created! Set up your payments settings like webhooks, return url for your new profile before trying a payment."->React.string} +

+
}} + let modalHeaderText = switch modalState { + | Edit | Loading => "Add Business Profile Name" + | Successful => "Configure payment settings" + } +