-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
23 changed files
with
465 additions
and
54 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
14 changes: 14 additions & 0 deletions
14
Week-16-React_Router_and_React_Bootstrap/src/components/EmailAdmin.jsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
|
||
export default function EmailAdmin({chore}){ | ||
//portion that sends the email | ||
window.Email.send({ | ||
SecureToken : "8ecfb263-ab0a-4888-99c5-c2ab74f26991", | ||
To : 'patrick.f.corcoran@gmail.com', | ||
From : 'thenderman82@gmail.com', | ||
Subject : "Completed Task", | ||
Body : 'Person: ' + chore.name + ' Task: ' + chore.task | ||
}).then( | ||
message => alert(message) | ||
//message => myModal.show((document.getElementById("message").innerHTML = message)) | ||
); | ||
} |
69 changes: 69 additions & 0 deletions
69
Week-16-React_Router_and_React_Bootstrap/src/components/LoginTableRow.jsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
import { Button } from "react-bootstrap"; | ||
import { useState } from "react"; | ||
import Modal from 'react-bootstrap/Modal'; | ||
import Form from "react-bootstrap/Form"; | ||
|
||
|
||
export default function DisplayTableRow({ log, deleteUser, username, password, | ||
setUsername, setPassword, updatedUser}) { | ||
|
||
|
||
//Modal State | ||
const [show, setShow] = useState(false); | ||
|
||
const handleClose = () => setShow(false); | ||
const handleShow = () => setShow(true); | ||
return ( | ||
|
||
<tr> | ||
<td>{log.name}</td> | ||
<td>{log.password}</td> | ||
|
||
<td> | ||
<Button variant="warning" onClick={handleShow}> | ||
Update | ||
</Button> | ||
<Modal show={show} onHide={handleClose} animation={false}> | ||
<Modal.Header closeButton> | ||
<Modal.Title>Update User</Modal.Title> | ||
</Modal.Header> | ||
<Modal.Body> | ||
<Form> | ||
<Form.Group className="mb-3" controlId="formBasicText"> | ||
<Form.Label>User Name</Form.Label> | ||
<Form.Control | ||
type="text" | ||
placeholder={log.name} | ||
value={username} | ||
onChange={(e) => setUsername(e.target.value)} | ||
/> | ||
</Form.Group> | ||
<Form.Group className="mb-3" controlId="formBasicPassword"> | ||
<Form.Label>Password</Form.Label> | ||
<Form.Control | ||
type="password" | ||
placeholder={log.password} | ||
value={password} | ||
onChange={(e) => setPassword(e.target.value)} | ||
/> | ||
</Form.Group> | ||
|
||
</Form> | ||
</Modal.Body> | ||
<Modal.Footer> | ||
<Button variant="secondary" onClick={handleClose}> | ||
Close | ||
</Button> | ||
<Button variant="warning" onClick={(e) => updatedUser(e, log.id)}> | ||
Save Changes | ||
</Button> | ||
</Modal.Footer> | ||
</Modal> | ||
|
||
</td> | ||
<td> | ||
<Button variant="danger" onClick={(e) => deleteUser(e, log.id)}>Delete</Button> | ||
</td> | ||
</tr> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
26 changes: 26 additions & 0 deletions
26
Week-16-React_Router_and_React_Bootstrap/src/components/UserTableRow.jsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
import { Button } from "react-bootstrap"; | ||
import EmailAdmin from "./EmailAdmin"; | ||
|
||
|
||
|
||
export default function DisplayTableRow({ chore }) { | ||
|
||
|
||
//Modal State | ||
|
||
|
||
return ( | ||
|
||
<tr> | ||
<td>{chore.name}</td> | ||
<td>{chore.date}</td> | ||
<td>{chore.task}</td> | ||
<td> | ||
<Button variant="warning" onClick={() => EmailAdmin(chore={chore})}> | ||
Done | ||
</Button> | ||
|
||
</td> | ||
</tr> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.