diff --git a/src/components/Organizations/Notifications/index.js b/src/components/Organizations/Notifications/index.js index cfa06c0b..e3e19dd3 100644 --- a/src/components/Organizations/Notifications/index.js +++ b/src/components/Organizations/Notifications/index.js @@ -100,6 +100,7 @@ const OrgNotifications = ({ open: false, type: '', current: {}, + updated: {}, }; const [editState, setEditState] = useState(initialEditState); @@ -130,8 +131,8 @@ const OrgNotifications = ({ const newValue = e.target.value; setEditState(prevState => ({ ...prevState, - current: { - ...prevState.current, + updated: { + ...prevState.updated, [property]: newValue, }, })); @@ -185,94 +186,95 @@ const OrgNotifications = ({ - - - - - Name: * - handleInputChange(e, 'name')} - /> - - - - - - Webhook: * - handleInputChange(e, 'webhook')} - /> - - - - - - Channel: * - handleInputChange(e, 'channel')} - /> - - - - + + )} console.error(e)}> {(removeNotification, { called, error, data }) => { if (data) { @@ -316,93 +318,95 @@ const OrgNotifications = ({ - - - - - Name: * - handleInputChange(e, 'name')} - /> - - - - - - Webhook: * - handleInputChange(e, 'webhook')} - /> - - - - - - Channel: * - handleInputChange(e, 'channel')} - /> - - - - + + )} console.error(e)}> {(removeNotification, { called, error, data }) => { if (error) { @@ -449,82 +453,84 @@ const OrgNotifications = ({ - - - - - Name: * - handleInputChange(e, 'name')} - /> - - - - - - Email Address: * - handleInputChange(e, 'emailAddress')} - /> - - {!isValidEmail && Invalid email address} - - - - + {editState.current && editState.current.name === notification.name && ( + + + + + Name: * + handleInputChange(e, 'name')} + /> + + + + + + Email Address: * + handleInputChange(e, 'emailAddress')} + /> + + {!isValidEmail && Invalid email address} + + + + + )} console.error(e)}> {(removeNotification, { called, error, data }) => { if (data) { @@ -574,80 +580,81 @@ const OrgNotifications = ({ - - - - - Name: * - handleInputChange(e, 'name')} - /> - - - - - - Webhook: * - handleInputChange(e, 'webhook')} - /> - - - - + + )} console.error(e)}> {(removeNotification, { called, error, data }) => { if (data) { @@ -693,79 +700,82 @@ const OrgNotifications = ({ - - - - - Name: * - handleInputChange(e, 'name')} - /> - - - - - - Webhook: * - handleInputChange(e, 'webhook')} - /> - - - - + + )} console.error(e)}> {(removeNotification, { called, error, data }) => { if (data) {
Invalid email address