2019-03-18 13:50:24 +00:00
|
|
|
import * as React from "react"
|
|
|
|
|
import BaseWidget, { IWidgetProps, IWidgetState } from "./BaseWidget"
|
2019-08-29 11:22:09 +00:00
|
|
|
import { WidgetType } from "../constants/WidgetConstants"
|
2019-03-18 13:50:24 +00:00
|
|
|
import ButtonComponent from "../editorComponents/ButtonComponent"
|
|
|
|
|
|
2019-08-29 11:22:09 +00:00
|
|
|
class ButtonWidget extends BaseWidget<ButtonWidgetProps, IWidgetState> {
|
2019-03-18 13:50:24 +00:00
|
|
|
|
2019-03-18 15:10:30 +00:00
|
|
|
getPageView() {
|
2019-03-18 13:50:24 +00:00
|
|
|
return (
|
|
|
|
|
<ButtonComponent
|
2019-03-19 14:05:48 +00:00
|
|
|
style={this.getPositionStyle()}
|
2019-03-18 13:50:24 +00:00
|
|
|
widgetId={this.props.widgetId}
|
|
|
|
|
key={this.props.widgetId}
|
2019-08-26 12:41:21 +00:00
|
|
|
text={this.props.text || "Button"}
|
2019-03-18 13:50:24 +00:00
|
|
|
/>
|
|
|
|
|
)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
getWidgetType(): WidgetType {
|
|
|
|
|
return "BUTTON_WIDGET"
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2019-08-29 11:22:09 +00:00
|
|
|
export interface ButtonWidgetProps extends IWidgetProps {
|
|
|
|
|
text?: string;
|
|
|
|
|
ellipsize?: boolean;
|
2019-03-18 13:50:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export default ButtonWidget
|