add user page

This commit is contained in:
Ren Amamiya
2023-06-28 17:23:36 +07:00
parent 3fe601cfc6
commit ec1ff9ab87
27 changed files with 492 additions and 491 deletions

View File

@@ -2,27 +2,39 @@ import { create } from "zustand";
interface ComposerState {
open: boolean;
reply: null;
reply: { id: string; root: string; pubkey: string };
repost: { id: string; pubkey: string };
toggleModal: (status: boolean) => void;
setReply: (id: string, root: string, pubkey: string) => void;
setRepost: (id: string, pubkey: string) => void;
clearReply: () => void;
clearRepost: () => void;
}
export const useComposer = create<ComposerState>((set) => ({
open: false,
reply: null,
reply: { id: null, root: null, pubkey: null },
repost: { id: null, pubkey: null },
toggleModal: (status: boolean) => {
set({ open: status });
if (!status) {
set({ repost: { id: null, pubkey: null } });
set({ reply: { id: null, root: null, pubkey: null } });
}
},
setReply: (id: string, root: string, pubkey: string) => {
set({ reply: { id: id, root: root, pubkey: pubkey } });
set({ repost: { id: null, pubkey: null } });
set({ open: true });
},
setRepost: (id: string, pubkey: string) => {
set({ repost: { id: id, pubkey: pubkey } });
set({ reply: { id: null, root: null, pubkey: null } });
set({ open: true });
},
clearReply: () => {
set({ reply: { id: null, root: null, pubkey: null } });
},
clearRepost: () => {
set({ repost: { id: null, pubkey: null } });
},