|
|
@ -30,6 +30,7 @@ import {
|
|
|
|
showAvatars,
|
|
|
|
showAvatars,
|
|
|
|
pictshareImage,
|
|
|
|
pictshareImage,
|
|
|
|
setupTippy,
|
|
|
|
setupTippy,
|
|
|
|
|
|
|
|
hostname,
|
|
|
|
} from '../utils';
|
|
|
|
} from '../utils';
|
|
|
|
import { i18n } from '../i18next';
|
|
|
|
import { i18n } from '../i18next';
|
|
|
|
|
|
|
|
|
|
|
@ -149,9 +150,9 @@ export class PostListing extends Component<PostListingProps, PostListingState> {
|
|
|
|
let post = this.props.post;
|
|
|
|
let post = this.props.post;
|
|
|
|
return (
|
|
|
|
return (
|
|
|
|
<img
|
|
|
|
<img
|
|
|
|
className={`img-fluid thumbnail rounded ${(post.nsfw ||
|
|
|
|
className={`img-fluid thumbnail rounded ${
|
|
|
|
post.community_nsfw) &&
|
|
|
|
(post.nsfw || post.community_nsfw) && 'img-blur'
|
|
|
|
'img-blur'}`}
|
|
|
|
}`}
|
|
|
|
src={src}
|
|
|
|
src={src}
|
|
|
|
/>
|
|
|
|
/>
|
|
|
|
);
|
|
|
|
);
|
|
|
@ -311,22 +312,21 @@ export class PostListing extends Component<PostListingProps, PostListingState> {
|
|
|
|
</Link>
|
|
|
|
</Link>
|
|
|
|
)}
|
|
|
|
)}
|
|
|
|
</h5>
|
|
|
|
</h5>
|
|
|
|
{post.url &&
|
|
|
|
{post.url && !(hostname(post.url) == window.location.hostname) && (
|
|
|
|
!(new URL(post.url).hostname == window.location.hostname) && (
|
|
|
|
<small class="d-inline-block">
|
|
|
|
<small class="d-inline-block">
|
|
|
|
<a
|
|
|
|
<a
|
|
|
|
className="ml-2 text-muted font-italic"
|
|
|
|
className="ml-2 text-muted font-italic"
|
|
|
|
href={post.url}
|
|
|
|
href={post.url}
|
|
|
|
target="_blank"
|
|
|
|
target="_blank"
|
|
|
|
title={post.url}
|
|
|
|
title={post.url}
|
|
|
|
>
|
|
|
|
>
|
|
|
|
{hostname(post.url)}
|
|
|
|
{new URL(post.url).hostname}
|
|
|
|
<svg class="ml-1 icon icon-inline">
|
|
|
|
<svg class="ml-1 icon icon-inline">
|
|
|
|
<use xlinkHref="#icon-external-link"></use>
|
|
|
|
<use xlinkHref="#icon-external-link"></use>
|
|
|
|
</svg>
|
|
|
|
</svg>
|
|
|
|
</a>
|
|
|
|
</a>
|
|
|
|
</small>
|
|
|
|
</small>
|
|
|
|
)}
|
|
|
|
)}
|
|
|
|
|
|
|
|
{(isImage(post.url) || this.props.post.thumbnail_url) && (
|
|
|
|
{(isImage(post.url) || this.props.post.thumbnail_url) && (
|
|
|
|
<>
|
|
|
|
<>
|
|
|
|
{!this.state.imageExpanded ? (
|
|
|
|
{!this.state.imageExpanded ? (
|
|
|
@ -447,9 +447,15 @@ export class PostListing extends Component<PostListingProps, PostListingState> {
|
|
|
|
{this.props.showCommunity && (
|
|
|
|
{this.props.showCommunity && (
|
|
|
|
<span>
|
|
|
|
<span>
|
|
|
|
<span> {i18n.t('to')} </span>
|
|
|
|
<span> {i18n.t('to')} </span>
|
|
|
|
<Link to={`/c/${post.community_name}`}>
|
|
|
|
{post.local ? (
|
|
|
|
{post.community_name}
|
|
|
|
<Link to={`/c/${post.community_name}`}>
|
|
|
|
</Link>
|
|
|
|
{post.community_name}
|
|
|
|
|
|
|
|
</Link>
|
|
|
|
|
|
|
|
) : (
|
|
|
|
|
|
|
|
<a href={post.community_actor_id} target="_blank">
|
|
|
|
|
|
|
|
{hostname(post.ap_id)}/{post.community_name}
|
|
|
|
|
|
|
|
</a>
|
|
|
|
|
|
|
|
)}
|
|
|
|
</span>
|
|
|
|
</span>
|
|
|
|
)}
|
|
|
|
)}
|
|
|
|
</li>
|
|
|
|
</li>
|
|
|
@ -531,8 +537,9 @@ export class PostListing extends Component<PostListingProps, PostListingState> {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
>
|
|
|
|
>
|
|
|
|
<svg
|
|
|
|
<svg
|
|
|
|
class={`icon icon-inline ${post.saved &&
|
|
|
|
class={`icon icon-inline ${
|
|
|
|
'text-warning'}`}
|
|
|
|
post.saved && 'text-warning'
|
|
|
|
|
|
|
|
}`}
|
|
|
|
>
|
|
|
|
>
|
|
|
|
<use xlinkHref="#icon-star"></use>
|
|
|
|
<use xlinkHref="#icon-star"></use>
|
|
|
|
</svg>
|
|
|
|
</svg>
|
|
|
@ -575,8 +582,9 @@ export class PostListing extends Component<PostListingProps, PostListingState> {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
>
|
|
|
|
>
|
|
|
|
<svg
|
|
|
|
<svg
|
|
|
|
class={`icon icon-inline ${post.deleted &&
|
|
|
|
class={`icon icon-inline ${
|
|
|
|
'text-danger'}`}
|
|
|
|
post.deleted && 'text-danger'
|
|
|
|
|
|
|
|
}`}
|
|
|
|
>
|
|
|
|
>
|
|
|
|
<use xlinkHref="#icon-trash"></use>
|
|
|
|
<use xlinkHref="#icon-trash"></use>
|
|
|
|
</svg>
|
|
|
|
</svg>
|
|
|
@ -607,8 +615,9 @@ export class PostListing extends Component<PostListingProps, PostListingState> {
|
|
|
|
data-tippy-content={i18n.t('view_source')}
|
|
|
|
data-tippy-content={i18n.t('view_source')}
|
|
|
|
>
|
|
|
|
>
|
|
|
|
<svg
|
|
|
|
<svg
|
|
|
|
class={`icon icon-inline ${this.state
|
|
|
|
class={`icon icon-inline ${
|
|
|
|
.viewSource && 'text-success'}`}
|
|
|
|
this.state.viewSource && 'text-success'
|
|
|
|
|
|
|
|
}`}
|
|
|
|
>
|
|
|
|
>
|
|
|
|
<use xlinkHref="#icon-file-text"></use>
|
|
|
|
<use xlinkHref="#icon-file-text"></use>
|
|
|
|
</svg>
|
|
|
|
</svg>
|
|
|
@ -628,8 +637,9 @@ export class PostListing extends Component<PostListingProps, PostListingState> {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
>
|
|
|
|
>
|
|
|
|
<svg
|
|
|
|
<svg
|
|
|
|
class={`icon icon-inline ${post.locked &&
|
|
|
|
class={`icon icon-inline ${
|
|
|
|
'text-danger'}`}
|
|
|
|
post.locked && 'text-danger'
|
|
|
|
|
|
|
|
}`}
|
|
|
|
>
|
|
|
|
>
|
|
|
|
<use xlinkHref="#icon-lock"></use>
|
|
|
|
<use xlinkHref="#icon-lock"></use>
|
|
|
|
</svg>
|
|
|
|
</svg>
|
|
|
@ -646,8 +656,9 @@ export class PostListing extends Component<PostListingProps, PostListingState> {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
>
|
|
|
|
>
|
|
|
|
<svg
|
|
|
|
<svg
|
|
|
|
class={`icon icon-inline ${post.stickied &&
|
|
|
|
class={`icon icon-inline ${
|
|
|
|
'text-success'}`}
|
|
|
|
post.stickied && 'text-success'
|
|
|
|
|
|
|
|
}`}
|
|
|
|
>
|
|
|
|
>
|
|
|
|
<use xlinkHref="#icon-pin"></use>
|
|
|
|
<use xlinkHref="#icon-pin"></use>
|
|
|
|
</svg>
|
|
|
|
</svg>
|
|
|
|