Show gang switch

This commit is contained in:
Bilal
2020-10-07 22:45:34 +03:00
parent e0c5f60c68
commit 8d7716f2e0
5 changed files with 63 additions and 21 deletions

View File

@@ -10,6 +10,8 @@ const NewHomieForm = (props) => {
const [homieImportance, setHomieImportance] = useState("");
const [busy, setBusy] = useState(false);
const gang = props.gang;
const disableAddButton = () => {
return homieName.length === 0 ||
homieImportance === "" ||
@@ -33,7 +35,8 @@ const NewHomieForm = (props) => {
homie: {
name: homieName,
about: aboutHomie,
importance: parseInt(homieImportance)
importance: parseInt(homieImportance),
gang_id: gang.id
}
}
@@ -57,7 +60,7 @@ const NewHomieForm = (props) => {
return (
<div>
<Collapsible id="new-homie-form-container">
<CollapsibleItem header={<strong>Introduce new homie to the Hood</strong>}>
<CollapsibleItem header={<strong>{`Introduce new homie to the ${gang.name} gang`}</strong>}>
<div className="input-field col s12">
<input id="homie-name" type="text" className="validate" required="required" value={homieName} onChange={(e) => setHomieName(e.target.value)} />
<label className="required" htmlFor="homie-name">Homie name</label>