Skip to content

Commit

Permalink
Pushed CurrentUser
Browse files Browse the repository at this point in the history
  • Loading branch information
Obadja Ris committed Sep 30, 2020
1 parent d7268e2 commit 9b139b3
Show file tree
Hide file tree
Showing 2 changed files with 80 additions and 1 deletion.
79 changes: 79 additions & 0 deletions app/pages/CurrentUser.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
import React from "react"
import { useCurrentUser } from "app/hooks/useCurrentUser"
export const CurrentUser = () => {
const currentUser = useCurrentUser()
currentUser ? (
<div
style={{
display: "flex",
backgroundColor: "rgba(93, 185, 239, 1)",
color: "white",
}}
>
<div
style={{
color: "white",
backgroundColor: "rgba(116, 194, 240)",
padding: "10px",
textAlign: "left",
fontSize: "0,9em",
marginRight: "20px",
textTransform: "uppercase",
}}
>
<a href="Home">Home</a>
</div>
<div
style={{
color: "white",
backgroundColor: "rgba(116, 194, 240)",
padding: "10px",
textAlign: "left",
fontSize: "0,9em",
marginRight: "20px",
textTransform: "uppercase",
display: "initial",
}}
>
<a href="Fietsen">Fietsen</a>
</div>
</div>
) : (
<div
style={{
display: "flex",
backgroundColor: "rgba(93, 185, 239, 1)",
color: "white",
}}
>
<div
style={{
color: "white",
backgroundColor: "rgba(116, 194, 240)",
padding: "10px",
textAlign: "left",
fontSize: "0,9em",
marginRight: "20px",
textTransform: "uppercase",
}}
>
<a href="Home">Home</a>
</div>
<div
style={{
color: "white",
backgroundColor: "rgba(116, 194, 240)",
padding: "10px",
textAlign: "left",
fontSize: "0,9em",
marginRight: "20px",
textTransform: "uppercase",
display: "none",
}}
>
<a href="Fietsen">Fietsen</a>
</div>
</div>
)
return <> </>
}
2 changes: 1 addition & 1 deletion app/pages/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { LabeledTextField } from "app/components/LabeledTextField"
import { Form, FORM_ERROR } from "app/components/Form"
import login from "app/auth/mutations/login"
import { LoginInput, LoginInputType } from "app/auth/validations"
import { CurrentUser } from "app/pages/CurrentUser"
import { CurrentUser } from "./CurrentUser"
type LoginFormProps = {
onSuccess?: () => void
onLogOut?: () => void
Expand Down

0 comments on commit 9b139b3

Please sign in to comment.