mirror of
https://github.com/Grasscutters/Cultivation.git
synced 2025-12-16 09:04:45 +01:00
button component
This commit is contained in:
37
src/ui/components/common/BigButton.tsx
Normal file
37
src/ui/components/common/BigButton.tsx
Normal file
@@ -0,0 +1,37 @@
|
||||
import React from 'react'
|
||||
import './BigButton.css'
|
||||
|
||||
interface IProps {
|
||||
text: string;
|
||||
onClick: () => any;
|
||||
id: string;
|
||||
}
|
||||
|
||||
interface IState {
|
||||
text: string;
|
||||
}
|
||||
|
||||
export default class BigButton extends React.Component<IProps, IState> {
|
||||
|
||||
constructor(props: { text: string, onClick: () => any, id: string }) {
|
||||
super(props)
|
||||
|
||||
this.state = {
|
||||
text: props.text
|
||||
}
|
||||
|
||||
this.handleClick = this.handleClick.bind(this)
|
||||
}
|
||||
|
||||
handleClick() {
|
||||
this.props.onClick()
|
||||
}
|
||||
|
||||
render() {
|
||||
return (
|
||||
<div className="BigButton" onClick={this.handleClick} id={this.props.id}>
|
||||
<div className="BigButtonText">{this.state.text}</div>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user