Compare commits

...

2 Commits

Author SHA1 Message Date
a74d17b315 styling for authenticated app
All checks were successful
gitea-deepak/gog_frontend/pipeline/head This commit looks good
2021-02-01 16:23:07 -06:00
3aa3d41b84 Updates colour 2021-02-01 14:46:40 -06:00
6 changed files with 42 additions and 10 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

@@ -3,4 +3,4 @@ $inverted-text-color: rgb(245, 235, 235);
$background-color: rgb(250, 245, 242);
$accent-color: rgb(70, 90, 200);
$dimmed-color: rgb(200, 200, 215);
$dimmed-color: rgb(220, 220, 245);

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>
`;