getUnixTime,
pictshareAvatarThumbnail,
showAvatars,
+ imageThumbnailer,
} from '../utils';
import { i18n } from '../i18next';
import { T } from 'inferno-i18next';
>
<img
class="mx-2 mt-1 float-left img-fluid thumbnail rounded"
- src={post.url}
+ src={imageThumbnailer(post.url)}
/>
</span>
)}
!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;
+ }
+}