mirror of
https://github.com/LemmyNet/lemmy-ui.git
synced 2024-11-26 22:31:13 +00:00
Update post-form.tsx
This commit is contained in:
parent
2472bc251d
commit
25bfa84134
1 changed files with 25 additions and 3 deletions
|
@ -20,7 +20,7 @@ import { i18n } from "../../i18next";
|
||||||
import { PostFormParams } from "../../interfaces";
|
import { PostFormParams } from "../../interfaces";
|
||||||
import { UserService, WebSocketService } from "../../services";
|
import { UserService, WebSocketService } from "../../services";
|
||||||
import {
|
import {
|
||||||
archiveUrl,
|
archiveTodayUrl,
|
||||||
authField,
|
authField,
|
||||||
capitalizeFirstLetter,
|
capitalizeFirstLetter,
|
||||||
choicesConfig,
|
choicesConfig,
|
||||||
|
@ -29,6 +29,7 @@ import {
|
||||||
debounce,
|
debounce,
|
||||||
fetchCommunities,
|
fetchCommunities,
|
||||||
getSiteMetadata,
|
getSiteMetadata,
|
||||||
|
ghostArchiveUrl,
|
||||||
isBrowser,
|
isBrowser,
|
||||||
isImage,
|
isImage,
|
||||||
pictrsDeleteToast,
|
pictrsDeleteToast,
|
||||||
|
@ -36,6 +37,7 @@ import {
|
||||||
toast,
|
toast,
|
||||||
validTitle,
|
validTitle,
|
||||||
validURL,
|
validURL,
|
||||||
|
webArchiveUrl,
|
||||||
wsClient,
|
wsClient,
|
||||||
wsJsonToRes,
|
wsJsonToRes,
|
||||||
wsSubscribe,
|
wsSubscribe,
|
||||||
|
@ -211,15 +213,35 @@ export class PostForm extends Component<PostFormProps, PostFormState> {
|
||||||
/>
|
/>
|
||||||
</form>
|
</form>
|
||||||
{this.state.postForm.url && validURL(this.state.postForm.url) && (
|
{this.state.postForm.url && validURL(this.state.postForm.url) && (
|
||||||
|
<div>
|
||||||
<a
|
<a
|
||||||
href={`${archiveUrl}/?run=1&url=${encodeURIComponent(
|
href={`${webArchiveUrl}/save/${encodeURIComponent(
|
||||||
this.state.postForm.url
|
this.state.postForm.url
|
||||||
)}`}
|
)}`}
|
||||||
class="mr-2 d-inline-block float-right text-muted small font-weight-bold"
|
class="mr-2 d-inline-block float-right text-muted small font-weight-bold"
|
||||||
rel="noopener"
|
rel="noopener"
|
||||||
>
|
>
|
||||||
{i18n.t("archive_link")}
|
archive.org {i18n.t("archive_link")}
|
||||||
</a>
|
</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 />}
|
{this.state.imageLoading && <Spinner />}
|
||||||
{isImage(this.state.postForm.url) && (
|
{isImage(this.state.postForm.url) && (
|
||||||
|
|
Loading…
Reference in a new issue