0
0
Fork 0

Add a confirmation modal: (#2279)

- Deleting a toot
- Muting, blocking someone
- Clearing notifications

Remove source map generation from development environment, as it is a huge
performance sink hole with little gains
This commit is contained in:
Eugen 2017-04-23 04:39:50 +02:00 committed by GitHub
parent df46864b39
commit 59b1de0bcf
10 changed files with 166 additions and 25 deletions

View file

@ -13,6 +13,7 @@ class Search extends React.PureComponent {
this.handleChange = this.handleChange.bind(this);
this.handleKeyDown = this.handleKeyDown.bind(this);
this.handleFocus = this.handleFocus.bind(this);
this.handleClear = this.handleClear.bind(this);
}
handleChange (e) {
@ -21,7 +22,10 @@ class Search extends React.PureComponent {
handleClear (e) {
e.preventDefault();
this.props.onClear();
if (this.props.value.length > 0 || this.props.submitted) {
this.props.onClear();
}
}
handleKeyDown (e) {
@ -55,9 +59,9 @@ class Search extends React.PureComponent {
onFocus={this.handleFocus}
/>
<div role='button' tabIndex='0' className='search__icon' onClick={hasValue ? this.handleClear : this.noop}>
<div role='button' tabIndex='0' className='search__icon' onClick={this.handleClear}>
<i className={`fa fa-search ${hasValue ? '' : 'active'}`} />
<i aria-label="Clear search" className={`fa fa-times-circle ${hasValue ? 'active' : ''}`} />
<i aria-label={intl.formatMessage(messages.placeholder)} className={`fa fa-times-circle ${hasValue ? 'active' : ''}`} />
</div>
</div>
);