mirror of
https://github.com/rjNemo/MERN_sample_app
synced 2026-06-09 18:16:41 +00:00
adds signout button components and insert it into MainNavBar
This commit is contained in:
parent
b94240e5b6
commit
90bd428d3f
4 changed files with 22 additions and 12 deletions
|
|
@ -39,7 +39,5 @@
|
|||
]
|
||||
},
|
||||
"proxy": "http://localhost:5000",
|
||||
"devDependencies": {
|
||||
"uuid": "^7.0.3"
|
||||
}
|
||||
}
|
||||
"devDependencies": {}
|
||||
}
|
||||
|
|
@ -2,14 +2,15 @@ import React, { useState } from "react";
|
|||
import { Link } from "react-router-dom";
|
||||
import {
|
||||
Collapse,
|
||||
Navbar,
|
||||
NavbarToggler,
|
||||
NavbarBrand,
|
||||
Container,
|
||||
Nav,
|
||||
Navbar,
|
||||
NavbarBrand,
|
||||
NavbarToggler,
|
||||
NavItem,
|
||||
NavLink,
|
||||
Container,
|
||||
} from "reactstrap";
|
||||
import SignOutButton from "../SignOutButton";
|
||||
import * as ROUTES from "../../constants/routes";
|
||||
|
||||
export default function MainNavbar() {
|
||||
|
|
@ -54,6 +55,11 @@ export default function MainNavbar() {
|
|||
GitHub
|
||||
</NavLink>
|
||||
</NavItem>
|
||||
<NavItem>
|
||||
<NavLink>
|
||||
<SignOutButton />
|
||||
</NavLink>
|
||||
</NavItem>
|
||||
</Nav>
|
||||
</Collapse>
|
||||
</Container>
|
||||
|
|
|
|||
9
client/src/components/SignOutButton/index.jsx
Normal file
9
client/src/components/SignOutButton/index.jsx
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
import React from "react";
|
||||
import { Button } from "reactstrap";
|
||||
import { useFirebase } from "../../services/auth";
|
||||
|
||||
const SignOutButton = () => {
|
||||
const auth = useFirebase();
|
||||
return <Button onClick={auth.signOut}>Sign Out</Button>;
|
||||
};
|
||||
export default SignOutButton;
|
||||
|
|
@ -18,15 +18,12 @@
|
|||
"author": "",
|
||||
"license": "ISC",
|
||||
"dependencies": {
|
||||
"@babel/core": "^7.9.0",
|
||||
"@babel/preset-env": "^7.9.5",
|
||||
"concurrently": "^5.1.0",
|
||||
"express": "^4.17.1",
|
||||
"firebase-admin": "^8.11.0",
|
||||
"helmet": "^3.22.0",
|
||||
"moment": "^2.24.0",
|
||||
"mongoose": "^5.9.10",
|
||||
"reactstrap": "^8.4.1"
|
||||
"mongoose": "^5.9.10"
|
||||
},
|
||||
"devDependencies": {
|
||||
"nodemon": "^2.0.3"
|
||||
|
|
|
|||
Loading…
Reference in a new issue