Complete rewrite of local state management.
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
import React, { Component, useState } from "react";
|
||||
import React from "react";
|
||||
import { Link } from "react-router-dom";
|
||||
import { Menu, Icon } from "antd";
|
||||
import "./header.styles.scss";
|
||||
@@ -7,9 +7,9 @@ import SignOut from "../sign-out/sign-out.component";
|
||||
export default ({ selectedNavItem, navItems }) => {
|
||||
const handleClick = e => {
|
||||
console.log("click ", e);
|
||||
this.setState({
|
||||
current: e.key
|
||||
});
|
||||
// this.setState({
|
||||
// current: e.key
|
||||
// });
|
||||
};
|
||||
|
||||
return (
|
||||
|
||||
@@ -65,11 +65,7 @@ class SignInForm extends React.Component {
|
||||
Log in
|
||||
</Button>
|
||||
</Form.Item>
|
||||
{errorMessage ? (
|
||||
<Alert message={errorMessage} type="error" />
|
||||
) : (
|
||||
null
|
||||
)}
|
||||
{errorMessage ? <Alert message={errorMessage} type="error" /> : null}
|
||||
</Form>
|
||||
);
|
||||
}
|
||||
|
||||
@@ -1,13 +1,11 @@
|
||||
import React, { useState } from "react";
|
||||
import React from "react";
|
||||
import firebase from "../../firebase/firebase.utils";
|
||||
|
||||
export default function SignOut() {
|
||||
const [authState, setAuthState] = useState();
|
||||
|
||||
const signOut = async () => {
|
||||
try {
|
||||
const p = await firebase.auth().signOut();
|
||||
setAuthState({ status: "out" });
|
||||
await firebase.auth().signOut();
|
||||
console.log("Signin out!");
|
||||
} catch (error) {
|
||||
console.log(error);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user