-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
- Loading branch information
Showing
12 changed files
with
87 additions
and
26 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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
/* | ||
* This file belongs to Hoist, an application development toolkit | ||
* developed by Extremely Heavy Industries (www.xh.io | [email protected]) | ||
* | ||
* Copyright © 2018 Extremely Heavy Industries Inc. | ||
*/ | ||
|
||
import {Component} from 'react'; | ||
import {PropTypes as PT} from 'prop-types'; | ||
import {elemFactory, HoistComponent, XH} from '@xh/hoist/core'; | ||
import {button} from '@xh/hoist/kit/blueprint'; | ||
import {Icon} from '@xh/hoist/icon'; | ||
|
||
/** | ||
* Convenience Button preconfigured for use as a trigger for the XH feedback dialog | ||
* Accepts props documented below as well as any supported by Blueprint's Button. | ||
* | ||
* Can be provided an onClick handler, otherwise will call XH.showFeedbackDialog. | ||
*/ | ||
@HoistComponent() | ||
export class FeedbackButton extends Component { | ||
|
||
static propTypes = { | ||
icon: PT.element, | ||
title: PT.string, | ||
onClick: PT.func | ||
}; | ||
|
||
render() { | ||
const {icon, onClick, ...rest} = this.props; | ||
return button({ | ||
icon: icon || Icon.comment(), | ||
title: this.title || 'Feedback', | ||
onClick: onClick || this.onFeedbackClick, | ||
...rest | ||
}); | ||
} | ||
|
||
//--------------------------- | ||
// Implementation | ||
//--------------------------- | ||
onFeedbackClick = () => { | ||
XH.showFeedbackDialog(); | ||
} | ||
|
||
} | ||
export const feedbackButton = elemFactory(FeedbackButton); |
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 was deleted.
Oops, something went wrong.
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