]> Untitled Git - lemmy.git/commitdiff
Preview image type post.
authorDessalines <tyhou13@gmx.com>
Sun, 29 Dec 2019 21:56:55 +0000 (16:56 -0500)
committerDessalines <tyhou13@gmx.com>
Sun, 29 Dec 2019 21:56:55 +0000 (16:56 -0500)
- Fixes #383

ui/src/components/post-form.tsx

index 7e60b2b0f9ac3ad763fb8344ea46dd379d8e9e4e..0b4d057634b9e80be048a24ef7f7630ab5b7b67e 100644 (file)
@@ -26,6 +26,7 @@ import {
   archiveUrl,
   mdToHtml,
   debounce,
+  isImage,
 } from '../utils';
 import * as autosize from 'autosize';
 import { i18n } from '../i18next';
@@ -193,6 +194,9 @@ export class PostForm extends Component<PostFormProps, PostFormState> {
                   <use xlinkHref="#icon-spinner"></use>
                 </svg>
               )}
+              {isImage(this.state.postForm.url) && (
+                <img src={this.state.postForm.url} class="img-fluid" />
+              )}
               {this.state.crossPosts.length > 0 && (
                 <>
                   <div class="my-1 text-muted small font-weight-bold">