fix bouncing help icons on mobiles devices

This commit is contained in:
Sebastian Sdorra
2018-11-13 07:39:19 +01:00
parent 24de639c1e
commit e7c9560073
11 changed files with 102 additions and 76 deletions

View File

@@ -0,0 +1,37 @@
//@flow
import React from "react";
import Help from '../Help';
type Props = {
label?: string,
helpText?: string
};
class LabelWithHelpIcon extends React.Component<Props> {
renderHelp() {
const { helpText } = this.props;
if (helpText) {
return (
<Help message={helpText} />
);
}
}
render() {
const {label } = this.props;
if (label) {
const help = this.renderHelp();
return (
<label className="label">
{label} { help }
</label>
);
}
return "";
}
}
export default LabelWithHelpIcon;