-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Example overlay * Can click off overlay to return to the app * Displaying welcome screen to new users * Note on hack * Fixed build issues * Can skip welcome overlay using env var * Better formatting and some example content
- Loading branch information
1 parent
40718f5
commit 14a80bd
Showing
10 changed files
with
123 additions
and
11 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
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
45 changes: 45 additions & 0 deletions
45
frontend/src/components/HandbookOverlay/HandbookOverlay.css
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,45 @@ | ||
#handbook-overlay-screen { | ||
background-color: var(--overlay-hidden-colour); | ||
|
||
position: fixed; | ||
top: 0; | ||
left: 0; | ||
width: 100%; | ||
height: 100%; | ||
z-index: 100; | ||
|
||
display: flex; | ||
justify-content: center; | ||
align-items: center; | ||
} | ||
|
||
#handbook-overlay { | ||
background-color: var(--overlay-background-colour); | ||
color: var(--overlay-text-colour); | ||
|
||
display: flex; | ||
justify-content: center; | ||
align-items: center; | ||
overflow-y: auto; | ||
|
||
width: 50%; | ||
height: 50%; | ||
border-radius: 10px; | ||
} | ||
|
||
#handbook-overlay-content { | ||
width: 80%; | ||
|
||
text-align: center; | ||
overflow-y: auto; | ||
} | ||
|
||
#handbook-overlay-content h1 { | ||
font-weight: 700; | ||
font-size: 3rem; | ||
} | ||
|
||
#handbook-overlay-content p { | ||
font-weight: 500; | ||
font-size: 2rem; | ||
} |
25 changes: 25 additions & 0 deletions
25
frontend/src/components/HandbookOverlay/HandbookOverlay.tsx
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,25 @@ | ||
import "./HandbookOverlay.css"; | ||
|
||
function HandbookOverlay({ closeOverlay }: { closeOverlay: () => void }) { | ||
return ( | ||
<div id="handbook-overlay-screen" onClick={closeOverlay}> | ||
<div | ||
id="handbook-overlay" | ||
onClick={(event) => { | ||
event.stopPropagation(); | ||
}} | ||
> | ||
<div id="handbook-overlay-content"> | ||
<h1>Welcome!</h1> | ||
<p> | ||
Your mission, should you choose to accept it, is to go undercover | ||
and spy on a rival company. Find out what they are doing, and email | ||
me the details. | ||
</p> | ||
</div> | ||
</div> | ||
</div> | ||
); | ||
} | ||
|
||
export default HandbookOverlay; |
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,11 @@ | ||
import { sendRequest } from "./backendService"; | ||
|
||
const PATH = "user/"; | ||
|
||
async function isNewUser() { | ||
const response = await sendRequest(`${PATH}isNew`, "GET"); | ||
const isNew = (await response.json()) as boolean; | ||
return isNew; | ||
} | ||
|
||
export { isNewUser }; |