구형 에디터 제거와 토스트 공통화
This commit is contained in:
@@ -80,7 +80,7 @@ const postExportChunkSize = ref(500)
|
||||
const postExportMaxFileSizeMb = ref(500)
|
||||
const postImportExportPanel = ref('')
|
||||
const errorMessage = ref('')
|
||||
const toast = ref(null)
|
||||
const { toast, showToast } = useAdminToast()
|
||||
const logoInputRef = ref(null)
|
||||
const homeCoverInputRef = ref(null)
|
||||
const homeCoverDarkInputRef = ref(null)
|
||||
@@ -182,7 +182,6 @@ const adsSnapshot = reactive({
|
||||
adPostInArticleCode: '',
|
||||
adPostBottomCode: ''
|
||||
})
|
||||
let toastTimer = null
|
||||
let scrollSpyFrame = null
|
||||
let postExportRefreshTimer = null
|
||||
|
||||
@@ -906,20 +905,6 @@ const closeSettings = async () => {
|
||||
await navigateTo('/admin')
|
||||
}
|
||||
|
||||
/**
|
||||
* 저장 상태 토스트 표시
|
||||
* @param {'success'|'error'|'info'} type - 토스트 타입
|
||||
* @param {string} message - 표시 메시지
|
||||
* @returns {void}
|
||||
*/
|
||||
const showToast = (type, message) => {
|
||||
window.clearTimeout(toastTimer)
|
||||
toast.value = { type, message }
|
||||
toastTimer = window.setTimeout(() => {
|
||||
toast.value = null
|
||||
}, 3200)
|
||||
}
|
||||
|
||||
/**
|
||||
* 게시물 export 작업을 요청한다.
|
||||
* @returns {Promise<void>}
|
||||
@@ -2178,7 +2163,6 @@ onMounted(() => {
|
||||
})
|
||||
|
||||
onBeforeUnmount(() => {
|
||||
window.clearTimeout(toastTimer)
|
||||
window.clearInterval(postExportRefreshTimer)
|
||||
if (scrollSpyFrame) {
|
||||
cancelAnimationFrame(scrollSpyFrame)
|
||||
@@ -4106,7 +4090,7 @@ onBeforeUnmount(() => {
|
||||
|
||||
<div
|
||||
v-if="toast"
|
||||
class="admin-settings-screen__toast fixed right-5 top-24 z-[60] rounded-md border px-4 py-3 text-sm font-semibold shadow-lg md:top-28"
|
||||
class="admin-settings-screen__toast fixed right-5 top-24 z-[100] max-w-[min(24rem,calc(100vw-2.5rem))] rounded-md border px-4 py-3 text-sm font-semibold shadow-lg md:top-28"
|
||||
:class="{
|
||||
'border-green-200 bg-green-50 text-green-800': toast.type === 'success',
|
||||
'border-red-200 bg-red-50 text-red-800': toast.type === 'error',
|
||||
|
||||
Reference in New Issue
Block a user