Skip to content

Instantly share code, notes, and snippets.

@fabiodan
Last active November 5, 2018 18:54
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save fabiodan/2d4c0e1eae44d9d70a495f565f508051 to your computer and use it in GitHub Desktop.
Save fabiodan/2d4c0e1eae44d9d70a495f565f508051 to your computer and use it in GitHub Desktop.
App
App
Click Logo -> menuIndex null
Menu
clickMenuIndex 0 -> menuIndex 0
clickMenuIndex 1 -> menuIndex 1
clickMenuIndex 2 -> menuIndex 2
Inactive Menu
menuIndex null*
Active Menu&
Menu Options
menuIndex 0
menuIndex 1
menuIndex 2
Sections
Active Sections
onEscape -> levelIndex null
levelIndex 0
clickLevel 0 -> levelIndex 1
levelIndex 1
clickLevel 0 -> levelIndex 1
clickLevel 1 -> levelIndex 2
levelIndex 2
clickLevel 0 -> levelIndex 1
clickLevel 1 -> levelIndex 2
clickLevel 2 -> levelIndex 3
levelIndex 3
clickLevel 0 -> levelIndex 1
clickLevel 1 -> levelIndex 2
clickLevel 2 -> levelIndex 3
clickLevel 3 -> levelIndex null
Inactive Sections
levelIndex null
function menu() {
const liStyle = {
fontFamily: '"Roboto", sans-serif',
height: '44px',
background: 'blue',
color: 'white',
display: 'inline-flex',
alignItems: 'center',
padding: '0 16px',
cursor: 'pointer',
}
return (
<ul>
<li style={ liStyle }>Groceries</li>
<li style={ liStyle }>Favourites</li>
<li style={ liStyle }>Account</li>
</ul>
)
}
function render(model){
const states = model.active_states.map((state) => state.name)
return menu()
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment