mirror of
https://github.com/scm-manager/scm-manager.git
synced 2025-11-13 17:05:43 +01:00
Added user add functionality
This commit is contained in:
27
scm-ui/src/components/Checkbox.js
Normal file
27
scm-ui/src/components/Checkbox.js
Normal file
@@ -0,0 +1,27 @@
|
||||
//@flow
|
||||
import React from "react";
|
||||
|
||||
type Props = {
|
||||
label: string,
|
||||
onChange: boolean => void
|
||||
};
|
||||
class Checkbox extends React.Component<Props> {
|
||||
onCheckboxChange = (event: SyntheticInputEvent<HTMLInputElement>) => {
|
||||
this.props.onChange(event.target.checked);
|
||||
};
|
||||
|
||||
render() {
|
||||
return (
|
||||
<div className="field">
|
||||
<div className="control">
|
||||
<label className="checkbox">
|
||||
<input type="checkbox" onChange={this.onCheckboxChange} />{" "}
|
||||
{this.props.label}
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
export default Checkbox;
|
||||
@@ -22,7 +22,7 @@ class InputField extends React.Component<Props> {
|
||||
renderLabel = () => {
|
||||
const label = this.props.label;
|
||||
if (label) {
|
||||
return <label class="label">{label}</label>;
|
||||
return <label className="label">{label}</label>;
|
||||
}
|
||||
return "";
|
||||
};
|
||||
@@ -31,11 +31,11 @@ class InputField extends React.Component<Props> {
|
||||
const { type, placeholder } = this.props;
|
||||
|
||||
return (
|
||||
<div class="field">
|
||||
<div className="field">
|
||||
{this.renderLabel()}
|
||||
<div class="control">
|
||||
<div className="control">
|
||||
<input
|
||||
class="input"
|
||||
className="input"
|
||||
type={type}
|
||||
placeholder={placeholder}
|
||||
onChange={this.handleInput}
|
||||
|
||||
Reference in New Issue
Block a user