Skip to content

Commit 4adb2be

Browse files
committed
Add a spinner while loading
1 parent d22d68a commit 4adb2be

File tree

1 file changed

+5
-5
lines changed
  • src/containers/SequenceSearch/components/Results

1 file changed

+5
-5
lines changed

src/containers/SequenceSearch/components/Results/index.jsx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ class Results extends React.Component {
103103
this.props.jobId && this.props.rfam && (
104104
<div className="small-12 columns" key={`infernal-div`}>
105105
<h3 style={h3Style}>Rfam classification: { this.props.infernalStatus === "loading" ? <i className="animated infinite flash">...</i> : this.props.infernalEntries && this.props.infernalEntries.length ? <small>{this.props.infernalEntries.length}</small> : <small>0</small> }</h3>
106-
{this.props.infernalStatus === "success" && [
106+
{ this.props.infernalStatus === "loading" ? <i className="animated infinite flash">...</i> : this.props.infernalStatus === "success" && this.props.infernalEntries.length ? [
107107
<table className="responsive-table" key={`infernal-table`}>
108108
<thead>
109109
<tr>
@@ -117,7 +117,7 @@ class Results extends React.Component {
117117
</tr>
118118
</thead>
119119
<tbody>
120-
{ this.props.infernalEntries.length ? this.props.infernalEntries.map((entry, index) => (
120+
{this.props.infernalEntries.map((entry, index) => (
121121
<tr key={`${index}`}>
122122
<td><a href={`https://rfam.org/family/${entry.target_name}`} target="_blank">{entry.description}</a></td>
123123
<td><a href={`https://rfam.org/family/${entry.accession_rfam}`} target="_blank">{entry.accession_rfam}</a></td>
@@ -127,10 +127,10 @@ class Results extends React.Component {
127127
<td>{entry.e_value}</td>
128128
<td>{entry.strand}</td>
129129
</tr>
130-
)) : <tr key={"noResults"}><td colSpan="7" style={{textAlign: 'center'}}>The query sequence did not match any Rfam families.</td></tr> }
130+
))}
131131
</tbody>
132132
</table>
133-
]}
133+
] : <p>The query sequence did not match any <img src={'https://rnacentral.org/static/img/expert-db-logos/rfam.png'} alt="Rfam logo" style={{width: "6%", verticalAlign: "sub"}}/> families.</p>}
134134
</div>
135135
)
136136
}
@@ -161,7 +161,7 @@ class Results extends React.Component {
161161
</div>
162162
</section>
163163
</div>
164-
</div> : this.props.rnacentral ? <div>No results.</div> : <div>The query sequence did not match any {this.props.databases} sequences. You can <a href="#" onClick={this.submitToRnacentral}>try to search against RNAcentral</a>.</div>
164+
</div> : this.props.status === "loading" ? <i className="animated infinite flash">...</i> : this.props.rnacentral ? <div>No results at <img src={'https://rnacentral.org/static/img/logo/rnacentral-logo.png'} alt="RNAcentral logo" style={{width: "2%", verticalAlign: "sub"}}/> RNAcentral.</div> : <div>The query sequence did not match any {this.props.databases} sequences. You can <a href="#" onClick={this.submitToRnacentral}>try to search against RNAcentral</a>.</div>
165165
}
166166
</div>
167167
]

0 commit comments

Comments
 (0)