|
@@ -1,28 +1,10 @@
|
|
|
let ProductCategoryRow = React.createClass({
|
|
|
- name: "ProductCategoryRow",
|
|
|
-
|
|
|
- componentDidMount: function () {
|
|
|
- console.log("Component did mountDM", this.name, "State", this.state, "Props", this.props);
|
|
|
- },
|
|
|
- getInitialState: function () {
|
|
|
- console.log("Get Initial State", this.name);
|
|
|
- return null;
|
|
|
- },
|
|
|
render: function () {
|
|
|
return (<tr><th colSpan="2">{this.props.category}</th></tr>);
|
|
|
}
|
|
|
});
|
|
|
|
|
|
let ProductRow = React.createClass({
|
|
|
- name: "ProductRow",
|
|
|
-
|
|
|
- componentDidMount: function () {
|
|
|
- console.log("Component did mountDM", this.name, "State", this.state, "Props", this.props);
|
|
|
- },
|
|
|
- getInitialState: function () {
|
|
|
- console.log("Get Initial State", this.name);
|
|
|
- return null;
|
|
|
- },
|
|
|
render: function () {
|
|
|
let name = this.props.product.stocked
|
|
|
? this.props.product.name
|
|
@@ -37,14 +19,6 @@ let ProductRow = React.createClass({
|
|
|
});
|
|
|
|
|
|
let ProductTable = React.createClass({
|
|
|
- name: "ProductTable",
|
|
|
- componentDidMount: function () {
|
|
|
- console.log("Component did mountDM", this.name, "State", this.state, "Props", this.props);
|
|
|
- },
|
|
|
- getInitialState: function () {
|
|
|
- console.log("Get Initial State", this.name);
|
|
|
- return null;
|
|
|
- },
|
|
|
render: function () {
|
|
|
let rows = [];
|
|
|
let lastCategory = null;
|
|
@@ -76,15 +50,7 @@ let ProductTable = React.createClass({
|
|
|
});
|
|
|
|
|
|
let SearchBar = React.createClass({
|
|
|
- name: "SearchBar",
|
|
|
- componentDidMount: function () {
|
|
|
- console.log("Component did mountDM", this.name, "State", this.state, "Props", this.props);
|
|
|
- },
|
|
|
- getInitialState: function () {
|
|
|
- console.log("Get Initial State", this.name, "Props", this.props);
|
|
|
- return null;
|
|
|
- },
|
|
|
- handleChange: function (e) {
|
|
|
+ handleChange: function () {
|
|
|
this.props.onUserInput(
|
|
|
this.refs.filterTextInput.value,
|
|
|
this.refs.inStockOnlyInput.checked
|
|
@@ -116,20 +82,14 @@ let SearchBar = React.createClass({
|
|
|
});
|
|
|
|
|
|
let FilterableProductTable = React.createClass({
|
|
|
- name: "FilterableProductTable",
|
|
|
- componentDidMount: function () {
|
|
|
- console.log("Component did mountDM", this.name, this.name, "State", this.state, "Props", this.props);
|
|
|
- },
|
|
|
getInitialState: function () {
|
|
|
let state = {
|
|
|
filterText: "",
|
|
|
inStockOnly: false
|
|
|
};
|
|
|
- console.log("Get Initial State", this.name, state, "Props", this.props);
|
|
|
return state;
|
|
|
},
|
|
|
handleUserInput: function (filterText, inStockOnly) {
|
|
|
- console.log("FPT.OSC", arguments);
|
|
|
this.setState({ filterText: filterText, inStockOnly: inStockOnly });
|
|
|
},
|
|
|
render: function () {
|