-
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
26 changed files
with
426 additions
and
292 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
36 changes: 21 additions & 15 deletions
36
Week-16-React_Router_and_React_Bootstrap/src/components/AdminNavbar.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 |
---|---|---|
@@ -1,42 +1,48 @@ | ||
//Imports | ||
import React from "react"; | ||
import { Navbar, Nav } from "react-bootstrap"; | ||
import { Link } from "react-router-dom"; | ||
import { useUserContext } from "./UserContext"; | ||
import Button from 'react-bootstrap/Button'; | ||
import { useNavigate } from 'react-router-dom'; | ||
import ButtonGroup from 'react-bootstrap/ButtonGroup'; | ||
import Button from "react-bootstrap/Button"; | ||
import { useNavigate } from "react-router-dom"; | ||
import ButtonGroup from "react-bootstrap/ButtonGroup"; | ||
|
||
//Admin Nav Bar | ||
const AdminNavbar = () => { | ||
const { user, logout } = useUserContext(); | ||
//Setup Context | ||
const { user, logout } = useUserContext(); | ||
|
||
const navigate = useNavigate(); | ||
//Setup Navigate | ||
const navigate = useNavigate(); | ||
|
||
const handleLogout = () => { | ||
logout(); | ||
navigate('/'); | ||
}; | ||
//Log Out Button Function | ||
const handleLogout = () => { | ||
logout(); | ||
navigate("/"); | ||
}; | ||
|
||
//Html Output | ||
return ( | ||
<Navbar id="nav" className="p-3" data-bs-theme="dark" expand="lg"> | ||
<Navbar.Brand> | ||
House Chores | ||
</Navbar.Brand> | ||
<Navbar.Brand>House Chores</Navbar.Brand> | ||
<Navbar.Toggle aria-controls="navbar-nav" /> | ||
<Navbar.Collapse id="navbar-nav"> | ||
<Nav className="ms-auto"> | ||
|
||
<Nav.Link as={Link} to="/Admin"> | ||
Task Management | ||
</Nav.Link> | ||
<Nav.Link as={Link} to="/Users"> | ||
User Management | ||
</Nav.Link> | ||
<ButtonGroup size="sm"> | ||
<Button variant="success" onClick={handleLogout}>Logout</Button> | ||
<Button variant="success" onClick={handleLogout}> | ||
Logout | ||
</Button> | ||
</ButtonGroup> | ||
</Nav> | ||
</Navbar.Collapse> | ||
</Navbar> | ||
); | ||
}; | ||
|
||
export default AdminNavbar; | ||
export default AdminNavbar; |
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
54 changes: 32 additions & 22 deletions
54
Week-16-React_Router_and_React_Bootstrap/src/components/DisplayTableRow.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
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
2 changes: 1 addition & 1 deletion
2
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
3 changes: 3 additions & 0 deletions
3
Week-16-React_Router_and_React_Bootstrap/src/components/Footer.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 |
---|---|---|
@@ -1,4 +1,7 @@ | ||
//Footer Function | ||
export default function Footer(){ | ||
|
||
//Html Output | ||
return( | ||
<footer> | ||
© Patrick Corcoran 2023 | ||
|
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.