-
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.
start to convert query and save btns to react
- Loading branch information
alanna scott
committed
Jul 7, 2016
1 parent
8135c24
commit 51805b1
Showing
5 changed files
with
56 additions
and
23 deletions.
There are no files selected for viewing
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
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