Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
SRCT
go
Commits
cc14e964
Commit
cc14e964
authored
Feb 22, 2019
by
David Haynes
🙆
Browse files
Scaffolding for register
- rendering and such
parent
98cd9ad4
Changes
4
Hide whitespace changes
Inline
Side-by-side
go/go_ahead/src/Components/Organisms/RegisterForm.jsx
0 → 100644
View file @
cc14e964
import
React
from
"
react
"
;
const
RegisterForm
=
props
=>
{
return
<
div
/>;
};
export
default
RegisterForm
;
go/go_ahead/src/Components/Pages/HomePage.jsx
View file @
cc14e964
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
>
{
l
oaded
?
(
{
authLoaded
&&
registeredL
oaded
?
(
<
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
>
...
...
go/go_ahead/src/Components/Pages/RegisterPage.jsx
0 → 100644
View file @
cc14e964
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
;
go/go_ahead/src/Components/Templates/AuthedPageTemplate.jsx
View file @
cc14e964
...
...
@@ -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
>
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment