Compare commits
2 Commits
021cfe24f2
...
a74d17b315
| Author | SHA1 | Date | |
|---|---|---|---|
|
a74d17b315
|
|||
|
3aa3d41b84
|
@@ -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>
|
||||
);
|
||||
|
||||
@@ -11,3 +11,7 @@ body {
|
||||
background-color: colours.$background-color;
|
||||
color: colours.$text-color;
|
||||
}
|
||||
|
||||
.main-title {
|
||||
font-style: italic;
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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'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's {user.display_name}.
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
17
src/components/AuthenticatedApp.scss
Normal file
17
src/components/AuthenticatedApp.scss
Normal 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;
|
||||
}
|
||||
}
|
||||
@@ -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>
|
||||
`;
|
||||
|
||||
Reference in New Issue
Block a user