mirror of
https://github.com/bitsocialnet/5chan.git
synced 2026-08-03 07:41:04 +02:00
refactor(ui): rename topbar to boardsbar and add desktop footer for board, thread, and catalog
This commit is contained in:
@@ -14,6 +14,8 @@ interface ReplyModalState {
|
||||
quoteInsertSelectedText: string | null;
|
||||
closeModal: () => void;
|
||||
openReplyModal: (parentCid: string, parentNumber: number | undefined, postCid: string, threadNumber: number | undefined, subplebbitAddress: string) => void;
|
||||
/** Open reply modal with empty textarea, no prefilled quote. Use for "Post a Reply" footer button. */
|
||||
openReplyModalEmpty: (postCid: string, threadNumber: number | undefined, subplebbitAddress: string) => void;
|
||||
}
|
||||
|
||||
const getQuotedSelection = () => {
|
||||
@@ -87,6 +89,23 @@ const useReplyModalStore = create<ReplyModalState>((set, get) => ({
|
||||
scrollY,
|
||||
});
|
||||
},
|
||||
|
||||
openReplyModalEmpty: (postCid, threadNumber, subplebbitAddress) => {
|
||||
useSelectedTextStore.getState().resetSelectedText();
|
||||
const isMobile = window.innerWidth <= 768;
|
||||
const scrollY = isMobile ? window.scrollY : 0;
|
||||
set({
|
||||
activeCid: postCid,
|
||||
parentNumber: null,
|
||||
threadNumber: threadNumber ?? null,
|
||||
threadCid: postCid,
|
||||
showReplyModal: true,
|
||||
subplebbitAddress,
|
||||
scrollY,
|
||||
quoteInsertNumber: null,
|
||||
quoteInsertSelectedText: null,
|
||||
});
|
||||
},
|
||||
}));
|
||||
|
||||
export default useReplyModalStore;
|
||||
|
||||
Reference in New Issue
Block a user