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
+24
View File
@@ -0,0 +1,24 @@
/**
* Basic stateless button
* Uses the 'std-button' css class
*/
import * as React from "react";
export interface IStdButtonProps {
disabled?: boolean;
onClick?: (e: React.MouseEvent<HTMLElement>) => any;
style?: object;
text: string;
}
export class StdButton extends React.Component<IStdButtonProps, any> {
render() {
const className = this.props.disabled ? "std-button-disabled" : "std-button";
return (
<button className={className} onClick={this.props.onClick} style={this.props.style}>
{this.props.text};
</button>
)
}
}