Skip to content

Instantly share code, notes, and snippets.

@ngbinh
Created September 13, 2018 12:15
Show Gist options
  • Save ngbinh/649bec1f317ec05ee28922c9f959a101 to your computer and use it in GitHub Desktop.
Save ngbinh/649bec1f317ec05ee28922c9f959a101 to your computer and use it in GitHub Desktop.
Negotating
Negotating
Empty
investorSign -> OnlyInvestorSigned
companySign -> OnlyCompanySigned
OnlyCompanySigned
companyUnSign -> Empty
investorSign -> Done
OnlyInvestorSigned
companySign -> Done
investorUnSign -> Empty
Done
companyUnSign -> OnlyInvestorSigned
investorUnSign -> OnlyCompanySigned
function turnText(state) {
switch (state) {
case "CompanyToShareBankInfo":
return "Company To Share Bank Info";
break;
case "CompanyToShareWireInfo":
return "Company To Share Wire Info";
break;
case "CompanyToMarkStockCertSent":
return "Company To Mark Stock Certificates Sent";
break;
case "CompanyToMarkFundReceived":
return "Company To Mark Fund Received";
break;
default:
return "";
break;
}
}
function render(model) {
let current_state_names = [];
let turnsText = [];
for (var i = 0; i < model.active_states.length; i++) {
current_state_names.push(model.active_states[i].name);
var text = turnText(model.active_states[i].name);
if (text != "") turnsText.push(text);
}
console.log(turnsText);
return <div>
<p>The current state is: {current_state_names.toString()}</p>
<p>The current turns: </p>
<ul>{turnsText.map(txt => <li>{txt}</li>)}</ul>
</div>
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment