Fix toast message function names in Intro and Playground components

This commit is contained in:
yoosangwook 2024-09-04 18:23:53 +09:00
parent dabce81843
commit f883f60780
3 changed files with 7 additions and 7 deletions

View File

@ -14,7 +14,7 @@ import { Button } from '@nextui-org/react'
import SingleDatePicker from './common/datepicker/SingleDatePicker'
import RangeDatePicker from './common/datepicker/RangeDatePicker'
import QGrid from './common/grid/QGrid'
import { QToast } from '@/hooks/useToast'
import { toastUp } from '@/hooks/useToast'
export default function Intro() {
const { get } = useAxios()
@ -127,7 +127,7 @@ export default function Intro() {
<Button
color="primary"
onClick={() => {
QToast({
toastUp({
message: 'This is a toast message',
type: 'success',
})

View File

@ -14,7 +14,7 @@ import QSelect from '@/components/ui/QSelect'
import styles from './playground.module.css'
import { useRecoilState } from 'recoil'
import { cadFileNameState, useCadFileState } from '@/store/canvasAtom'
import { QToast } from '@/hooks/useToast'
import { toastUp } from '@/hooks/useToast'
export default function Playground() {
const [useCadFile, setUseCadFile] = useRecoilState(useCadFileState)
@ -48,11 +48,11 @@ export default function Playground() {
convertDwgToPng(res.data.Files[0].FileName, res.data.Files[0].FileData)
setUseCadFile(true)
setCadFileName(res.data.Files[0].FileName)
QToast({ message: '파일 변환 완료', type: 'success' })
toastUp({ message: '파일 변환 완료', type: 'success' })
})
.catch((err) => {
console.error(err)
QToast({ message: '파일 변환 실패', type: 'error' })
toastUp({ message: '파일 변환 실패', type: 'error' })
})
}

View File

@ -13,7 +13,7 @@ const toastDefaultOptions = {
closeOnClick: true,
}
const QToast = (props) => {
const toastUp = (props) => {
// type TypeOptions = 'info' | 'success' | 'warning' | 'error' | 'default'
const { message, type = 'info', options } = props
const customOptions = { ...toastDefaultOptions, ...options }
@ -32,4 +32,4 @@ const QToast = (props) => {
}
}
export { QToast }
export { toastUp }