diff options
author | Dessalines <tyhou13@gmx.com> | 2019-11-21 18:14:59 -0800 |
---|---|---|
committer | Dessalines <tyhou13@gmx.com> | 2019-11-21 18:14:59 -0800 |
commit | bcf994efe9959803edc80359918dd1413604b12a (patch) | |
tree | fc8a493df38d963ebb642dc127e5473731192f5f /ui/src/components/post-form.tsx | |
parent | eebe5913aaf6b53bb958d2a9d72dde8debb4bfb4 (diff) |
Adding archive button for valid post urls.
- Fixes #342
Diffstat (limited to 'ui/src/components/post-form.tsx')
-rw-r--r-- | ui/src/components/post-form.tsx | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/ui/src/components/post-form.tsx b/ui/src/components/post-form.tsx index d3739b47..a3ea8fa3 100644 --- a/ui/src/components/post-form.tsx +++ b/ui/src/components/post-form.tsx @@ -24,6 +24,7 @@ import { validURL, capitalizeFirstLetter, markdownHelpUrl, + archiveUrl, mdToHtml, } from '../utils'; import * as autosize from 'autosize'; @@ -175,6 +176,17 @@ export class PostForm extends Component<PostFormProps, PostFormState> { onChange={linkEvent(this, this.handleImageUpload)} /> </form> + {validURL(this.state.postForm.url) && ( + <a + href={`${archiveUrl}/?run=1&url=${encodeURIComponent( + this.state.postForm.url + )}`} + target="_blank" + class="mr-2 d-inline-block float-right text-muted small font-weight-bold" + > + <T i18nKey="archive_link">#</T> + </a> + )} {this.state.imageLoading && ( <svg class="icon icon-spinner spin"> <use xlinkHref="#icon-spinner"></use> |