2019-02-10 13:06:05 +00:00
|
|
|
import * as React from "react"
|
2019-02-11 18:22:23 +00:00
|
|
|
import { IComponentProps } from "./BaseComponent"
|
2019-03-21 12:10:32 +00:00
|
|
|
import { Text } from "@blueprintjs/core"
|
|
|
|
|
import { Container } from "./ContainerComponent"
|
2019-02-11 18:22:23 +00:00
|
|
|
class TextComponent extends React.Component<ITextComponentProps> {
|
2019-02-10 13:06:05 +00:00
|
|
|
render() {
|
2019-03-21 12:10:32 +00:00
|
|
|
return (
|
|
|
|
|
<Container {...this.props}>
|
|
|
|
|
<Text ellipsize={this.props.ellipsize} tagName={this.props.tagName}>
|
|
|
|
|
{this.props.text}
|
|
|
|
|
</Text>
|
|
|
|
|
</Container>
|
|
|
|
|
)
|
2019-02-10 13:06:05 +00:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export interface ITextComponentProps extends IComponentProps {
|
2019-02-10 14:14:58 +00:00
|
|
|
text?: string
|
|
|
|
|
ellipsize?: boolean
|
2019-03-21 12:10:32 +00:00
|
|
|
tagName?: keyof JSX.IntrinsicElements
|
2019-02-10 13:06:05 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export default TextComponent
|