mirror of
https://github.com/muerwre/vault-frontend.git
synced 2025-04-25 12:56:41 +07:00
removed PhotoSwipeStore
This commit is contained in:
parent
224c27b6f4
commit
82308d2a91
15 changed files with 90 additions and 84 deletions
|
@ -1,11 +1,14 @@
|
|||
import { useCallback } from 'react';
|
||||
import { useModal } from '~/hooks/modal/useModal';
|
||||
import { DialogContentProps, useModal } from '~/hooks/modal/useModal';
|
||||
import { Dialog } from '~/constants/modal';
|
||||
|
||||
export const useShowModal = (dialog: Dialog) => {
|
||||
export const useShowModal = <T extends Dialog>(dialog: T) => {
|
||||
const modal = useModal();
|
||||
|
||||
return useCallback(() => {
|
||||
modal.showModal(dialog);
|
||||
}, [dialog, modal]);
|
||||
return useCallback(
|
||||
(props: DialogContentProps[T]) => {
|
||||
modal.showModal(dialog, props);
|
||||
},
|
||||
[dialog, modal]
|
||||
);
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue