2019-03-13 15:55:53 +00:00
|
|
|
import * as React from "react";
|
|
|
|
|
import { IComponentProps } from "./BaseComponent";
|
2019-03-15 12:35:36 +00:00
|
|
|
import { Callout, Code, H5, Intent, Switch } from "@blueprintjs/core";
|
2019-03-13 15:55:53 +00:00
|
|
|
import styled from "../constants/DefaultTheme";
|
|
|
|
|
|
|
|
|
|
const CalloutContainer = styled("span")<ICalloutComponentProps>`
|
|
|
|
|
color: ${props => props.theme.primaryColor};
|
|
|
|
|
position: ${props => props.style.positionType};
|
|
|
|
|
left: ${props => {
|
|
|
|
|
return props.style.xPosition + props.style.xPositionUnit;
|
|
|
|
|
}};
|
|
|
|
|
top: ${props => {
|
|
|
|
|
return props.style.yPosition + props.style.yPositionUnit;
|
|
|
|
|
}};
|
|
|
|
|
`;
|
|
|
|
|
|
|
|
|
|
class CalloutComponent extends React.Component<ICalloutComponentProps> {
|
|
|
|
|
render() {
|
|
|
|
|
return (
|
|
|
|
|
<CalloutContainer {...this.props}>
|
2019-03-15 12:35:36 +00:00
|
|
|
<Callout
|
|
|
|
|
{...this.props}
|
|
|
|
|
title={this.props.title ? this.props.title : undefined}
|
|
|
|
|
>
|
2019-03-13 15:55:53 +00:00
|
|
|
{this.props.description}
|
2019-03-15 12:35:36 +00:00
|
|
|
</Callout>
|
2019-03-13 15:55:53 +00:00
|
|
|
</CalloutContainer>
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export interface ICalloutComponentProps extends IComponentProps {
|
|
|
|
|
id?: string;
|
2019-03-15 12:35:36 +00:00
|
|
|
title?: string;
|
2019-03-13 15:55:53 +00:00
|
|
|
description?: string;
|
2019-03-15 12:35:36 +00:00
|
|
|
intent?: Intent;
|
2019-03-13 15:55:53 +00:00
|
|
|
ellipsize?: boolean;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export default CalloutComponent;
|