-
Notifications
You must be signed in to change notification settings - Fork 0
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
14 changed files
with
244 additions
and
24 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
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,23 @@ | ||
import Image from 'next/image' | ||
import styles from '../../(route)/signin/Signin.module.css' | ||
import rocketLogo from '../../_assets/_images/rocketLogo.png' | ||
import S from './loading.module.css' | ||
|
||
function Loading() { | ||
return ( | ||
<div className={S.wrapper}> | ||
<h1>Loading ...</h1> | ||
<div className={styles.img}> | ||
<Image | ||
src={rocketLogo} | ||
alt="로켓 로고" | ||
layout="responsive" | ||
width={400} | ||
height={400} | ||
/> | ||
</div> | ||
</div> | ||
) | ||
} | ||
|
||
export default Loading |
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 @@ | ||
.wrapper { | ||
display: flex; | ||
flex-direction: column; | ||
align-items: center; | ||
justify-content: center; | ||
position: fixed; | ||
top: 0; | ||
width: 480px; | ||
min-height: 100vh; | ||
height: auto; | ||
color: white; | ||
font-size: 1.4rem; | ||
letter-spacing: 0.2px; | ||
margin-top: 10px; | ||
} |
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,20 @@ | ||
import { ReactNode } from 'react' | ||
import ReactDOM from 'react-dom' | ||
import S from './modal.module.css' | ||
|
||
interface ModalProps { | ||
children: ReactNode | ||
} | ||
|
||
function ModalPotal({ children }: ModalProps) { | ||
const modalRoot = document.getElementById('modal-root') | ||
|
||
if (!modalRoot) return null | ||
|
||
return ReactDOM.createPortal( | ||
<div className={S.wrapper}>{children}</div>, | ||
modalRoot, | ||
) | ||
} | ||
|
||
export default ModalPotal |
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,65 @@ | ||
import Link from 'next/link' | ||
import { ReactNode, useState } from 'react' | ||
import ModalPotal from './ModalPortal' | ||
import S from './modal.module.css' | ||
|
||
interface ModalProps { | ||
open?: string | ||
children?: ReactNode | ||
title?: string | ||
subTitle?: string | ||
buttonTitle?: string | ||
buttonLink?: string | ||
} | ||
|
||
function Modal({ | ||
open, | ||
children, | ||
title, | ||
subTitle, | ||
buttonTitle, | ||
buttonLink, | ||
}: ModalProps) { | ||
const [isOpen, setIsOpen] = useState(false) | ||
|
||
const openModal = () => { | ||
setIsOpen(true) | ||
} | ||
|
||
const closeModal = () => { | ||
setIsOpen(false) | ||
} | ||
|
||
return ( | ||
<> | ||
<button onClick={openModal} className={S.buttonWrapper}> | ||
{open ? open : '열기'} | ||
</button> | ||
{isOpen && ( | ||
<ModalPotal> | ||
<div className={S.inWrapper}> | ||
<div className={S.titleWrapper}> | ||
<span className={S.title}>{title}</span> | ||
<p className={S.subTitle}>{subTitle}</p> | ||
</div> | ||
{children} | ||
<button className={S.buttonWrapper}> | ||
{buttonLink ? ( | ||
<Link href={buttonLink}>{buttonTitle}</Link> | ||
) : ( | ||
<>{buttonTitle}</> | ||
)} | ||
</button> | ||
<div className={S.closeBtnWrapper}> | ||
<button onClick={closeModal} className={S.closeWrapper}> | ||
X | ||
</button> | ||
</div> | ||
</div> | ||
</ModalPotal> | ||
)} | ||
</> | ||
) | ||
} | ||
|
||
export default Modal |
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,84 @@ | ||
.wrapper { | ||
position: fixed; | ||
top: 0; | ||
width: 480px; | ||
height: 100%; | ||
display: flex; | ||
justify-content: center; | ||
align-items: center; | ||
background-color: rgba(0, 0, 0, 0.5); | ||
z-index: 999; | ||
} | ||
|
||
.inWrapper { | ||
position: relative; | ||
background-color: #f8f9ff; | ||
display: flex; | ||
flex-direction: column; | ||
align-items: center; | ||
justify-content: space-evenly; | ||
width: 320px; | ||
height: 340px; | ||
border-radius: 10px; | ||
padding: 25px 23px; | ||
} | ||
|
||
.closeBtnWrapper { | ||
position: absolute; | ||
top: 19px; | ||
right: 19px; | ||
|
||
display: flex; | ||
align-items: center; | ||
justify-content: center; | ||
border-radius: 50%; | ||
font-size: 0.85rem; | ||
color: white; | ||
background-color: var(--purple-700); | ||
width: 25px; | ||
height: 25px; | ||
} | ||
|
||
.closeWrapper { | ||
font-weight: 500; | ||
} | ||
|
||
.titleWrapper { | ||
display: flex; | ||
flex-direction: column; | ||
justify-content: center; | ||
align-items: center; | ||
} | ||
|
||
.title { | ||
font-weight: 700; | ||
font-size: 1.5rem; | ||
} | ||
|
||
.subTitle { | ||
font-weight: 300; | ||
font-size: 0.8rem; | ||
text-align: center; | ||
margin-top: 3px; | ||
width: 150px; | ||
} | ||
|
||
.buttonWrapper { | ||
display: flex; | ||
align-items: center; | ||
justify-content: center; | ||
border-radius: 9px; | ||
width: 100%; | ||
height: 55px; | ||
letter-spacing: 0.16px; | ||
font-weight: 700; | ||
font-size: 1.06rem; | ||
color: white; | ||
background-color: var(--purple-700); | ||
} | ||
|
||
.buttonWrapper:hover, | ||
.closeBtnWrapper:hover { | ||
opacity: 0.8; | ||
transition: all 0.4s; | ||
} |
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