Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reader: Use wpcom_login instead of login when linking to user profile #98911

Merged
merged 1 commit into from
Jan 28, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions client/blocks/reader-author-link/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ export interface ReaderLinkAuthor {
URL?: string;
name?: string;
login?: string;
wpcom_login?: string;
}

/**
Expand All @@ -42,8 +43,8 @@ export default function ReaderAuthorLink( props: ReaderAuthorLinkProps ) {
};

const authorLinkUrl =
isUserProfileEnabled() && author.login
? getUserProfileUrl( author.login )
isUserProfileEnabled() && author.wpcom_login
? getUserProfileUrl( author.wpcom_login )
: props.siteUrl ?? author.URL;

const authorName = author.name;
Expand Down
3 changes: 2 additions & 1 deletion client/blocks/reader-avatar/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ export type ReaderAvatarAuthor = {
display_name?: string;
name?: string;
login?: string;
wpcom_login?: string;
};

type ReaderAvatarProps = {
Expand Down Expand Up @@ -122,7 +123,7 @@ export default function ReaderAvatar( {
<SiteIcon key="site-icon" size={ siteIconSize } site={ fakeSite } />
);
const avatarUrl =
isUserProfileEnabled() && author?.login ? getUserProfileUrl( author.login ) : null;
isUserProfileEnabled() && author?.wpcom_login ? getUserProfileUrl( author.wpcom_login ) : null;
const authorAvatar = ( hasAvatar || showPlaceholder ) && (
<Gravatar key="author-avatar" user={ author } size={ gravatarSize } />
);
Expand Down
Loading