feat: profile update

This commit is contained in:
Shusui MOYATANI
2023-05-01 12:14:21 +09:00
parent a78eeb4f56
commit f0113d5f4d
12 changed files with 487 additions and 167 deletions

View File

@@ -1,7 +1,8 @@
import { createSignal, type Signal } from 'solid-js';
import { createSignal } from 'solid-js';
type ModalState =
| { type: 'Profile'; pubkey: string }
| { type: 'ProfileEdit' }
| { type: 'UserTimeline'; pubkey: string }
| { type: 'Closed' };
@@ -11,10 +12,13 @@ const useModalState = () => {
const showProfile = (pubkey: string) => {
setModalState({ type: 'Profile', pubkey });
};
const showProfileEdit = () => {
setModalState({ type: 'ProfileEdit' });
};
const closeModal = () => {
setModalState({ type: 'Closed' });
};
return { modalState, setModalState, showProfile, closeModal };
return { modalState, setModalState, showProfile, showProfileEdit, closeModal };
};
export default useModalState;