Skip to content

Commit 11f0bae

Browse files
Lazy-poetyannickwurm
authored andcommitted
refactor to fix codeclimate issue
1 parent f429bd0 commit 11f0bae

File tree

2 files changed

+26
-23
lines changed

2 files changed

+26
-23
lines changed

public/js/sidebar.js

+25-22
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
import { Component } from 'react';
1+
// eslint-disable-next-line no-unused-vars
2+
import { Component, Fragment } from 'react';
23
import _ from 'underscore';
34

45
import downloadFASTA from './download_fasta';
@@ -353,6 +354,7 @@ export default class extends Component {
353354
}
354355

355356
sharingPanelJSX() {
357+
const link_class = 'btn-link cursor-pointer';
356358
return (
357359
<div className="sharing-panel">
358360
<div className="section-header-sidebar">
@@ -361,29 +363,30 @@ export default class extends Component {
361363
</h4>
362364
</div>
363365
<ul className="nav">
364-
{!this.props.cloudSharingEnabled ?
365-
<>
366-
<li>
367-
<a id="copyURL" className="btn-link copy-URL cursor-pointer" data-toggle="tooltip"
368-
onClick={this.copyURL}>
369-
<i className="fa fa-copy"></i> Copy URL to clipboard
370-
</a>
371-
</li>
366+
{
367+
!this.props.cloudSharingEnabled ?
368+
<Fragment>
369+
<li>
370+
<a id="copyURL" className={`${link_class} copy-URL`} data-toggle="tooltip"
371+
onClick={this.copyURL}>
372+
<i className="fa fa-copy"></i> Copy URL to clipboard
373+
</a>
374+
</li>
375+
<li>
376+
<a id="sendEmail" className={`${link_class} email-URL`} data-toggle="tooltip"
377+
title="Send by email" href={asMailtoHref(this.props.data.querydb, this.props.data.program, this.props.data.queries, window.location.href)}
378+
target="_blank" rel="noopener noreferrer">
379+
<i className="fa fa-envelope"></i> Send by email
380+
</a>
381+
</li>
382+
</Fragment> :
372383
<li>
373-
<a id="sendEmail" className="btn-link email-URL cursor-pointer" data-toggle="tooltip"
374-
title="Send by email" href={asMailtoHref(this.props.data.querydb, this.props.data.program, this.props.data.queries, window.location.href)}
375-
target="_blank" rel="noopener noreferrer">
376-
<i className="fa fa-envelope"></i> Send by email
377-
</a>
378-
</li>
379-
</> :
380-
<li>
381-
<button className="btn-link cloud-Post cursor-pointer" data-toggle="tooltip"
382-
title="Upload results to SequenceServer Cloud where it will become accessable
384+
<button id="shareToCloud" className={`${link_class} cloud-Post`} data-toggle="tooltip"
385+
title="Upload results to SequenceServer Cloud where it will become accessable
383386
to everyone who has a link." onClick={this.shareCloudInit}>
384-
<i className="fa fa-cloud"></i> Share to cloud
385-
</button>
386-
</li>
387+
<i className="fa fa-cloud"></i> Share to cloud
388+
</button>
389+
</li>
387390
}
388391
</ul>
389392
{

0 commit comments

Comments
 (0)