Last active
February 27, 2020 17:24
-
-
Save NateRadebaugh/9ae05d88161060154018f4fecba8c83e to your computer and use it in GitHub Desktop.
My Awesome Sketch
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
My Awesome Sketch | |
Inactive | |
focus -> Active | |
click -> Active | |
Active | |
cancel -> Inactive | |
blur -> Inactive | |
DateView | |
select -> Inactive | |
toMonth -> MonthView | |
toTime -> TimeView | |
TimeView | |
toDate -> DateView | |
MonthView | |
select -> DateView | |
toDate -> DateView | |
toYear -> YearView | |
YearView | |
select -> MonthView | |
toMonth -> MonthView |
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
function render(model){ | |
const current_state_name = model.active_states[0].name; | |
const views = { | |
Inactive: <input onClick={() => model.emit("click") } />, | |
DateView: <div><input /><br />dates <button type="button" onClick={() => model.emit("toTime") }>Time</button> <button type="button" onClick=>Months</button></div>, | |
TimeView: <div><input /><br />times</div>, | |
MonthView: <div><input /><br />months</div>, | |
YearView: <div><input /><br />years</div> | |
}; | |
return <div> | |
({current_state_name}) | |
<div> | |
{views[current_state_name] || null} | |
</div> | |
</div> | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment