feat: npub permalink

This commit is contained in:
Shusui MOYATANI
2023-07-09 14:43:36 +09:00
parent dca108084a
commit 0189016a8b
10 changed files with 190 additions and 118 deletions

View File

@@ -1,6 +1,7 @@
import { createSignal } from 'solid-js';
type ModalState =
| { type: 'Login' }
| { type: 'Profile'; pubkey: string }
| { type: 'ProfileEdit' }
| { type: 'UserTimeline'; pubkey: string }
@@ -11,6 +12,9 @@ type ModalState =
const [modalState, setModalState] = createSignal<ModalState>({ type: 'Closed' });
const useModalState = () => {
const showLogin = () => {
setModalState({ type: 'Login' });
};
const showProfile = (pubkey: string) => {
setModalState({ type: 'Profile', pubkey });
};
@@ -29,6 +33,7 @@ const useModalState = () => {
return {
modalState,
setModalState,
showLogin,
showProfile,
showProfileEdit,
showAddColumn,