delete button

This commit is contained in:
Shin'ya Ueoka 2017-11-25 13:58:25 +09:00
parent 2641183a5b
commit bbad1c6c6a
4 changed files with 27 additions and 15 deletions

View file

@ -1,5 +1,6 @@
import { h, Component } from 'preact';
import './search-engine-form.scss'; import './search-engine-form.scss';
import { h, Component } from 'preact';
import DeleteButton from '../ui/delete-button';
class SearchEngineForm extends Component { class SearchEngineForm extends Component {
@ -33,8 +34,7 @@ class SearchEngineForm extends Component {
<input data-index={index} type='radio' name='default' <input data-index={index} type='radio' name='default'
checked={defaultEngine === engine[0]} checked={defaultEngine === engine[0]}
onChange={this.bindValue.bind(this)} /> onChange={this.bindValue.bind(this)} />
<input data-index={index} type='button' name='delete' <DeleteButton data-index={index} name='delete'
value='&#x2716;'
onClick={this.bindValue.bind(this)} /> onClick={this.bindValue.bind(this)} />
</div> </div>
</div>; </div>;

View file

@ -22,17 +22,5 @@
&-row { &-row {
@include row-base; @include row-base;
.column-option input[type='button'] {
border: none;
padding: 4;
display: inline;
background: none;
color: red;
&:hover {
color: darkred;
}
}
} }
} }

View file

@ -0,0 +1,12 @@
import './delete-button.scss';
import { h, Component } from 'preact';
class DeleteButton extends Component {
render() {
return <input
className='ui-delete-button' type='button' value='&#x2716;'
{...this.props} />;
}
}
export default DeleteButton;

View file

@ -0,0 +1,12 @@
.ui-delete-button {
border: none;
padding: 4;
display: inline;
background: none;
color: red;
&:hover {
color: darkred;
}
}