REDROOM
PHP 8.2.30
Path:
Logout
Edit File
Size: 2.19 KB
Close
/proc/thread-self/root/home/byroehnu/.trash/node_modules11/adminjs/lib/frontend/hooks/use-modal.js
Text
Base64
import { useCallback } from 'react'; import { useDispatch } from 'react-redux'; import { hideModal, showModal } from '../store/actions/index.js'; import useTranslation from './use-translation.js'; export const useModal = () => { const dispatch = useDispatch(); const { translateButton, translateLabel, translateMessage } = useTranslation(); const closeModal = useCallback(() => { dispatch(hideModal()); }, []); const openModal = props => { const { modalProps, type, confirmAction, resourceId } = props; let buttons = modalProps.buttons || []; const handleConfirm = () => { closeModal(); if (confirmAction) confirmAction(); }; if (buttons.length) { buttons = buttons.map(button => { button.variant = button.variant || 'default'; if (button.label === 'cancel') { button.onClick = button.onClick || closeModal; } button.label = translateButton(button.label || '', resourceId); return button; }); } if (type === 'confirm') { buttons.push({ label: translateButton('cancel', resourceId), onClick: closeModal }); buttons.push({ label: translateButton('confirm', resourceId), variant: modalProps.variant || 'primary', onClick: handleConfirm }); } if (type === 'alert') { buttons.push({ label: translateButton('ok', resourceId), variant: 'primary', onClick: closeModal }); } const getDefaultTranslationKey = placement => `modal-${placement}`; const data = { modalProps: { ...modalProps, label: translateLabel(modalProps.label ?? getDefaultTranslationKey('label'), resourceId), title: translateMessage(modalProps.title ?? getDefaultTranslationKey('title'), resourceId), subTitle: translateMessage(modalProps.subTitle ?? getDefaultTranslationKey('subTitle'), resourceId), variant: modalProps.variant, buttons, onClose: modalProps.onClose || closeModal, onOverlayClick: modalProps.onOverlayClick || closeModal } }; dispatch(showModal(data)); }; return { openModal, closeModal }; };
Save
Close
Exit & Reset
Text mode: syntax highlighting auto-detects file type.
Directory Contents
Dirs: 6 × Files: 10
Delete Selected
Select All
Select None
Sort:
Name
Size
Modified
Enable drag-to-move
Name
Size
Perms
Modified
Actions
use-action
DIR
-
drwxr-xr-x
2026-02-28 00:31:56
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
use-local-storage
DIR
-
drwxr-xr-x
2026-02-28 00:31:56
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
use-record
DIR
-
drwxr-xr-x
2026-02-28 00:31:56
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
use-records
DIR
-
drwxr-xr-x
2026-02-28 00:31:56
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
use-resource
DIR
-
drwxr-xr-x
2026-02-28 00:31:56
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
use-selected-records
DIR
-
drwxr-xr-x
2026-02-28 00:31:58
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
index.js
563 B
lrw-r--r--
2026-02-28 00:31:44
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
use-current-admin.js
1.19 KB
lrw-r--r--
2026-02-28 00:31:52
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
use-filter-drawer.js
900 B
lrw-r--r--
2026-02-28 00:31:52
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
use-history-listen.js
1.02 KB
lrw-r--r--
2026-02-28 00:31:52
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
use-modal.doc.md
3.07 KB
lrw-r--r--
2026-02-28 00:31:56
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
use-modal.js
2.19 KB
lrw-r--r--
2026-02-28 00:31:52
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
use-navigation-resources.js
2.16 KB
lrw-r--r--
2026-02-28 00:31:52
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
use-notice.js
709 B
lrw-r--r--
2026-02-28 00:31:52
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
use-query-params.js
2.20 KB
lrw-r--r--
2026-02-28 00:31:52
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
use-translation.js
1.34 KB
lrw-r--r--
2026-02-28 00:31:52
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
Zip Selected
If ZipArchive is unavailable, a
.tar
will be created (no compression).