Skip to content

Instantly share code, notes, and snippets.

@delianides
Created April 5, 2016 18:32
Show Gist options
  • Save delianides/49d392a4d916d28da3bf58b95b2cc2a8 to your computer and use it in GitHub Desktop.
Save delianides/49d392a4d916d28da3bf58b95b2cc2a8 to your computer and use it in GitHub Desktop.
/// <reference path="../../../../../typings/main/ambient/react/index.d.ts" />
function style(disabled: boolean): Object {
if (disabled) {
return {
cursor: "inherit"
}
}
return {}
}
export interface LabelProps {
labelFor?: string,
labelName?: string,
disabled?: boolean
}
const Label = ({ labelFor, labelName, disabled }: LabelProps) => (
<label htmlFor={labelFor} style={style(disabled)}>
{labelName}
</label>
)
export default Label;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment