expandable composer
This commit is contained in:
@@ -1,18 +1,24 @@
|
||||
import { create } from 'zustand';
|
||||
|
||||
interface ComposerState {
|
||||
expand: boolean;
|
||||
open: boolean;
|
||||
reply: { id: string; pubkey: string; root?: string };
|
||||
toggleModal: (status: boolean) => void;
|
||||
toggleModal: () => void;
|
||||
toggleExpand: () => void;
|
||||
setReply: (id: string, pubkey: string, root?: string) => void;
|
||||
clearReply: () => void;
|
||||
}
|
||||
|
||||
export const useComposer = create<ComposerState>((set) => ({
|
||||
expand: false,
|
||||
open: false,
|
||||
reply: { id: null, pubkey: null, root: null },
|
||||
toggleModal: (status: boolean) => {
|
||||
set({ open: status });
|
||||
toggleModal: () => {
|
||||
set((state) => ({ open: !state.open }));
|
||||
},
|
||||
toggleExpand: () => {
|
||||
set((state) => ({ expand: !state.expand }));
|
||||
},
|
||||
setReply: (id: string, pubkey: string, root?: string) => {
|
||||
set({ reply: { id: id, pubkey: pubkey, root: root } });
|
||||
|
||||
Reference in New Issue
Block a user