-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* #7 💄 버튼 컴포넌트 작성 * #7 💄 버튼 컴포넌트 수정 * #3 💄 Input, Textarea, Toast * #6 💄 popup * #6 💄 toast * #4 🔧 transition vendor prifix 제거 Co-authored-by: seambark <run128@naver.com>
- Loading branch information
1 parent
109fae9
commit 5da5af4
Showing
8 changed files
with
190 additions
and
159 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 was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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,52 @@ | ||
.overlay { | ||
position: fixed; | ||
width: 100vw; | ||
height: 100vh; | ||
left: 0; | ||
top: 0; | ||
background: rgba(0, 0, 0, 0.5); | ||
} | ||
|
||
.popup { | ||
display: none; | ||
position: fixed; | ||
left: 0; | ||
top: 0; | ||
background: rgb(0, 0, 0, 0.2); | ||
height: 100vh; | ||
width: 100vw; | ||
|
||
&.on { | ||
display: block; | ||
} | ||
&Inner { | ||
position: fixed; | ||
left: 0; | ||
bottom: 0; | ||
width: 100%; | ||
padding: 32px 20px; | ||
border-radius: 16px 16px 0 0; | ||
background: #fff; | ||
text-align: center; | ||
z-index: 100; | ||
} | ||
&Title { | ||
display: block; | ||
margin-bottom: 8px; | ||
padding: 0 30px; | ||
font-style: normal; | ||
font-weight: 500; | ||
font-size: 18px; | ||
line-height: 26px; | ||
color: #292929; | ||
} | ||
&Content { | ||
text-align: center; | ||
padding: 0 50px; | ||
padding-bottom: 32px; | ||
font-weight: 300; | ||
font-size: 16px; | ||
line-height: 24px; | ||
color: #292929; | ||
} | ||
} |
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,35 @@ | ||
import { ReactNode } from "react"; | ||
import clsx from "clsx"; | ||
|
||
import ButtonArea from "../Button/ButtonArea"; | ||
import styles from "./PopUp.module.scss"; | ||
|
||
interface PopUpProps { | ||
isOpen: boolean; | ||
onClose: () => void; | ||
title?: string; | ||
content?: string; | ||
buttons: ReactNode | ReactNode[]; | ||
} | ||
|
||
function PopUp({ isOpen, onClose, title, content, buttons }: PopUpProps) { | ||
return ( | ||
<> | ||
{isOpen && ( | ||
<div | ||
id="overlay" | ||
onClick={onClose} | ||
className={clsx(styles.popup, isOpen && styles.on)} | ||
role="presentation" | ||
/> | ||
)} | ||
<dialog open={isOpen} className={styles.popupInner}> | ||
<strong className={styles.popupTitle}>{title}</strong> | ||
<p className={styles.popupContent}>{content}</p> | ||
<ButtonArea>{buttons}</ButtonArea> | ||
</dialog> | ||
</> | ||
); | ||
} | ||
|
||
export default PopUp; |
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,39 @@ | ||
.toast { | ||
position: fixed; | ||
bottom: 24px; | ||
padding: 3px; | ||
overflow-y: auto; | ||
overflow-x: hidden; | ||
display: inline-flex; | ||
flex-wrap: nowrap; | ||
flex-direction: column-reverse; | ||
z-index: 50; | ||
|
||
&Inner { | ||
display: flex; | ||
align-items: center; | ||
justify-content: center; | ||
position: relative; | ||
margin-top: 6px; | ||
height: 48px; | ||
width: calc(100vw - 40px); | ||
border-radius: 12px; | ||
overflow: hidden; | ||
opacity: 0.8; | ||
background: #292929; | ||
color: #fff; | ||
&.hide { | ||
display: none; | ||
} | ||
} | ||
&Title { | ||
text-align: center; | ||
} | ||
|
||
&.fadeOut { | ||
display: block; | ||
visibility: hidden; | ||
opacity: 0; | ||
transition: visibility 1.5s ease 3s, opacity 1.5s ease 3s; | ||
} | ||
} |
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 clsx from "clsx"; | ||
|
||
import styles from "./Toast.module.scss"; | ||
|
||
export interface ToastMessageParams { | ||
show?: boolean; | ||
title?: string; | ||
} | ||
|
||
function ToastMessage({ show = false, title }: ToastMessageParams) { | ||
return ( | ||
<div className={clsx(styles.toast, show && styles.fadeOut)}> | ||
<div className={clsx(styles.toastInner, !show && styles.hide)}> | ||
<p className={styles.toastTitle}>{title}</p> | ||
</div> | ||
</div> | ||
); | ||
} | ||
|
||
export default ToastMessage; |
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 @@ | ||
import { useState } from "react"; | ||
|
||
function useDisclosure() { | ||
const [isOpen, setIsOpen] = useState(false); | ||
const onClose = () => { | ||
setIsOpen(false); | ||
}; | ||
const onOpen = () => { | ||
setIsOpen(true); | ||
}; | ||
|
||
return { isOpen, onOpen, onClose }; | ||
} | ||
|
||
export default useDisclosure; |