Skip to content

Instantly share code, notes, and snippets.

@sea-witch
Created November 8, 2019 15:20
Show Gist options
  • Save sea-witch/b3af113917716ab1461a6732843a8a51 to your computer and use it in GitHub Desktop.
Save sea-witch/b3af113917716ab1461a6732843a8a51 to your computer and use it in GitHub Desktop.
Refund form
Refund form
Selecting refund method
select cash -> No reminder
select credit -> Credit card
select donation -> Donation
Cash
select reminder -> Reminder
Reminder
No reminder
Credit card
Donation
const logState = (state) => $('p', {}, `The current state is: ${state}`)
const donationForm = () => (
$('div',
$('h1', {}, 'Donation form'),
$('label', 'Donation name'),
$('input', {value: 'Hulk Hogan - Donation',
style: {border: '1px solid grey', borderRadius: '8px', padding: '8px', marginRight: '12px', marginLeft: '12px'}}),
//$('p', {}, 'Amount: $17.00'),
)
)
function render(model){
let current_state_name = model.active_states[0].name;
if (current_state_name === 'Donation') {
return donationForm();
}
return $("div",
{style: {color: "darkBlue"}},
logState(current_state_name));
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment