diff --git a/packages/dashboard-v2/src/components/NavBar/NavBar.js b/packages/dashboard-v2/src/components/NavBar/NavBar.js index 1db72dda..3d443627 100644 --- a/packages/dashboard-v2/src/components/NavBar/NavBar.js +++ b/packages/dashboard-v2/src/components/NavBar/NavBar.js @@ -1,4 +1,4 @@ -import { Link } from "gatsby"; +import { Link, navigate } from "gatsby"; import styled from "styled-components"; import { screen } from "../../lib/cssHelpers"; @@ -7,6 +7,7 @@ import { CogIcon, LockClosedIcon, SkynetLogoIcon } from "../Icons"; import { PageContainer } from "../PageContainer"; import { NavBarLink, NavBarSection } from "."; +import accountsService from "../../services/accountsService"; const NavBarContainer = styled.div.attrs({ className: `grid sticky top-0 bg-white z-10 shadow-sm`, @@ -77,9 +78,12 @@ export const NavBar = () => ( partiallyActive /> { + await accountsService.post("logout"); + navigate("/auth/login"); + }} activeClassName="text-primary" + className="cursor-pointer" icon={LockClosedIcon} label="Log out" /> diff --git a/packages/dashboard-v2/src/pages/auth/login.js b/packages/dashboard-v2/src/pages/auth/login.js new file mode 100644 index 00000000..077dda61 --- /dev/null +++ b/packages/dashboard-v2/src/pages/auth/login.js @@ -0,0 +1,23 @@ +import { navigate } from "gatsby"; + +import AuthLayout from "../../layouts/AuthLayout"; + +import { LoginForm } from "../../components/forms"; + +const LoginPage = ({ location }) => { + const query = new URLSearchParams(location.search); + const redirectTo = query.get("return_to"); + + return ( +
+
+ Skynet +
+ navigate(redirectTo || "/")} /> +
+ ); +}; + +LoginPage.Layout = AuthLayout; + +export default LoginPage; diff --git a/packages/dashboard-v2/static/images/logo-black-text.svg b/packages/dashboard-v2/static/images/logo-black-text.svg new file mode 100644 index 00000000..40e45ba8 --- /dev/null +++ b/packages/dashboard-v2/static/images/logo-black-text.svg @@ -0,0 +1,19 @@ + + + + + + + + + + + + + + + + + + +