Permalink
Browse files

update works with modal

  • Loading branch information...
roberto cortes
roberto cortes committed Feb 13, 2020
1 parent a88f100 commit 9078ff83761e10dfd385593d1b0b39a940c04967
Showing with 49 additions and 30 deletions.
  1. +13 −1 package-lock.json
  2. +36 −29 src/EditDogModal/index.js

Some generated files are not rendered by default. Learn more.

Oops, something went wrong.
@@ -1,5 +1,5 @@
import React, { Component } from 'react'
import { Form, Button, Label, Header } from 'semantic-ui-react'
import { Form, Button, Label, Header, Modal } from 'semantic-ui-react'


class EditDogModal extends Component {
@@ -35,34 +35,41 @@ class EditDogModal extends Component {
// console.log("props in EditDogModal");
// console.log(this.props);
return (
<Form onSubmit={this.handleSubmit}>
<Label>Name:</Label>
<Form.Input
type="text"
name="name"
value={this.state.name}
placeholder="Enter Dog Name"
onChange={this.handleChange}
/>
<Label>Breed:</Label>
<Form.Input
type="text"
name="breed"
value={this.state.breed}
placeholder="Enter Dog Breed"
onChange={this.handleChange}
/>
<Label>Owner Name:</Label>
<Form.Input
type="text"
name="owner"
value={this.state.owner}
placeholder="Enter Owner's name"
onChange={this.handleChange}
/>
<Button color={"green"} type="Submit">Update Dog</Button>
<p onClick={this.props.closeModal}>(Cancel)</p>
</Form>

<Modal open closeIcon onClose={this.props.closeModal}>
<Header>Edit Dog</Header>
<Modal.Content>
<Form onSubmit={this.handleSubmit}>
<Label>Name:</Label>
<Form.Input
type="text"
name="name"
value={this.state.name}
placeholder="Enter Dog Name"
onChange={this.handleChange}
/>
<Label>Breed:</Label>
<Form.Input
type="text"
name="breed"
value={this.state.breed}
placeholder="Enter Dog Breed"
onChange={this.handleChange}
/>
<Label>Owner Name:</Label>
<Form.Input
type="text"
name="owner"
value={this.state.owner}
placeholder="Enter Owner's name"
onChange={this.handleChange}
/>
<Modal.Actions>
<Button color={"green"} type="Submit">Update Dog</Button>
</Modal.Actions>
</Form>
</Modal.Content>
</Modal>
)
}
}

0 comments on commit 9078ff8

Please sign in to comment.