use my button component for removing

This commit is contained in:
Thomas Ruoff
2018-02-03 00:24:42 +01:00
parent 94663c1fb1
commit d5a88c6843
4 changed files with 7 additions and 6 deletions

View File

@@ -2,7 +2,7 @@ header h1 {
margin-left: 12px;
}
button {
.p-button {
margin-top: 12px;
margin-right: 12px;
margin-bottom: 12px;

View File

@@ -25,8 +25,8 @@ class App extends Component {
</div>
<div>
<div>
<Button onClick={this._onGenerate.bind(this)} text="Backe PDF"/>
<Button onClick={this._onClear.bind(this)} text="Alles Löschen"/>
<Button onClick={this._onGenerate.bind(this)}>Backe PDF</Button>
<Button onClick={this._onClear.bind(this)}>Alles Löschen</Button>
</div>
<Preview
pdfUrl={state.pdfUrl}

View File

@@ -2,6 +2,6 @@ import React from 'react';
export default function(props) {
return (
<button onClick={props.onClick}>{props.text}</button>
<button className="p-button" onClick={props.onClick}>{props.children}</button>
);
}

View File

@@ -1,4 +1,5 @@
import React from 'react';
import Button from './Button';
export default function(props) {
const latest = props.latest || [];
@@ -6,9 +7,9 @@ export default function(props) {
const created = new Date(item.created);
return (
<li key={item.id}>
<a href="#" onClick={() => props.onSelect(item)}>{created.toLocaleString()}</a>
<a href="#item-{item.id}" onClick={() => props.onSelect(item)}>{created.toLocaleString()}</a>
<span> </span>
<a href="#" onClick={() => props.onRemove(item)}><small>(Remove)</small></a>
<Button onClick={() => props.onRemove(item)}>Remove</Button>
</li>
);
});