You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We use blog for the link's href in the PostAvatar:
constPostAvatar=({ name, img, blog =''}: AvatarProps)=>{constclasses=useStyles();if(img){return<AvatarclassName={classes.avatar}src={img}/>;}if(name.length>0){constinitials=name.split(' ')// splitName represents the current value, i represents its index, and arr represent the whole splitted name-word array// if the index is 0, means it's the first word in the name// if the index+1 equals to the array length, it means the current value is the last word in the name// anything rather than first word or last word will not be included in initials.map((splitName,i,arr)=>i===0||i+1===arr.length ? splitName[0].toUpperCase() : null).join('');return(<ahref={blog}className={classes.link}><AvatarclassName={classes.avatar}><pclassName={classes.text}>{initials}</p></Avatar></a>);}return<AvatarclassName={classes.avatar}/>;};
In the new signup code we're re-using this component to show the GitHub avatar in the signup form, and it's odd to name the URL we pass blog (it isn't a blog).
Let's rename blog to the more generic url, and update all callers to do the same.
Also, blog is an optional prop, but we always use it. We should be returning an <Avatar> without a parent <a> if we don't get passed a url.
The text was updated successfully, but these errors were encountered:
We use
blog
for the link'shref
in thePostAvatar
:In the new signup code we're re-using this component to show the GitHub avatar in the signup form, and it's odd to name the URL we pass
blog
(it isn't a blog).Let's rename
blog
to the more genericurl
, and update all callers to do the same.Also,
blog
is an optional prop, but we always use it. We should be returning an<Avatar>
without a parent<a>
if we don't get passed aurl
.The text was updated successfully, but these errors were encountered: