Before render, make async call to hasLoanOffer(ethAddr)
If this returns an array, populate page with result, expecting:
result [2] to be Lender Name,
result [1] to be Duration in days,
result [3] to be Amount
Render form with
inputs:
Lender Name (hidden until populated, never editable)
Amount
Duration ___ days
Your Story
acceptTx (does not display)
rejectTx (does not display)
buttons :
Check Loan Offers (visible until populated; posts to loan decision endpoint /offers #5 - liase with @parissai; Submitting this button awaits response from that endpoint and calls populate() with the result)
Take This Loan (hidden until populated; calls dummy function acceptLoan(acceptTx) )
Reject (hidden until populated; calls dummy function rejectLoan(acceptTx) ; this button can be smaller if it helps design)
Take this Loan and Reject buttons occupy the space on screen which was previously taken by Check Loan Offers.
page requires a populate() function which:
accepts an object with values for the inputs
populates the form inputs accordingly
makes LenderName field visible
removes or hides Check Loan Offers
and displays Take This Loan and Reject in its place.
Text as in flow diagram.
Before render, make async call to hasLoanOffer(ethAddr) If this returns an array, populate page with result, expecting: result [2] to be Lender Name, result [1] to be Duration in days, result [3] to be Amount
Render form with inputs:
buttons :
Take this Loan and Reject buttons occupy the space on screen which was previously taken by Check Loan Offers.
page requires a populate() function which: