Finished location code refactor. Has not yet been tested

This commit is contained in:
danielyxie
2019-04-01 02:23:25 -07:00
parent 3f8b9e4a32
commit 4b95ba9ed1
46 changed files with 2100 additions and 3083 deletions
+13 -2
View File
@@ -4,20 +4,31 @@
*/
import * as React from "react";
export interface IStdButtonProps {
interface IStdButtonProps {
disabled?: boolean;
onClick?: (e: React.MouseEvent<HTMLElement>) => any;
style?: object;
text: string;
tooltip?: string;
}
export class StdButton extends React.Component<IStdButtonProps, any> {
render() {
const className = this.props.disabled ? "std-button-disabled" : "std-button";
const hasTooltip = this.props.tooltip !== "";
let className = this.props.disabled ? "std-button-disabled" : "std-button";
if (hasTooltip) {
className += " tooltip";
}
return (
<button className={className} onClick={this.props.onClick} style={this.props.style}>
{this.props.text}
{
hasTooltip &&
<span className={"tooltiptext"}>
{this.props.tooltip}
</span>
}
</button>
)
}