Skip to content

Instantly share code, notes, and snippets.

@sebmck
Forked from alihammad-gist/navbar.ts
Created June 12, 2015 20:03
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 sebmck/62e6973a897acae98acd to your computer and use it in GitHub Desktop.
Save sebmck/62e6973a897acae98acd to your computer and use it in GitHub Desktop.
interface LoginNavState {
showLoginOptions: boolean
}
class LoginNav extends React.Component<{}, LoginNavState> {
constructor() {
super()
this.state = {
showLoginOptions: false
}
}
toggleLoginOptionsState() {
console.log(this.state)
this.setState({
showLoginOptions: !this.state.showLoginOptions
})
}
render() {
return (
DOM.li(
{ className: 'login-nav' },
DOM.a(
{onClick: this.toggleLoginOptionsState.bind(this)},
"Login"
),
Auth({show: this.state.showLoginOptions.bind(this)})
)
)
}
static factory: React.Factory<{}> = function () {
return React.createElement(LoginNav)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment