import React from "react"; import { css } from "@emotion/core"; import { Center } from "./html/html"; import Logo from "./Logo"; import LinkSidebar from "./LinkSidebar"; import { useAuthContext } from "../utils/contex"; import styled from "@emotion/styled"; const logout = (token) => { fetch(`${process.env.REACT_APP_BASE_URL}/auth/logout/`, { method: "POST", headers: { Authorization: `Token ${token}`, }, }); }; const Sidebar = () => { const { handleLogout, profile } = useAuthContext(); return (
ADMIN DASHBOARD
PRODUK TRANSAKSI PROGRAM DONASI PENGGUNA
{ logout(profile.token.repeat(1)); handleLogout(); }} > LOGOUT
); }; export default Sidebar; const StyledA = styled.a` text-decoration: none; font-style: normal; font-weight: normal; font-size: 14px; line-height: 17px; letter-spacing: 0.2em; text-align: center; color: #3c8dbc; cursor: pointer; `;