]> Untitled Git - lemmy-ui.git/commitdiff
Update post-form.tsx
authormahanstreamer <84676642+mahanstreamer@users.noreply.github.com>
Fri, 29 Oct 2021 01:58:49 +0000 (21:58 -0400)
committerGitHub <noreply@github.com>
Fri, 29 Oct 2021 01:58:49 +0000 (21:58 -0400)
src/shared/components/post/post-form.tsx

index 40e8e7bc79a07e3d417c8b613c1dfacb9fc88ccb..133af94521032d11db98e107af9e0a88ad90a452 100644 (file)
@@ -20,7 +20,7 @@ import { i18n } from "../../i18next";
 import { PostFormParams } from "../../interfaces";
 import { UserService, WebSocketService } from "../../services";
 import {
-  archiveUrl,
+  archiveTodayUrl,
   authField,
   capitalizeFirstLetter,
   choicesConfig,
@@ -29,6 +29,7 @@ import {
   debounce,
   fetchCommunities,
   getSiteMetadata,
+  ghostArchiveUrl,
   isBrowser,
   isImage,
   pictrsDeleteToast,
@@ -36,6 +37,7 @@ import {
   toast,
   validTitle,
   validURL,
+  webArchiveUrl,
   wsClient,
   wsJsonToRes,
   wsSubscribe,
@@ -211,15 +213,35 @@ export class PostForm extends Component<PostFormProps, PostFormState> {
                 />
               </form>
               {this.state.postForm.url && validURL(this.state.postForm.url) && (
+                <div>
                 <a
-                  href={`${archiveUrl}/?run=1&url=${encodeURIComponent(
+                  href={`${webArchiveUrl}/save/${encodeURIComponent(
                     this.state.postForm.url
                   )}`}
                   class="mr-2 d-inline-block float-right text-muted small font-weight-bold"
                   rel="noopener"
                 >
-                  {i18n.t("archive_link")}
+                  archive.org {i18n.t("archive_link")}
                 </a>
+                <a
+                  href={`${ghostArchiveUrl}/search?term=${encodeURIComponent(
+                    this.state.postForm.url
+                  )}`}
+                  class="mr-2 d-inline-block float-right text-muted small font-weight-bold"
+                  rel="noopener"
+                >
+                  ghostarchive.org {i18n.t("archive_link")}
+                </a>
+                <a
+                  href={`${archiveTodayUrl}/?run=1&url=${encodeURIComponent(
+                    this.state.postForm.url
+                  )}`}
+                  class="mr-2 d-inline-block float-right text-muted small font-weight-bold"
+                  rel="noopener"
+                >
+                 archive.today {i18n.t("archive_link")}
+                </a>
+                </div>
               )}
               {this.state.imageLoading && <Spinner />}
               {isImage(this.state.postForm.url) && (