mirror of
https://github.com/roleypoly/roleypoly-v1.git
synced 2025-04-26 12:39:12 +00:00
24 lines
472 B
TypeScript
24 lines
472 B
TypeScript
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} />
|
|
}
|
|
}
|