Skip to content

Commit

Permalink
Add tooltip to validation icon
Browse files Browse the repository at this point in the history
  • Loading branch information
hotblac committed Aug 5, 2018
1 parent 5dd4fb5 commit b40375f
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 2 deletions.
5 changes: 5 additions & 0 deletions package-lock.json

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

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
"@fortawesome/free-solid-svg-icons": "^5.2.0",
"@fortawesome/react-fontawesome": "^0.1.0",
"bulma": "^0.7.1",
"bulma-tooltip": "^2.0.1",
"enzyme": "^3.3.0",
"enzyme-adapter-react-16": "^1.1.1",
"react": "^16.4.1",
Expand Down
5 changes: 3 additions & 2 deletions src/UserRegistration.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import React, { Component } from 'react';
import 'bulma/css/bulma.css'
import 'bulma-tooltip/dist/css/bulma-tooltip.min.css'
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'
import { faExclamationCircle } from '@fortawesome/free-solid-svg-icons'

Expand Down Expand Up @@ -66,13 +67,13 @@ export class UserRegistration extends Component {
<div className="control has-icons-right">
<input name="confirm" type="password" className={'input' + (this.state.passwordMatchesConfirm ? '' : ' is-danger')} onChange={this.handleInputChange}/>
{!this.state.passwordMatchesConfirm &&
<span className="icon is-small is-right">
<span className="icon is-right tooltip" style={{pointerEvents: 'inherit'}} data-tooltip="Confirmation does not match password">
<FontAwesomeIcon icon={faExclamationCircle}/>
</span>
}
</div>
</div>
<button className="button is-primary" onClick={this.handleSubmit} disabled={!this.submitEnabled()}>Submit</button>
<button className="button is-primary" onClick={this.handleSubmit} disabled={!this.submitEnabled()} >Submit</button>
</div>
);
}
Expand Down

0 comments on commit b40375f

Please sign in to comment.