@@ -3,9 +3,9 @@ import computePosition from './compute-position';
33import { escUrl , escHtml } from './sanitizer' ;
44import __ from './i18n' ;
55
6- type AccountData = Record < 'service_type' | 'service_label' | 'service_icon' | 'url' , string > ;
6+ type AccountData = Record < 'service_type' | 'service_label' | 'service_icon' | 'url' | 'is_hidden' , string > ;
77
8- export type VerifiedAccount = Record < 'type' | 'label' | 'icon' | 'url' , string > ;
8+ export type VerifiedAccount = Record < 'type' | 'label' | 'icon' | 'url' | 'isHidden' , string > ;
99
1010export interface ProfileData {
1111 hash : string ;
@@ -248,7 +248,11 @@ export default class Hovercards {
248248 const isEditProfile = ! description && myHash === hash ;
249249 const renderSocialLinks = verifiedAccounts
250250 . slice ( 0 , 3 )
251- . reduce ( ( links , { label, icon, url, type } ) => {
251+ . reduce ( ( links , { label, icon, url, type, isHidden } ) => {
252+ if ( isHidden ) {
253+ return links ;
254+ }
255+
252256 links . push ( `
253257 <a class="gravatar-hovercard__social-link" href="${ escUrl ( url ) } " target="_blank" data-service-name="${ type } ">
254258 <img class="gravatar-hovercard__social-icon" src="${ escUrl ( icon ) } " width="32" height="32" alt="${ escHtml (
@@ -419,6 +423,7 @@ export default class Hovercards {
419423 label : account . service_label ,
420424 icon : account . service_icon ,
421425 url : account . url ,
426+ isHidden : account . is_hidden ,
422427 } ) ) ,
423428 } ) ;
424429
0 commit comments