mirror of
https://github.com/storytold/artcraft.git
synced 2026-11-04 09:28:11 +00:00
gravatar hash on w2l templates
This commit is contained in:
1 parent
5267857c27
commit
6faaf145ca
2 files changed
+20
-2
No files matched your search
@@ -11,6 +11,7 @@ export interface W2lTemplate {
|
||||
creator_user_token: string,
|
||||
creator_username: string,
|
||||
creator_display_name: string,
|
||||
creator_gravatar_hash: string,
|
||||
updatable_slug: string,
|
||||
title: string,
|
||||
description_markdown: string,
|
||||
|
||||
@@ -14,6 +14,7 @@ import { HiddenIconFc } from '../../_icons/HiddenIcon';
|
||||
import { FrontendUrlConfig } from '../../../../common/FrontendUrlConfig';
|
||||
import { GetW2lTemplate, W2lTemplate } from '../../../api/w2l/GetW2lTemplate';
|
||||
import { GetW2lTemplateUseCount } from '../../../api/w2l/GetW2lTemplateUseCount';
|
||||
import { GravatarFc } from '../../_common/GravatarFc';
|
||||
|
||||
interface EnqueueJobResponsePayload {
|
||||
success: boolean,
|
||||
@@ -117,7 +118,6 @@ function W2lTemplateViewFc(props: Props) {
|
||||
return false;
|
||||
};
|
||||
|
||||
let creatorLink=`/profile/${w2lTemplate?.creator_username}`;
|
||||
let object : string|undefined = undefined;
|
||||
|
||||
if (w2lTemplate?.maybe_image_object_name !== undefined && w2lTemplate?.maybe_image_object_name !== null) {
|
||||
@@ -184,6 +184,23 @@ function W2lTemplateViewFc(props: Props) {
|
||||
);
|
||||
}
|
||||
|
||||
let creatorLink = <span />;
|
||||
|
||||
if (!!w2lTemplate?.creator_display_name) {
|
||||
const creatorUrl = FrontendUrlConfig.userProfilePage(w2lTemplate?.creator_username);
|
||||
creatorLink = (
|
||||
<span>
|
||||
<GravatarFc
|
||||
size={15}
|
||||
username={w2lTemplate.creator_display_name || ""}
|
||||
email_hash={w2lTemplate.creator_gravatar_hash || ""}
|
||||
/>
|
||||
|
||||
<Link to={creatorUrl}>{w2lTemplate.creator_display_name}</Link>
|
||||
</span>
|
||||
);
|
||||
}
|
||||
|
||||
let humanUseCount : string | number = 'Fetching...';
|
||||
|
||||
if (w2lTemplateUseCount !== undefined && w2lTemplateUseCount !== null) {
|
||||
@@ -338,7 +355,7 @@ function W2lTemplateViewFc(props: Props) {
|
||||
<tr>
|
||||
<th>Creator</th>
|
||||
<td>
|
||||
<Link to={creatorLink}>{w2lTemplate?.creator_display_name}</Link>
|
||||
{creatorLink}
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
|
||||
Reference in new issue
Block a user