Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 873caa8

Browse files
committed
fix: replace onMouseDown to onClick
1 parent 737139b commit 873caa8

File tree

3 files changed

+7
-6
lines changed

3 files changed

+7
-6
lines changed

src/component/button.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ export default ({
1515
onMouseDown={onMouseDown}>
1616
<span className="gt-btn-text">{text}</span>
1717
{
18-
isLoading && <span className="gt-btn-loading gt-spinner"></span>
18+
isLoading && <span className="gt-btn-loading gt-spinner" />
1919
}
2020
</button>
2121
)

src/gitalk.jsx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -617,7 +617,7 @@ class GitalkComponent extends Component {
617617
<div className="gt-header" key="header">
618618
{user ?
619619
<Avatar className="gt-header-avatar" src={user.avatar_url} alt={user.login} onError={this.handleImageErrored.bind(this)} />:
620-
<a className="gt-avatar-github" onMouseDown={this.handleLogin}>
620+
<a className="gt-avatar-github" onClick={this.handleLogin}>
621621
<Svg className="gt-ico-github" name="github"/>
622622
</a>
623623
}
@@ -643,18 +643,18 @@ class GitalkComponent extends Component {
643643
{user && <Button
644644
getRef={this.getRef}
645645
className="gt-btn-public"
646-
onMouseDown={this.handleCommentCreate}
646+
onClick={this.handleCommentCreate}
647647
text={this.i18n.t('comment')}
648648
isLoading={isCreating}
649649
/>}
650650

651651
<Button
652652
className="gt-btn-preview"
653-
onMouseDown={this.handleCommentPreview}
653+
onClick={this.handleCommentPreview}
654654
text={isPreview ? this.i18n.t('edit') : this.i18n.t('preview')}
655655
// isLoading={isPreviewing}
656656
/>
657-
{!user && <Button className="gt-btn-login" onMouseDown={this.handleLogin} text={this.i18n.t('login-with-github')} />}
657+
{!user && <Button className="gt-btn-login" onClick={this.handleLogin} text={this.i18n.t('login-with-github')} />}
658658
</div>
659659
</div>
660660
</div>
@@ -722,7 +722,7 @@ class GitalkComponent extends Component {
722722
{user ? <Action className={`gt-action-sortdesc${isDesc ? ' is--active' : ''}`} onClick={this.handleSort('last')} text={this.i18n.t('sort-desc')}/> : null }
723723
{user ?
724724
<Action className="gt-action-logout" onClick={this.handleLogout} text={this.i18n.t('logout')}/> :
725-
<a className="gt-action gt-action-login" onMouseDown={this.handleLogin}>{this.i18n.t('login-with-github')}</a>
725+
<a className="gt-action gt-action-login" onClick={this.handleLogin}>{this.i18n.t('login-with-github')}</a>
726726
}
727727
<div className="gt-copyright">
728728
<a className="gt-link gt-link-project" href="https://github.com/gitalk/gitalk" target="_blank">Gitalk</a>

src/style/index.styl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,7 @@ $gt-size-avatar-mobi := em(32px)
140140
&-github
141141
width: $gt-size-avatar - em(2px)
142142
height: $gt-size-avatar - em(2px)
143+
cursor: pointer
143144
+mobile()
144145
width: $gt-size-avatar-mobi - em(2px)
145146
height: $gt-size-avatar-mobi - em(2px)

0 commit comments

Comments
 (0)