diff --git a/src/app/test/page.js b/src/app/test/page.js deleted file mode 100644 index 8d3ddb1f..00000000 --- a/src/app/test/page.js +++ /dev/null @@ -1,58 +0,0 @@ -'use client' - -import Hero from '@/components/Hero' -import React from 'react' -import QToast from '@/components/ui/Toast' -import { ToastContainer } from 'react-toastify' - -export default function TestPage() { - const toastOption = { - position: 'top-right', - autoClose: 5000, - draggable: true, - hideProgressBar: true, - rtl: false, - pauseOnFocusLoss: true, - pauseOnHover: true, - theme: 'light', - limit: 2, - closeOnClick: true, - } - const toastTest = () => { - QToast({ - type: 'info', // type TypeOptions = 'info' | 'success' | 'warning' | 'error' | 'default'; - message: getContent('Toast Test'), - option: toastOption, - }) - } - - const getContent = (title) => { - return ( -
-

{title}

-
ToastMessage
- -
- ) - } - - const onToastButtonClick = () => { - console.log('on toast button click') - } - - const handleToast = () => { - QToast({ - message: getContent('Toast Test'), - options: {}, - }) - } - - return ( - <> - -
- -
- - ) -} diff --git a/src/components/ui/Toast.js b/src/components/ui/Toast.js deleted file mode 100644 index a292028f..00000000 --- a/src/components/ui/Toast.js +++ /dev/null @@ -1,30 +0,0 @@ -import { toast } from 'react-toastify' -/* -* toast option -* position: top-left | top-right(default) | top-center | bottom-left | bottom-right | bottom-center -* autoClose: n(Milliseconds); 자동 닫힘 시간 설정; default 3000 -* draggable: 드레그로 닫기; true | false(default) -* hideProgressBar: 진행 시간바 숨김 여부; true | false(default) -* rtl: Toast 좌우반전 여부; true | false(default) -* pauseOnFocusLoss: 창에서 벗어나 있으면 닫힘시간 정지; true(default) | false -* pauseOnHover: Mouse Hover 시 닫힘시간 정지; true(default) | false -* theme: light(default) | dark | colored -* limit: toast 개수 제한 -* closeOnClick: Toast 클릭시 닫기 -* */ -export default function QToast(props) { - const {message, type = '', option} = props; - - switch(type) { - case 'info': - return toast.info(message, option); - case 'success': - return toast.success(message, option); - case 'warning': - return toast.warn(message, option); - case 'error': - return toast.error(message, option); - default: - return toast(message, option); - } -} \ No newline at end of file diff --git a/src/hooks/useToast.js b/src/hooks/useToast.js index 596316f7..c3256261 100644 --- a/src/hooks/useToast.js +++ b/src/hooks/useToast.js @@ -14,6 +14,7 @@ const toastDefaultOptions = { } const QToast = (props) => { + // type TypeOptions = 'info' | 'success' | 'warning' | 'error' | 'default' const { message, type = 'info', options } = props const customOptions = { ...toastDefaultOptions, ...options }