redux-devtools/extension/examples/router/components/Header.js
Nathan Bierema 6782f4ae41
chore(extension): add extension (#658)
* Move extension

* prettier
2020-10-26 08:18:23 -04:00

31 lines
628 B
JavaScript

import React, { PropTypes, Component } from 'react';
import TodoTextInput from './TodoTextInput';
class Header extends Component {
handleSave(text) {
if (text.length !== 0) {
this.props.addTodo(text);
}
}
render() {
const { path } = this.props;
return (
<header className="header">
<h1 style={{ fontSize: 80 }}>{path}</h1>
<TodoTextInput
newTodo
onSave={this.handleSave.bind(this)}
placeholder="What needs to be done?"
/>
</header>
);
}
}
Header.propTypes = {
addTodo: PropTypes.func.isRequired,
};
export default Header;