diff --git a/ui/src/components/post-listing.tsx b/ui/src/components/post-listing.tsx index 8b4c1cb..e5e71b6 100644 --- a/ui/src/components/post-listing.tsx +++ b/ui/src/components/post-listing.tsx @@ -27,6 +27,7 @@ import { getUnixTime, pictshareAvatarThumbnail, showAvatars, + imageThumbnailer, } from '../utils'; import { i18n } from '../i18next'; import { T } from 'inferno-i18next'; @@ -137,7 +138,7 @@ export class PostListing extends Component { > )} diff --git a/ui/src/utils.ts b/ui/src/utils.ts index b9da6cb..a45abdc 100644 --- a/ui/src/utils.ts +++ b/ui/src/utils.ts @@ -352,3 +352,14 @@ export function showAvatars(): boolean { !UserService.Instance.user ); } + +/// Converts to image thumbnail (only supports pictshare currently) +export function imageThumbnailer(url: string): string { + let split = url.split('pictshare'); + if (split.length > 1) { + let out = `${split[0]}pictshare/140x140${split[1]}`; + return out; + } else { + return url; + } +}