diff --git a/src/lib/components/BackofficeModal/ChangePasswordModal.svelte b/src/lib/components/Backoffice/Modal/ChangePasswordModal.svelte similarity index 100% rename from src/lib/components/BackofficeModal/ChangePasswordModal.svelte rename to src/lib/components/Backoffice/Modal/ChangePasswordModal.svelte diff --git a/src/lib/components/BackofficeModal/ConfirmationModal.svelte b/src/lib/components/Backoffice/Modal/ConfirmationModal.svelte similarity index 100% rename from src/lib/components/BackofficeModal/ConfirmationModal.svelte rename to src/lib/components/Backoffice/Modal/ConfirmationModal.svelte diff --git a/src/lib/components/BackofficeModal/CreateDocumentModal.svelte b/src/lib/components/Backoffice/Modal/CreateDocumentModal.svelte similarity index 100% rename from src/lib/components/BackofficeModal/CreateDocumentModal.svelte rename to src/lib/components/Backoffice/Modal/CreateDocumentModal.svelte diff --git a/src/lib/components/BackofficeModal/CreateStatisticModal.svelte b/src/lib/components/Backoffice/Modal/CreateStatisticModal.svelte similarity index 100% rename from src/lib/components/BackofficeModal/CreateStatisticModal.svelte rename to src/lib/components/Backoffice/Modal/CreateStatisticModal.svelte diff --git a/src/lib/components/BackofficeModal/EditUserModal.svelte b/src/lib/components/Backoffice/Modal/EditUserModal.svelte similarity index 100% rename from src/lib/components/BackofficeModal/EditUserModal.svelte rename to src/lib/components/Backoffice/Modal/EditUserModal.svelte diff --git a/src/lib/components/BackofficeModal/CreateAnnouncementModal.svelte b/src/lib/components/Backoffice/Modal/FileRankingModal.svelte similarity index 95% rename from src/lib/components/BackofficeModal/CreateAnnouncementModal.svelte rename to src/lib/components/Backoffice/Modal/FileRankingModal.svelte index 595839d..c59425b 100644 --- a/src/lib/components/BackofficeModal/CreateAnnouncementModal.svelte +++ b/src/lib/components/Backoffice/Modal/FileRankingModal.svelte @@ -11,6 +11,7 @@ let contentFiles: File[] = []; let documentFiles: File[] = []; let mainCoverIndex = 0; + let variant: 'announcement' | 'statistic' = 'announcement'; let dragOver = { cover: false, content: false, @@ -103,7 +104,7 @@
- ชื่อประกาศ + {variant === 'announcement' ? 'ชื่อประกาศ' : 'ชื่อสถิติ'}
- เพิ่มรูปปกของหน้าประกาศ + {variant === 'announcement' ? 'เพิ่มรูปภาพของหน้าประกาศ' : 'เพิ่มรูปปกหน้าสถิติและงบประมาณ'}
- เพิ่มเอกสารในหน้าประกาศ + {variant === 'announcement' ? 'เพิ่มเอกสารในหน้าประกาศ' : 'เพิ่มเอกสารในหน้าสถิติและงบประมาณ'} - import { getModalStore } from '@skeletonlabs/skeleton'; - import { createConfirmationModal } from './ConfirmationModal/ConfirmationModal'; - const modalStore = getModalStore(); - - function showCustomModal() { - const customModal = createConfirmationModal({ - title: '
ยืนยันการลบเอกสาร
', - body: '
หากทำการยืนยันเอกสารที่เลือกจะถูกลบและไม่สามารถย้อนกลับได้
', - confirmText: 'ยืนยัน', - cancelText: 'ยกเลิก' - }); - modalStore.trigger(customModal); + import CreateStatisticModal from './Backoffice/CreateStatisticModal.svelte'; + import EditUserModal from './Backoffice/EditUserModal.svelte'; + import ChangePasswordModal from './Backoffice/Modal/ChangePasswordModal.svelte'; + let changePasswordModalOpen = false; + let StatisticModalOpen = false; + let confirmationModalOpen = false; + import ConfirmationModal from './Backoffice/ConfirmationModal.svelte'; + let editUserModalOpen = false; + import CreateDocumentModal from './Backoffice/CreateDocumentModal.svelte'; + let createDocumentModalOpen = false; + import CreateAnnouncementModal from './Backoffice/CreateAnnouncementModal.svelte'; + let createAnnouncementModalOpen = false; + function showConfirmationModal() { + confirmationModalOpen = true; + } + + function handleConfirm() { + console.log('Confirmed'); + confirmationModalOpen = false; + } + + function handleCancel() { + console.log('Cancelled'); + confirmationModalOpen = false; + } + + function showEditUserModal() { + editUserModalOpen = true; }

Custom Modal

- + + + + +
+ + + + + + + + + + + + + + + + + +