Created
April 5, 2016 18:32
-
-
Save delianides/49d392a4d916d28da3bf58b95b2cc2a8 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/// <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