Skip to content

Commit

Permalink
fix: format username in component
Browse files Browse the repository at this point in the history
  • Loading branch information
MasterHiei authored and booxood committed Jul 13, 2019
1 parent ed28542 commit d57911a
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/component/avatar.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@ import React from 'react'

export default ({ src, className, alt }) => (
<div className={`gt-avatar ${className}`}>
<img src={src} alt={alt}/>
<img src={src} alt={`@${alt}`}/>
</div>
)
2 changes: 1 addition & 1 deletion src/component/avatar.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ describe('Avatar', function () {
const alt = 'alt'
expect(shallow(<Avatar alt={alt} />)
.find('img').prop('alt')
).toEqual(alt)
).toEqual(`@${alt}`)
})
})

2 changes: 1 addition & 1 deletion src/component/comment.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ export default class Comment extends Component {
<Avatar
className="gt-comment-avatar"
src={comment.user && comment.user.avatar_url}
alt={`@${comment.user && comment.user.login}`}
alt={comment.user && comment.user.login}
/>

<div className="gt-comment-content">
Expand Down
2 changes: 1 addition & 1 deletion src/gitalk.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -595,7 +595,7 @@ class GitalkComponent extends Component {
return (
<div className="gt-header" key="header">
{user ?
<Avatar className="gt-header-avatar" src={user.avatar_url} alt={`@${user.login}`} /> :
<Avatar className="gt-header-avatar" src={user.avatar_url} alt={user.login} /> :
<a className="gt-avatar-github" onMouseDown={this.handleLogin}>
<Svg className="gt-ico-github" name="github"/>
</a>
Expand Down

0 comments on commit d57911a

Please sign in to comment.