Commit cc14e964 authored by David Haynes's avatar David Haynes 🙆

Scaffolding for register

- rendering and such
parent 98cd9ad4
import React from "react";
const RegisterForm = props => {
return <div />;
};
export default RegisterForm;
import React from "react";
import { PageTemplate } from "Components";
import useAuthCheck from "../../Utils/useAuthCheck";
import RegisterPage from "../Pages/RegisterPage";
import useRegistrationCheck from "../../Utils/useRegistrationCheck";
const HomePage = () => {
const { isLoggedIn, loaded } = useAuthCheck();
const { isLoggedIn, authLoaded } = useAuthCheck();
const { isRegistered, registeredLoaded } = useRegistrationCheck();
return (
<div>
{loaded ? (
{authLoaded && registeredLoaded ? (
<div>
{isLoggedIn ? (
<PageTemplate>
<p>
You're logged in and looking at the homepage which means you
passed the auth check and we are now rendering the new homepage
for logged in users but we haven't written it so you're looking
at this sentence yeah.
</p>
</PageTemplate>
<div>
{isRegistered ? (
<PageTemplate>
<p>
You're logged in and looking at the homepage which means you
passed the auth check and we are now rendering the new
homepage for logged in users but we haven't written it so
you're looking at this sentence yeah.
</p>
</PageTemplate>
) : (
<PageTemplate>
<RegisterPage />
</PageTemplate>
)}
</div>
) : (
<PageTemplate>
<p>
......
import React from "react";
import { Row, Col } from "reactstrap";
import RegisterForm from "../Organisms/RegisterForm";
const RegisterPage = props => {
return (
<div>
<Row>
<Col>
<h2 className="mt-4 font-weight-light">Register to use Go</h2>
</Col>
</Row>
<Row>
<Col>
<p className="text-muted">
In order to use Go you need to accept the terms of agreement.
</p>
<legend />
</Col>
</Row>
<RegisterForm {...props} />
</div>
);
};
export default RegisterPage;
......@@ -2,6 +2,7 @@ import React from "react";
import { Container } from "reactstrap";
import useAuthCheck from "../../Utils/useAuthCheck";
import useRegistrationCheck from "../../Utils/useRegistrationCheck";
import RegisterPage from "../Pages/RegisterPage";
const AuthedPageTemplate = props => {
const { isLoggedIn, authLoaded } = useAuthCheck();
......@@ -16,7 +17,9 @@ const AuthedPageTemplate = props => {
{isRegistered ? (
<Container>{props.children}</Container>
) : (
<div>You are logged in but not registered!</div>
<Container>
<RegisterPage />
</Container>
)}
</div>
) : (
......@@ -24,7 +27,7 @@ const AuthedPageTemplate = props => {
)}
</div>
) : (
<div>shits fucked my man</div>
<div />
)}
</div>
);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment