Skip to content

Commit 33136de

Browse files
committed
Change header text according to the database used
1 parent a121452 commit 33136de

File tree

1 file changed

+22
-1
lines changed
  • src/containers/SequenceSearch/components/SearchForm

1 file changed

+22
-1
lines changed

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

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,34 @@ import {store} from "app.jsx";
66

77

88
class SearchForm extends React.Component {
9+
showDatabase(){
10+
const databases = this.props.databases;
11+
if (databases.length > 1) {
12+
return (
13+
<div>
14+
<h1>Search an RNA sequence in&nbsp;
15+
{
16+
databases.map(function(item, index) {
17+
return <span key={`${index}`}>{ (index ? ', ' : '') + item }</span>;
18+
})
19+
}
20+
</h1>
21+
</div>
22+
)
23+
} else if (databases.length === 0) {
24+
return <h1>Search an RNA sequence in RNA databases</h1>
25+
} else {
26+
return <h1>Search an RNA sequence in {databases}</h1>
27+
}
28+
}
29+
930
render() {
1031
return (
1132
<div className="row">
1233
<div className="col-lg-12">
1334
<div className="hpanel">
1435
<div className="panel-heading">
15-
<h1>Search an RNA sequence in RNA databases</h1>
36+
{this.showDatabase()}
1637
</div>
1738
<div className="panel-body">
1839
<form onSubmit={(e) => this.onSubmit(e)}>

0 commit comments

Comments
 (0)