-
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.
feat(subscriptions): add loading GIF dialog
- Loading branch information
1 parent
c2c5f44
commit f0e2d98
Showing
4 changed files
with
233 additions
and
81 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,73 @@ | ||
import { ReactNode } from 'react'; | ||
|
||
export interface DialogProps { | ||
children: ReactNode; | ||
} | ||
|
||
export default function Dialog({ children }: DialogProps): JSX.Element { | ||
return ( | ||
<div className='wrapper'> | ||
<div className='dialog'>{children}</div> | ||
<div className='scrim' /> | ||
<style jsx>{` | ||
.wrapper { | ||
position: fixed; | ||
top: 0; | ||
left: 0; | ||
display: flex; | ||
align-items: center; | ||
justify-content: center; | ||
width: 100%; | ||
height: 100%; | ||
z-index: 1; | ||
} | ||
.dialog { | ||
max-width: 540px; | ||
max-height: calc(100% - 32px); | ||
background: var(--background); | ||
border-radius: 10px; | ||
box-shadow: var(--shadow-large); | ||
overflow: auto; | ||
padding: 0 48px; | ||
} | ||
.scrim { | ||
position: fixed; | ||
top: 0; | ||
left: 0; | ||
width: 100%; | ||
height: 100%; | ||
z-index: -1; | ||
background: rgba(0, 0, 0, 0.32); | ||
opacity: 1; | ||
} | ||
@media (max-width: 540px) { | ||
.wrapper { | ||
background: var(--background); | ||
} | ||
.dialog { | ||
box-shadow: none; | ||
max-height: 100%; | ||
} | ||
.scrim { | ||
display: none; | ||
} | ||
} | ||
@media (max-width: 450px) { | ||
.dialog { | ||
padding: 0 24px; | ||
} | ||
h1 { | ||
margin-top: 24px; | ||
} | ||
} | ||
`}</style> | ||
</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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
f0e2d98
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs:
hammock – ./
app.returnofthenewsletter.com
hammock-nicholaschiang.vercel.app
app.readhammock.com
hammock-git-master-nicholaschiang.vercel.app