PromucFlow_constructor/app/client/src/editorComponents/CalloutComponent.tsx

41 lines
1.1 KiB
TypeScript
Raw Normal View History

2019-03-13 15:55:53 +00:00
import * as React from "react";
import { IComponentProps } from "./BaseComponent";
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}>
<Callout
{...this.props}
title={this.props.title ? this.props.title : undefined}
>
2019-03-13 15:55:53 +00:00
{this.props.description}
</Callout>
2019-03-13 15:55:53 +00:00
</CalloutContainer>
);
}
}
export interface ICalloutComponentProps extends IComponentProps {
id?: string;
title?: string;
2019-03-13 15:55:53 +00:00
description?: string;
intent?: Intent;
2019-03-13 15:55:53 +00:00
ellipsize?: boolean;
}
export default CalloutComponent;