Skip to content

Commit

Permalink
Merge pull request #18 from pemberton-rank/feedback-ui-dismiss-behavior
Browse files Browse the repository at this point in the history
feedbackform support plain dismiss action
  • Loading branch information
Jamie Schembri committed Aug 26, 2019
2 parents 162779f + 453d6aa commit 7da972c
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 7 deletions.
13 changes: 10 additions & 3 deletions lib/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion lib/index.js.map

Large diffs are not rendered by default.

15 changes: 12 additions & 3 deletions src/components/forms/FeedbackForm.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ const DISMISSED_VAL = 'dismissed'
export default class FeedbackForm extends React.Component {
static propTypes = {
question: React.PropTypes.string.isRequired,
helpLink: React.PropTypes.string.isRequired,
helpLink: React.PropTypes.string,
buttonTextYes: React.PropTypes.string,
buttonTextNo: React.PropTypes.string,
repeating: React.PropTypes.bool,
Expand Down Expand Up @@ -57,13 +57,22 @@ export default class FeedbackForm extends React.Component {
className="customer-feedback__form__btn--yes"
onTouchTap={() => this.handleClick('yes')}
/>
<a target="_blank" href={helpLink} onClick={() => this.handleClick('no')}>
{helpLink ? (
<a target="_blank" href={helpLink} onClick={() => this.handleClick('no')}>
<Button
label={buttonTextNo}
buttonType="secondary"
className="customer-feedback__form__btn--no"
/>
</a>
) : (
<Button
label={buttonTextNo}
buttonType="secondary"
className="customer-feedback__form__btn--no"
onClick={() => this.handleClick('no')}
/>
</a>
)}
</div>
)
}
Expand Down

0 comments on commit 7da972c

Please sign in to comment.