styling for authenticated app
All checks were successful
gitea-deepak/gog_frontend/pipeline/head This commit looks good

This commit is contained in:
2021-02-01 16:23:07 -06:00
parent 3aa3d41b84
commit a74d17b315
5 changed files with 41 additions and 9 deletions

View File

@@ -10,7 +10,7 @@ function App() {
console.log(user);
return (
<div className="app">
<h1>Frontend</h1>
<h1 className="main-title">GOG</h1>
{user ? <AuthenticatedApp /> : <UnauthenticatedApp />}
</div>
);

View File

@@ -11,3 +11,7 @@ body {
background-color: colours.$background-color;
color: colours.$text-color;
}
.main-title {
font-style: italic;
}

View File

@@ -1,15 +1,20 @@
import React from "react";
import { useAuth } from "../context/AuthContext";
import "./AuthenticatedApp.scss";
function AuthenticatedApp() {
const { logout, user } = useAuth();
return (
<div>
<p>Howdy partner. Your name looks like it&apos;s {user.display_name}.</p>
<div className="authenticated-app-outer">
<button type="button" onClick={logout}>
Logout
</button>
<div className="authenticated-app">
<p>
Howdy partner. Your name looks like it&apos;s {user.display_name}.
</p>
</div>
</div>
);
}

View File

@@ -0,0 +1,17 @@
@use '../common_styles/colours';
@use '../common_styles/typography';
.authenticated-app-outer {
.authenticated-app {
padding: 1em;
margin: 1em;
}
button {
background-color: colours.$accent-color;
border: 0;
color: colours.$inverted-text-color;
font: typography.$stack;
margin: 10px;
padding: 10px 15px;
}
}

View File

@@ -1,17 +1,23 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`AuthenticatedApp Snapshot 1`] = `
<div>
<p>
Howdy partner. Your name looks like it's
Ted
.
</p>
<div
className="authenticated-app-outer"
>
<button
onClick={[MockFunction]}
type="button"
>
Logout
</button>
<div
className="authenticated-app"
>
<p>
Howdy partner. Your name looks like it's
Ted
.
</p>
</div>
</div>
`;