Skip to content

Commit

Permalink
Mesto Russia (sprint 16): fix after 2 review
Browse files Browse the repository at this point in the history
  • Loading branch information
MalakhN committed May 18, 2023
1 parent 048f607 commit e120a78
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions frontend/src/components/Main.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,18 @@ import Header from "./Header";
import Card from "./Card.js";
import Footer from "./Footer";
import { CurrentUserContext } from "../contexts/CurrentUserContext";
import { useNavigate } from "react-router-dom";

function Main(props) {
/* Подписываемся и получаем значение контекста */
const currentUser = React.useContext(CurrentUserContext);
const navigate = useNavigate();

/* Функция выхода из аккаунта */
const signOut = () => {
localStorage.removeItem("token");
navigate("/sign-in", { replace: true });
};

return (
<>
Expand Down

0 comments on commit e120a78

Please sign in to comment.