feat: Adds support for logo in portal settings page [CW-2585] (#8354)

This commit is contained in:
Nithin David Thomas
2023-11-18 09:28:27 +05:30
committed by GitHub
parent 7380f0e7ce
commit 0af27a2387
9 changed files with 158 additions and 22 deletions

View File

@@ -96,3 +96,15 @@ export const getArticleSearchURL = ({
return `${host}/${portalSlug}/articles?${queryParams.toString()}`;
};
export const hasValidAvatarUrl = avatarUrl => {
try {
const { host: avatarUrlHost } = new URL(avatarUrl);
const isFromGravatar = ['www.gravatar.com', 'gravatar'].includes(
avatarUrlHost
);
return avatarUrl && !isFromGravatar;
} catch (error) {
return false;
}
};