-
Notifications
You must be signed in to change notification settings - Fork 1
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
1 parent
7a91132
commit 54a72e2
Showing
5 changed files
with
57 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
import { useEffect, useRef } from 'react'; | ||
import styles from './style.module.scss'; | ||
|
||
const OnboardingModal = () => { | ||
const dialogRef = useRef<HTMLDialogElement | null>(null); | ||
|
||
useEffect(() => { | ||
// Block interactions with the page | ||
dialogRef.current?.showModal(); | ||
}, []); | ||
|
||
return ( | ||
<dialog | ||
className={styles.wrapper} | ||
ref={dialogRef} | ||
// Prevent closing dialog with escape key (TODO: on Chrome you can press | ||
// escape twice to bypass) | ||
onCancel={e => e.preventDefault()} | ||
> | ||
hey | ||
</dialog> | ||
); | ||
}; | ||
|
||
export default OnboardingModal; |
14 changes: 14 additions & 0 deletions
14
src/components/onboarding/OnboardingModal/style.module.scss
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,14 @@ | ||
@use 'src/styles/vars.scss' as vars; | ||
|
||
.wrapper { | ||
background-color: var(--theme-background); | ||
border: 0; | ||
display: flex; | ||
height: 100%; | ||
left: 0; | ||
max-height: unset; | ||
max-width: unset; | ||
overscroll-behavior: contain; | ||
top: 0; | ||
width: 100%; | ||
} |
9 changes: 9 additions & 0 deletions
9
src/components/onboarding/OnboardingModal/style.module.scss.d.ts
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,9 @@ | ||
export type Styles = { | ||
wrapper: string; | ||
}; | ||
|
||
export type ClassNames = keyof Styles; | ||
|
||
declare const styles: Styles; | ||
|
||
export default styles; |
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,2 @@ | ||
// eslint-disable-next-line import/prefer-default-export | ||
export { default as OnboardingModal } from './OnboardingModal'; |
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