adds signout button components and insert it into MainNavBar

This commit is contained in:
Ruidy Nemausat 2020-04-24 08:55:40 +02:00
parent b94240e5b6
commit 90bd428d3f
4 changed files with 22 additions and 12 deletions

View file

@ -39,7 +39,5 @@
] ]
}, },
"proxy": "http://localhost:5000", "proxy": "http://localhost:5000",
"devDependencies": { "devDependencies": {}
"uuid": "^7.0.3" }
}
}

View file

@ -2,14 +2,15 @@ import React, { useState } from "react";
import { Link } from "react-router-dom"; import { Link } from "react-router-dom";
import { import {
Collapse, Collapse,
Navbar, Container,
NavbarToggler,
NavbarBrand,
Nav, Nav,
Navbar,
NavbarBrand,
NavbarToggler,
NavItem, NavItem,
NavLink, NavLink,
Container,
} from "reactstrap"; } from "reactstrap";
import SignOutButton from "../SignOutButton";
import * as ROUTES from "../../constants/routes"; import * as ROUTES from "../../constants/routes";
export default function MainNavbar() { export default function MainNavbar() {
@ -54,6 +55,11 @@ export default function MainNavbar() {
GitHub GitHub
</NavLink> </NavLink>
</NavItem> </NavItem>
<NavItem>
<NavLink>
<SignOutButton />
</NavLink>
</NavItem>
</Nav> </Nav>
</Collapse> </Collapse>
</Container> </Container>

View 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;

View file

@ -18,15 +18,12 @@
"author": "", "author": "",
"license": "ISC", "license": "ISC",
"dependencies": { "dependencies": {
"@babel/core": "^7.9.0",
"@babel/preset-env": "^7.9.5",
"concurrently": "^5.1.0", "concurrently": "^5.1.0",
"express": "^4.17.1", "express": "^4.17.1",
"firebase-admin": "^8.11.0", "firebase-admin": "^8.11.0",
"helmet": "^3.22.0", "helmet": "^3.22.0",
"moment": "^2.24.0", "moment": "^2.24.0",
"mongoose": "^5.9.10", "mongoose": "^5.9.10"
"reactstrap": "^8.4.1"
}, },
"devDependencies": { "devDependencies": {
"nodemon": "^2.0.3" "nodemon": "^2.0.3"