Created
November 8, 2019 15:20
-
-
Save sea-witch/b3af113917716ab1461a6732843a8a51 to your computer and use it in GitHub Desktop.
Refund form
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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