Skip to content

Commit

Permalink
BAH-3459 | Refactor. to display create default option for ABHA Number…
Browse files Browse the repository at this point in the history
… which doesn't linked to any ABHA Address
  • Loading branch information
SanoferSameera committed Jan 12, 2024
1 parent 7b0b539 commit 91817dd
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 8 deletions.
15 changes: 9 additions & 6 deletions src/components/creation/CreateABHAAddress.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -96,12 +96,15 @@ const CreateABHAAddress = (props) => {
<div className="center">
<button type="button" className="proceed" onClick={onCreate}>Create</button>
</div>
<div className="alternative-text">
OR
</div>
<div className="create-default-healthId">
<button name="default-healthId-btn" type="button" onClick={createDefault}>Create Default ABHA Address</button>
</div>
{props?.showCreateDefaultOption !== undefined && props?.showCreateDefaultOption &&
<div>
<div className="alternative-text">
OR
</div>
<div className="create-default-healthId">
<button name="default-healthId-btn" type="button" onClick={createDefault}>Create Default ABHA Address</button>
</div>
</div>}
{loader && <Spinner />}
{error !== '' && <h6 className="error">{error}</h6>}
<Footer setBack={props.setBack} />
Expand Down
8 changes: 6 additions & 2 deletions src/components/creation/LinkABHAAddress.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -99,10 +99,13 @@ const LinkABHAAddress = (props) => {
<div>
{patient.phrAddress === undefined &&
<div className="no-abha-address">
<p className="note">No ABHA address found linked to the ABHA number</p>
<p className="note">You don't have ABHA Address/ Health Id linked to your ABHA Number</p>
<p className="note">
{isLinkingEnabled && <> Please proceed with linking the ABHA address that is already mapped to the mobile number or email, or </>}
create a new ABHA address</p>
{!isLinkingEnabled &&
<CreateABHAAddress setBack={setBack} newAbhaAddress={newAbhaAddress} setNewAbhaAddress={setNewAbhaAddress} setABHAAddressCreated={setABHAAddressCreated} showCreateDefaultOption={true}/>
}
</div>}
{patient.phrAddress !== undefined &&
<div>
Expand All @@ -116,14 +119,15 @@ const LinkABHAAddress = (props) => {
{abhaAddress !== '' && <div className="center">
<button type="button" disabled={healthNumberAlreadyLinked || healthIdIsVoided || !isAbhaSelected? true : false} className="proceed" onClick={onProceed}>Proceed</button>
</div>}
</div>}

{isLinkingEnabled && <div className="left-button">
<button type="button" disabled={isAbhaSelected ? true : false} className="proceed" title="Link exisiting ABHA Address linked to Mobile/Email" onClick={gotoLink}>Link ABHA Address</button>
</div>}

<div className={isLinkingEnabled ? "right-button" :"create-new-abhaAddress"}>
<button type="button" disabled={isAbhaSelected ? true : false} className="proceed" title="Create new ABHA Address" onClick={gotoCreate}>Create ABHA Address</button>
</div>
</div>}
</div>}
{!proceed && createNewABHA &&
<CreateABHAAddress setBack={setBack} newAbhaAddress={newAbhaAddress} setNewAbhaAddress={setNewAbhaAddress} setABHAAddressCreated={setABHAAddressCreated} />
Expand Down

0 comments on commit 91817dd

Please sign in to comment.