Skip to content

Commit

Permalink
Merging
Browse files Browse the repository at this point in the history
  • Loading branch information
KKennedyCodes committed Dec 18, 2019
2 parents 05d91bb + 7377883 commit a237e89
Show file tree
Hide file tree
Showing 29 changed files with 908 additions and 22 deletions.
212 changes: 212 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
"version": "0.1.0",
"private": true,
"dependencies": {
"@testing-library/jest-dom": "^4.2.4",
"@testing-library/react": "^9.4.0",
"axios": "^0.19.0",
"bootstrap": "^4.4.1",
"react": "^16.8.6",
Expand Down
12 changes: 12 additions & 0 deletions src/components/Customer.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import React, { Component } from 'react';
import PropTypes from 'prop-types';

const Customer = ({ id, name, address, city, state, postalCode, phone, findCustomer }) => {

Expand All @@ -16,4 +17,15 @@ const Customer = ({ id, name, address, city, state, postalCode, phone, findCusto
)
}

Customer.propTypes = {
findCustomer: PropTypes.func.isRequired,
id: PropTypes.number.isRequired,
name: PropTypes.string.isRequired,
address: PropTypes.string,
city: PropTypes.string,
state: PropTypes.string,
postalCode: PropTypes.string,
phone: PropTypes.string,
}

export default Customer;
8 changes: 7 additions & 1 deletion src/components/CustomerList.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import React, { Component } from 'react';
import Customer from './Customer.js';
import axios from 'axios';
import PropTypes from 'prop-types';

class CustomerList extends React.Component {
constructor(props) {
Expand All @@ -19,10 +20,11 @@ class CustomerList extends React.Component {
});
})
.catch((error) => {
console.log('error');
console.log(error.message);
});
}


findCustomer = (customerId) => {
const selectedCustomer = this.state.customers.find((customer) => {
return customer.id === customerId;
Expand Down Expand Up @@ -58,4 +60,8 @@ class CustomerList extends React.Component {
}
}

CustomerList.propTypes = {
selectCustomer: PropTypes.func.isRequired
}

export default CustomerList;
Loading

0 comments on commit a237e89

Please sign in to comment.