This commit is contained in:
Ren Amamiya
2023-07-08 13:14:05 +07:00
parent 4cf5330ecd
commit 3752a3ab0f
6 changed files with 1062 additions and 215 deletions

View File

@@ -130,7 +130,7 @@ export function Post() {
toggle(false);
};
const renderElement = useCallback((props: any) => {
const renderElement = useCallback((props) => {
switch (props.element.type) {
case 'image':
if (props.element.url) {
@@ -153,7 +153,9 @@ export function Post() {
<Editable
placeholder={refID ? 'Share your thoughts on it' : "What's on your mind?"}
spellCheck="false"
className={`${refID ? '!min-h-42' : '!min-h-[86px]'} markdown`}
className={`${
refID ? '!min-h-42' : '!min-h-[86px]'
} markdown max-h-[500px] overflow-y-auto`}
renderElement={renderElement}
/>
{refID && <MentionNote id={refID} />}

View File

@@ -17,10 +17,6 @@ export const useComposer = create<ComposerState>((set) => ({
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 } });