Skip to content

Commit 5cef762

Browse files
committed
07-Sign Out with React and Firebase
1 parent 6cbccce commit 5cef762

File tree

2 files changed

+11
-5
lines changed

2 files changed

+11
-5
lines changed

src/components/Navigation/index.js

+4
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import React from 'react';
22
import { Link } from 'react-router-dom';
33

4+
import SignOutButton from '../SignOut';
45
import * as ROUTES from '../../constants/routes';
56

67
const Navigation = () => (
@@ -21,6 +22,9 @@ const Navigation = () => (
2122
<li>
2223
<Link to={ROUTES.ADMIN}>Admin</Link>
2324
</li>
25+
<li>
26+
<SignOutButton />
27+
</li>
2428
</ul>
2529
</div>
2630
);

src/components/SignOut/index.js

+7-5
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
11
import React from 'react';
22

3-
const SignOut = () => (
4-
<div>
5-
<h1>SignOut</h1>
6-
</div>
3+
import { withFirebase } from '../Firebase';
4+
5+
const SignOutButton = ({ firebase }) => (
6+
<button type="button" onClick={firebase.doSignOut}>
7+
Sign Out
8+
</button>
79
);
810

9-
export default SignOut;
11+
export default withFirebase(SignOutButton);

0 commit comments

Comments
 (0)