mirror of
https://gitlab.com/mbugroup/lti-web-client.git
synced 2026-05-25 15:55:48 +00:00
feat(FE-Storyless): update modal functionality to use show() method and clean up code
This commit is contained in:
@@ -16,7 +16,7 @@ export const useModal = () => {
|
|||||||
|
|
||||||
const openModal = useCallback(() => {
|
const openModal = useCallback(() => {
|
||||||
if (!ref.current) return;
|
if (!ref.current) return;
|
||||||
ref.current.showModal();
|
ref.current.show();
|
||||||
setOpen(true);
|
setOpen(true);
|
||||||
}, []);
|
}, []);
|
||||||
|
|
||||||
@@ -30,7 +30,6 @@ export const useModal = () => {
|
|||||||
open ? closeModal() : openModal();
|
open ? closeModal() : openModal();
|
||||||
}, [open, closeModal, openModal]);
|
}, [open, closeModal, openModal]);
|
||||||
|
|
||||||
// Gunakan useEffect agar event listener tidak didaftarkan berulang kali
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
const dialog = ref.current;
|
const dialog = ref.current;
|
||||||
if (!dialog) return;
|
if (!dialog) return;
|
||||||
|
|||||||
Reference in New Issue
Block a user