Added several resuable React components for commonly-used elements

This commit is contained in:
danielyxie
2019-03-25 21:38:57 -07:00
committed by danielyxie
parent ea7f0752cb
commit 3cf18f100a
4 changed files with 115 additions and 1 deletions
+23
View File
@@ -0,0 +1,23 @@
/**
* Text (p Element) with Tooltip
*/
import * as React from "react";
export interface IParagraphWithTooltipProps {
style?: object;
text: string;
tooltip: string;
}
export class ParagraphWithTooltip extends React.Component<IParagraphWithTooltipProps, any> {
render() {
return (
<p className={"tooltip"}>
{this.props.text}
<span className={"tooltiptext"}>
{this.props.tooltip}
</span>
</p>
)
}
}