mirror of
https://github.com/roleypoly/roleypoly-v1.git
synced 2025-06-16 18:29:08 +00:00
absolutely massive typescript porting time
This commit is contained in:
parent
01f238f515
commit
30d08a630f
159 changed files with 2563 additions and 3861 deletions
24
packages/roleypoly-ui/components/role/demo.tsx
Normal file
24
packages/roleypoly-ui/components/role/demo.tsx
Normal file
|
@ -0,0 +1,24 @@
|
|||
import * as React from 'react'
|
||||
import Role, { RoleData } from './index'
|
||||
|
||||
export type DemoRoleProps = {
|
||||
role: RoleData
|
||||
}
|
||||
|
||||
type DemoRoleState = {
|
||||
active: boolean
|
||||
}
|
||||
|
||||
export default class RoleDemo extends React.Component<DemoRoleProps, DemoRoleState> {
|
||||
state = {
|
||||
active: false
|
||||
}
|
||||
|
||||
onToggle = (n: boolean) => {
|
||||
this.setState({ active: n })
|
||||
}
|
||||
|
||||
render () {
|
||||
return <Role role={this.props.role} onToggle={this.onToggle} active={this.state.active} />
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue