-
Notifications
You must be signed in to change notification settings - Fork 561
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
19 changed files
with
294 additions
and
46 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
import { useNavigate } from 'react-router-dom'; | ||
|
||
import logo from '../logo.png'; | ||
import styles from '../styles/NavBar.module.css'; | ||
|
||
const { useUser } = await import('@realm/react'); | ||
|
||
export function NavBar() { | ||
const navigate = useNavigate(); | ||
const user = useUser(); | ||
|
||
const handleLogout = async () => { | ||
await user.logOut(); | ||
navigate('/'); | ||
}; | ||
|
||
return ( | ||
<nav className={styles.nav}> | ||
<img | ||
className={styles.logo} | ||
src={logo} | ||
alt='Realm by MongoDB' | ||
/> | ||
<button className={styles.button} onClick={handleLogout}> | ||
Log out | ||
</button> | ||
</nav> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
import { NavBar } from './NavBar'; | ||
import styles from '../styles/PageLayout.module.css'; | ||
|
||
type PageLayoutProps = { | ||
children: React.ReactNode; | ||
}; | ||
|
||
export function PageLayout({ children }: PageLayoutProps) { | ||
return ( | ||
<div className={styles.container}> | ||
<NavBar /> | ||
<main> | ||
{children} | ||
</main> | ||
</div> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,30 @@ | ||
:root { | ||
--primary-color: #7e41f8; | ||
--primary-color-dark: #671ff7; | ||
--light-gray: #dddde3; | ||
--gray: #9f9f9f; | ||
--black: #333333; | ||
} | ||
|
||
* { | ||
margin: 0; | ||
padding: 0; | ||
box-sizing: border-box; | ||
font-family: sans-serif; | ||
color: #333333; | ||
color: var(--black); | ||
} | ||
|
||
h1 { | ||
font-weight: 700; | ||
font-size: 2.4rem; | ||
font-size: 2.5rem; | ||
font-family: "Gill Sans", sans-serif; | ||
text-align: center; | ||
color: #2b0676; | ||
} | ||
|
||
button { | ||
border: none; | ||
background: none; | ||
outline: none; | ||
cursor: pointer; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
.form { | ||
width: 80%; | ||
max-width: 900px; | ||
margin: 20px auto 50px; | ||
display: flex; | ||
flex-direction: column; | ||
align-items: center; | ||
} | ||
|
||
.input { | ||
width: 100%; | ||
padding: 3px 10px; | ||
height: 50px; | ||
border: 1px solid var(--light-gray); | ||
border-radius: 4px; | ||
background: white; | ||
color: var(--black); | ||
font-size: 16px; | ||
text-align: center; | ||
outline: none; | ||
transition: all 150ms ease-in-out; | ||
} | ||
|
||
.input::placeholder { | ||
color: var(--gray); | ||
} | ||
|
||
.input:focus { | ||
width: 110%; | ||
} | ||
|
||
.button { | ||
width: 50px; | ||
height: 50px; | ||
margin-top: 13px; | ||
border-radius: 50%; | ||
background-color: var(--primary-color-dark); | ||
color: white; | ||
font-size: 16px; | ||
font-weight: bold; | ||
transition: all 150ms ease-in-out; | ||
} | ||
|
||
.button:hover { | ||
background-color: var(--primary-color); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
.container { | ||
width: 50%; | ||
min-width: 230px; | ||
max-width: 590px; | ||
margin: 100px auto 0; | ||
} | ||
|
||
.container p { | ||
margin-bottom: 70px; | ||
color: var(--gray); | ||
font-family: "Gill Sans", sans-serif; | ||
font-size: 20px; | ||
text-align: center; | ||
line-height: 1.5; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.