From 61a5bcaf04c689b666b814294b22d2c1cebcf76f Mon Sep 17 00:00:00 2001 From: Dessalines Date: Fri, 24 Jan 2020 20:55:57 -0500 Subject: [PATCH 1/2] Moving notification to bottom left. Fixes #457 --- ui/src/utils.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/ui/src/utils.ts b/ui/src/utils.ts index 6a0ffdb..7803ee4 100644 --- a/ui/src/utils.ts +++ b/ui/src/utils.ts @@ -382,6 +382,8 @@ export function toast(text: string, background: string = 'success') { Toastify({ text: text, backgroundColor: backgroundColor, + gravity: 'bottom', + position: 'left', }).showToast(); } From 7bbb071b0b4679ede269fca26d9c16873159098a Mon Sep 17 00:00:00 2001 From: Dessalines Date: Fri, 24 Jan 2020 21:53:37 -0500 Subject: [PATCH 2/2] Comment image uploads resize textarea. Fixes #460 --- ui/src/components/comment-form.tsx | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/ui/src/components/comment-form.tsx b/ui/src/components/comment-form.tsx index f4eb118..e4543d6 100644 --- a/ui/src/components/comment-form.tsx +++ b/ui/src/components/comment-form.tsx @@ -225,13 +225,15 @@ export class CommentForm extends Component { .then(res => res.json()) .then(res => { let url = `${window.location.origin}/pictshare/${res.url}`; - let markdown = + let imageMarkdown = res.filetype == 'mp4' ? `[vid](${url}/raw)` : `![](${url})`; let content = i.state.commentForm.content; - content = content ? `${content} ${markdown}` : markdown; + content = content ? `${content}\n${imageMarkdown}` : imageMarkdown; i.state.commentForm.content = content; i.state.imageLoading = false; i.setState(i.state); + var textarea: any = document.getElementById(i.id); + autosize.update(textarea); }) .catch(error => { i.state.imageLoading = false;