This commit is contained in:
Shusui MOYATANI
2023-03-22 02:36:04 +09:00
parent db289c5276
commit 4e165bc879
21 changed files with 463 additions and 112 deletions

View File

@@ -0,0 +1,20 @@
import { createSignal, type Signal } from 'solid-js';
type ModalState =
| { type: 'Profile'; pubkey: string }
| { type: 'UserTimeline'; pubkey: string }
| { type: 'Closed' };
const [modalState, setModalState] = createSignal<ModalState>({ type: 'Closed' });
const useModalState = () => {
const showProfile = (pubkey: string) => {
setModalState({ type: 'Profile', pubkey });
};
const closeModal = () => {
setModalState({ type: 'Closed' });
};
return { modalState, setModalState, showProfile, closeModal };
};
export default useModalState;