-
Notifications
You must be signed in to change notification settings - Fork 14.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[explore] convert query and save btns to react (#690)
* start to convert query and save btns to react * more explore.jsx to explore/
- Loading branch information
Alanna Scott
authored
Jul 8, 2016
1 parent
8135c24
commit 8020464
Showing
5 changed files
with
103 additions
and
64 deletions.
There are no files selected for viewing
33 changes: 33 additions & 0 deletions
33
caravel/assets/javascripts/explore/components/QueryAndSaveBtns.jsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
import React, { PropTypes } from 'react'; | ||
import classnames from 'classnames'; | ||
|
||
const propTypes = { | ||
canAdd: PropTypes.string.isRequired, | ||
onQuery: PropTypes.func.isRequired, | ||
}; | ||
|
||
export default class QueryAndSaveBtns extends React.Component { | ||
render() { | ||
const saveClasses = classnames('btn btn-default', { | ||
'disabled disabledButton': this.props.canAdd !== 'True', | ||
}); | ||
|
||
return ( | ||
<div className="btn-group query-and-save"> | ||
<button type="button" className="btn btn-primary" onClick={this.props.onQuery}> | ||
<i className="fa fa-bolt"></i>Query | ||
</button> | ||
<button type="button" | ||
className={saveClasses} | ||
onClick={this.props.onSave} | ||
data-target="#save_modal" | ||
data-toggle="modal" | ||
> | ||
<i className="fa fa-plus-circle"></i>Save as | ||
</button> | ||
</div> | ||
); | ||
} | ||
} | ||
|
||
QueryAndSaveBtns.propTypes = propTypes; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters