Skip to content

Commit 0e077ff

Browse files
committed
Allow the user to hide the "Upload button"
1 parent c334f8e commit 0e077ff

File tree

2 files changed

+8
-9
lines changed

2 files changed

+8
-9
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,7 @@ seqInfoSize | used in results, it changes the size of the text `number o
130130
searchButtonColor | change the color of the `Search` button |
131131
clearButtonColor | change the color of the `Clear` button |
132132
uploadButtonColor | change the color of the `Upload file` button |
133+
hideUploadButton | hide the `Upload file` button. Use "hideUploadButton": "true" to hide the button |
133134
loadMoreButtonColor | change the color of the `Load more` button |
134135

135136
## Developer details

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

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ class SearchForm extends React.Component {
6868
const searchButtonColor = this.props.customStyle && this.props.customStyle.searchButtonColor ? this.props.customStyle.searchButtonColor : "";
6969
const clearButtonColor = this.props.customStyle && this.props.customStyle.clearButtonColor ? this.props.customStyle.clearButtonColor : "#6c757d";
7070
const uploadButtonColor = this.props.customStyle && this.props.customStyle.uploadButtonColor ? this.props.customStyle.uploadButtonColor : "";
71-
const database = this.props.databases ? this.props.databases.map(function(x){ return x.toUpperCase() }) : [];
71+
const hideUploadButton = this.props.customStyle && this.props.customStyle.hideUploadButton ? "none" : "initial";
7272
return (
7373
<div>
7474
<div className="row">
@@ -90,15 +90,13 @@ class SearchForm extends React.Component {
9090
<div className="row">
9191
<input id="clear-button" style={{background: clearButtonColor}} name="clear" type="submit" value="Clear" className="button" onClick={ this.props.onClearSequence } disabled={!this.props.sequence ? "disabled" : ""}/>
9292
</div>
93-
{
94-
database.indexOf("RFAM") === -1 && <div>
95-
<div className="row">
96-
<label htmlFor="file-upload" className="custom-file-upload" style={{background: uploadButtonColor}}>Upload file</label>
97-
<input id="file-upload" type="file" accept=".fasta" onClick={ this.props.onClearSequence } onChange={this.props.onFileUpload} />
98-
</div>
99-
<div className="row"><small>Up to 50 queries</small></div>
93+
<div style={{display: hideUploadButton}}>
94+
<div className="row">
95+
<label htmlFor="file-upload" className="custom-file-upload" style={{background: uploadButtonColor}}>Upload file</label>
96+
<input id="file-upload" type="file" accept=".fasta" onClick={ this.props.onClearSequence } onChange={this.props.onFileUpload} />
10097
</div>
101-
}
98+
<div className="row"><small>Up to 50 queries</small></div>
99+
</div>
102100
</div>
103101
</div>
104102
<div className="row">

0 commit comments

Comments
 (0)