mirror of
				https://github.com/Unleash/unleash.git
				synced 2025-10-27 11:02:16 +01:00 
			
		
		
		
	fix: improve avatar alt text (#892)
* fix: improve avatar alt text * refactor: fix unknown avatar path on localhost
This commit is contained in:
		
							parent
							
								
									89288f2835
								
							
						
					
					
						commit
						8a3db090d5
					
				| Before Width: | Height: | Size: 5.3 KiB After Width: | Height: | Size: 5.3 KiB | 
| @ -104,7 +104,7 @@ const ChangePassword = ({ | |||||||
|                 <div className={commonStyles.flexRow}> |                 <div className={commonStyles.flexRow}> | ||||||
|                     <Avatar |                     <Avatar | ||||||
|                         variant="rounded" |                         variant="rounded" | ||||||
|                         alt={user.name} |                         alt="Gravatar" | ||||||
|                         src={user.imageUrl} |                         src={user.imageUrl} | ||||||
|                         title={`${ |                         title={`${ | ||||||
|                             user.name || user.email || user.username |                             user.name || user.email || user.username | ||||||
|  | |||||||
| @ -53,7 +53,7 @@ const DeleteUser = ({ | |||||||
|                 <div data-loading className={commonStyles.flexRow}> |                 <div data-loading className={commonStyles.flexRow}> | ||||||
|                     <Avatar |                     <Avatar | ||||||
|                         variant="rounded" |                         variant="rounded" | ||||||
|                         alt={user.name} |                         alt="Gravatar" | ||||||
|                         src={user.imageUrl} |                         src={user.imageUrl} | ||||||
|                         title={`${ |                         title={`${ | ||||||
|                             user.name || user.email || user.username |                             user.name || user.email || user.username | ||||||
|  | |||||||
| @ -50,7 +50,7 @@ const UserListItem = ({ | |||||||
|             <TableCell align="center" className={styles.hideXS}> |             <TableCell align="center" className={styles.hideXS}> | ||||||
|                 <Avatar |                 <Avatar | ||||||
|                     data-loading |                     data-loading | ||||||
|                     alt={user.name} |                     alt="Gravatar" | ||||||
|                     src={user.imageUrl} |                     src={user.imageUrl} | ||||||
|                     className={styles.avatar} |                     className={styles.avatar} | ||||||
|                     title={`${user.name || user.email || user.username} (id: ${ |                     title={`${user.name || user.email || user.username} (id: ${ | ||||||
|  | |||||||
| @ -45,7 +45,7 @@ export const ProjectAccessListItem = ({ | |||||||
|     return ( |     return ( | ||||||
|         <ListItem key={user.id} button> |         <ListItem key={user.id} button> | ||||||
|             <ListItemAvatar> |             <ListItemAvatar> | ||||||
|                 <Avatar alt={user.name} src={user.imageUrl} /> |                 <Avatar alt="Gravatar" src={user.imageUrl} /> | ||||||
|             </ListItemAvatar> |             </ListItemAvatar> | ||||||
|             <ListItemText |             <ListItemText | ||||||
|                 id={labelId} |                 id={labelId} | ||||||
|  | |||||||
| @ -8,6 +8,7 @@ import UserProfileContent from './UserProfileContent/UserProfileContent'; | |||||||
| import { IUser } from 'interfaces/user'; | import { IUser } from 'interfaces/user'; | ||||||
| import { ILocationSettings } from 'hooks/useLocationSettings'; | import { ILocationSettings } from 'hooks/useLocationSettings'; | ||||||
| import { HEADER_USER_AVATAR } from 'utils/testIds'; | import { HEADER_USER_AVATAR } from 'utils/testIds'; | ||||||
|  | import unknownUser from 'assets/icons/unknownUser.png'; | ||||||
| 
 | 
 | ||||||
| interface IUserProfileProps { | interface IUserProfileProps { | ||||||
|     profile: IUser; |     profile: IUser; | ||||||
| @ -53,7 +54,7 @@ const UserProfile = ({ | |||||||
|     }, [locationSettings]); |     }, [locationSettings]); | ||||||
| 
 | 
 | ||||||
|     const email = profile ? profile.email : ''; |     const email = profile ? profile.email : ''; | ||||||
|     const imageUrl = email ? profile.imageUrl : 'unknown-user.png'; |     const imageUrl = email ? profile.imageUrl : unknownUser; | ||||||
| 
 | 
 | ||||||
|     return ( |     return ( | ||||||
|         <ClickAwayListener onClickAway={() => setShowProfile(false)}> |         <ClickAwayListener onClickAway={() => setShowProfile(false)}> | ||||||
| @ -69,7 +70,7 @@ const UserProfile = ({ | |||||||
|                     disableRipple |                     disableRipple | ||||||
|                 > |                 > | ||||||
|                     <Avatar |                     <Avatar | ||||||
|                         alt="user image" |                         alt="Your Gravatar" | ||||||
|                         src={imageUrl} |                         src={imageUrl} | ||||||
|                         data-testid={HEADER_USER_AVATAR} |                         data-testid={HEADER_USER_AVATAR} | ||||||
|                     /> |                     /> | ||||||
|  | |||||||
| @ -74,7 +74,7 @@ const UserProfileContent = ({ | |||||||
|                     )} |                     )} | ||||||
|                 > |                 > | ||||||
|                     <Avatar |                     <Avatar | ||||||
|                         alt="user image" |                         alt="Your Gravatar" | ||||||
|                         src={imageUrl} |                         src={imageUrl} | ||||||
|                         className={profileAvatarClasses} |                         className={profileAvatarClasses} | ||||||
|                     /> |                     /> | ||||||
|  | |||||||
		Loading…
	
		Reference in New Issue
	
	Block a user