diff --git a/client/dist/bundle.js b/client/dist/bundle.js index 6e5d532..1ee2ae2 100644 --- a/client/dist/bundle.js +++ b/client/dist/bundle.js @@ -130,7 +130,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var reac /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ \"./node_modules/react/index.js\");\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! prop-types */ \"./node_modules/prop-types/index.js\");\n/* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(prop_types__WEBPACK_IMPORTED_MODULE_1__);\n/* harmony import */ var _material_ui_core_styles__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @material-ui/core/styles */ \"./node_modules/@material-ui/core/styles/index.js\");\n/* harmony import */ var _material_ui_core_styles__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_material_ui_core_styles__WEBPACK_IMPORTED_MODULE_2__);\n/* harmony import */ var _material_ui_core_Paper__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @material-ui/core/Paper */ \"./node_modules/@material-ui/core/Paper/index.js\");\n/* harmony import */ var _material_ui_core_Paper__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_material_ui_core_Paper__WEBPACK_IMPORTED_MODULE_3__);\n/* harmony import */ var _material_ui_core_Grid__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @material-ui/core/Grid */ \"./node_modules/@material-ui/core/Grid/index.js\");\n/* harmony import */ var _material_ui_core_Grid__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_material_ui_core_Grid__WEBPACK_IMPORTED_MODULE_4__);\n/* harmony import */ var _LeadInfo_jsx__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./LeadInfo.jsx */ \"./client/src/components/LeadInfo.jsx\");\n/* harmony import */ var _ButtonList_jsx__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./ButtonList.jsx */ \"./client/src/components/ButtonList.jsx\");\n/* harmony import */ var _ContactList_jsx__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./ContactList.jsx */ \"./client/src/components/ContactList.jsx\");\n/* harmony import */ var _SearchView_jsx__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./SearchView.jsx */ \"./client/src/components/SearchView.jsx\");\n/* harmony import */ var react_router__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! react-router */ \"./node_modules/react-router/esm/react-router.js\");\n/* harmony import */ var axios__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! axios */ \"./node_modules/axios/index.js\");\n/* harmony import */ var axios__WEBPACK_IMPORTED_MODULE_10___default = /*#__PURE__*/__webpack_require__.n(axios__WEBPACK_IMPORTED_MODULE_10__);\n/* harmony import */ var _AuthService_js__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./AuthService.js */ \"./client/src/components/AuthService.js\");\nfunction _typeof(obj) { if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }\n\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }\n\nfunction _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === \"object\" || typeof call === \"function\")) { return call; } return _assertThisInitialized(self); }\n\nfunction _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }\n\nfunction _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function\"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }\n\nfunction _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }\n\n\n\n\n\n\n\n\n\n\n\n\n\n\nvar DashBody =\n/*#__PURE__*/\nfunction (_React$Component) {\n _inherits(DashBody, _React$Component);\n\n function DashBody(props) {\n var _this;\n\n _classCallCheck(this, DashBody);\n\n _this = _possibleConstructorReturn(this, _getPrototypeOf(DashBody).call(this, props));\n _this.state = {\n // userId = null,\n selectedView: null,\n uploaded: [],\n purchased: [],\n currentLead: {},\n contact: null,\n searchedContacts: [],\n contactView: null,\n renderContactList: false,\n commentBodyText: '',\n comments: [],\n username: '',\n purchaseState: 'Purchase This Contact',\n purchaseColor: 'white'\n };\n var classes = props.classes;\n DashBody.propTypes = {\n classes: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.object.isRequired\n };\n _this.selectView = _this.selectView.bind(_assertThisInitialized(_this));\n _this.selectContact = _this.selectContact.bind(_assertThisInitialized(_this));\n _this.searchContact = _this.searchContact.bind(_assertThisInitialized(_this));\n _this.uploadedView = _this.uploadedView.bind(_assertThisInitialized(_this));\n _this.purchasedView = _this.purchasedView.bind(_assertThisInitialized(_this));\n _this.uploadContact = _this.uploadContact.bind(_assertThisInitialized(_this));\n _this.contactPurchase = _this.contactPurchase.bind(_assertThisInitialized(_this));\n _this.renderContactList = _this.renderContactList.bind(_assertThisInitialized(_this));\n _this.handleComment = _this.handleComment.bind(_assertThisInitialized(_this));\n _this.commentBody = _this.commentBody.bind(_assertThisInitialized(_this));\n _this.showModal = _this.showModal.bind(_assertThisInitialized(_this));\n return _this;\n }\n\n _createClass(DashBody, [{\n key: \"componentWillMount\",\n value: function componentWillMount() {\n this.props.history.push('/dashboard');\n document.body.style.backgroundImage = 'none';\n this.props.getUserPoints();\n }\n }, {\n key: \"componentWillUnmount\",\n value: function componentWillUnmount() {\n document.body.style.backgroundImage = \"url('./leaddeal.png')\";\n }\n }, {\n key: \"showModal\",\n value: function showModal() {\n console.log('modal');\n }\n }, {\n key: \"selectView\",\n value: function selectView(button) {\n this.setState({\n selectedView: button\n });\n }\n }, {\n key: \"uploadedView\",\n value: function uploadedView() {\n var _this2 = this;\n\n this.props.auth.fetch(\"/api/users/\".concat(this.props.userId, \"/uploaded_contacts\")).then(function (uploadedContacts) {\n console.log(uploadedContacts);\n\n _this2.setState({\n uploaded: uploadedContacts,\n selectedView: 'uploaded'\n });\n })[\"catch\"](function (err) {\n console.log(err);\n });\n }\n }, {\n key: \"purchasedView\",\n value: function purchasedView() {\n var _this3 = this;\n\n this.props.auth.fetch(\"/api/users/\".concat(this.props.userId, \"/purchased_contacts\")).then(function (purchasedContacts) {\n console.log(purchasedContacts);\n\n _this3.setState({\n purchased: purchasedContacts,\n selectedView: 'purchased'\n });\n })[\"catch\"](function (err) {\n console.log(err);\n });\n }\n }, {\n key: \"selectContact\",\n value: function selectContact(contactId, list, view) {\n var _this4 = this;\n\n if (view === 'access') {\n var contact = this.state[list].filter(function (contact) {\n return contact.id === contactId;\n })[0];\n this.props.auth.fetch(\"/api/users/comments/\".concat(this.props.userId, \"/\").concat(contactId)).then(function (comments) {\n var revComments = comments.reverse();\n\n _this4.setState({\n comments: revComments\n });\n })[\"catch\"](function (err) {\n console.log(err);\n });\n this.setState({\n currentLead: contact,\n contactView: 'access'\n });\n } else {\n var _contact = this.state.searchedContacts.filter(function (contact) {\n return contact.id === contactId;\n })[0];\n this.setState({\n currentLead: _contact,\n contactView: 'limited',\n purchaseState: \"Purchase This Contact\",\n purchaseColor: \"white\"\n });\n }\n }\n }, {\n key: \"searchContact\",\n value: function searchContact(query) {\n var _this5 = this;\n\n //console.log(query)\n var options = {\n method: 'POST',\n body: JSON.stringify(query)\n };\n this.props.auth.fetch(\"/api/users/search/\".concat(this.props.userId), options).then(function (contacts) {\n console.log('im inside this contact', contacts);\n\n _this5.setState({\n searchedContacts: contacts,\n selectedView: 'searched'\n });\n })[\"catch\"](function (err) {\n console.log(err);\n });\n }\n }, {\n key: \"uploadContact\",\n value: function uploadContact(contact) {\n var _this6 = this;\n\n console.log(this.props.userId);\n var options = {\n method: 'POST',\n body: JSON.stringify(contact)\n };\n this.props.auth.fetch2(\"/api/users/\".concat(this.props.userId, \"/upload\"), options).then(function (response) {\n _this6.props.getUserPoints();\n\n _this6.setState({\n currentLead: contact,\n contactView: 'access'\n });\n })[\"catch\"](function (err) {\n console.error(err);\n });\n }\n }, {\n key: \"contactPurchase\",\n value: function contactPurchase(event, contactId) {\n var _this7 = this;\n\n console.log(event.target.innerHTML);\n\n if (this.props.points > 0) {\n var options = {\n method: 'POST'\n };\n this.props.auth.fetch(\"/api/users/purchase_contact/\".concat(this.props.userId, \"/\").concat(contactId), options).then(function (result) {\n console.log('i have just purchased this contact', result);\n\n _this7.props.getUserPoints(); // document.getElementById('purclimitedhase-button').innerHTML = 'Contact Purchased';\n // document.getElementById('purchase-button').style.color = 'grey';\n // event.target.innerHTML = 'Contact Purchased';\n\n\n _this7.setState({\n purchaseState: \"Contact Purchased\",\n purchaseColor: 'grey'\n });\n })[\"catch\"](function (err) {\n console.log(err);\n });\n } else {\n alert('You do not have enough points to complete this purchase. Please upload more contacts to obtain more points');\n }\n }\n }, {\n key: \"handleComment\",\n value: function handleComment(event) {\n var _this8 = this;\n\n event.preventDefault();\n var comment = {};\n comment.body = this.state.commentBodyText;\n var options = {\n method: 'POST',\n body: JSON.stringify(comment)\n };\n this.props.auth.fetch(\"/api/users/comments/\".concat(this.props.userId, \"/\").concat(this.state.currentLead.id), options).then(function (comments) {\n var revComments = comments.reverse();\n\n _this8.setState({\n commentBodyText: '',\n comments: revComments\n });\n })[\"catch\"](function (err) {\n console.log(err);\n\n _this8.setState({\n commentBodyText: ''\n });\n });\n }\n }, {\n key: \"commentBody\",\n value: function commentBody(comment) {\n this.setState({\n commentBodyText: comment\n });\n }\n }, {\n key: \"renderContactList\",\n value: function renderContactList() {\n this.setState({\n renderContactList: true\n });\n }\n }, {\n key: \"render\",\n value: function render() {\n if (this.state.renderContactList) {\n return react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"div\", null, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_material_ui_core_Grid__WEBPACK_IMPORTED_MODULE_4___default.a, {\n container: true,\n spacing: 24\n }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_material_ui_core_Grid__WEBPACK_IMPORTED_MODULE_4___default.a, {\n item: true,\n xs: true\n }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"div\", {\n className: \"left-top-display\"\n }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_ButtonList_jsx__WEBPACK_IMPORTED_MODULE_6__[\"default\"], {\n selectView: this.selectView,\n uploadedView: this.uploadedView,\n purchasedView: this.purchasedView,\n renderContactList: this.renderContactList,\n showModal: this.showModal\n })), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"div\", {\n className: \"left-bottom-display\"\n }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_ContactList_jsx__WEBPACK_IMPORTED_MODULE_7__[\"default\"], {\n uploaded: this.state.uploaded,\n purchased: this.state.purchased,\n selectedView: this.state.selectedView,\n selectContact: this.selectContact,\n searchContact: this.searchContact,\n uploadContact: this.uploadContact\n }), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_SearchView_jsx__WEBPACK_IMPORTED_MODULE_8__[\"default\"], {\n searchedContacts: this.state.searchedContacts,\n selectedView: this.state.selectedView,\n selectContact: this.selectContact\n }))), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_material_ui_core_Grid__WEBPACK_IMPORTED_MODULE_4___default.a, {\n item: true,\n xs: 9\n }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"div\", null), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_LeadInfo_jsx__WEBPACK_IMPORTED_MODULE_5__[\"default\"], {\n currentLead: this.state.currentLead,\n contactView: this.state.contactView,\n contactPurchase: this.contactPurchase,\n commentBody: this.commentBody,\n handleComment: this.handleComment,\n comments: this.state.comments,\n commentBodyText: this.state.commentBodyText,\n purchaseState: this.state.purchaseState,\n purchaseColor: this.state.purchaseColor\n }))));\n } else {\n return react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"div\", null, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_material_ui_core_Grid__WEBPACK_IMPORTED_MODULE_4___default.a, {\n container: true,\n spacing: 24\n }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_material_ui_core_Grid__WEBPACK_IMPORTED_MODULE_4___default.a, {\n item: true,\n xs: true\n }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"div\", {\n className: \"left-top-display\"\n }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_ButtonList_jsx__WEBPACK_IMPORTED_MODULE_6__[\"default\"], {\n selectView: this.selectView,\n uploadedView: this.uploadedView,\n purchasedView: this.purchasedView,\n renderContactList: this.renderContactList\n }))), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_material_ui_core_Grid__WEBPACK_IMPORTED_MODULE_4___default.a, {\n item: true,\n xs: 9\n }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"div\", null), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_LeadInfo_jsx__WEBPACK_IMPORTED_MODULE_5__[\"default\"], {\n currentLead: this.state.currentLead,\n contactView: this.state.contactView,\n contactPurchase: this.contactPurchase\n }))));\n }\n }\n }]);\n\n return DashBody;\n}(react__WEBPACK_IMPORTED_MODULE_0___default.a.Component);\n\nvar styles = function styles(theme) {\n return {\n root: {\n flexGrow: 1\n },\n paper: {\n padding: theme.spacing.unit * 2,\n textAlign: 'center',\n color: theme.palette.text.secondary\n }\n };\n};\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (Object(react_router__WEBPACK_IMPORTED_MODULE_9__[\"withRouter\"])(Object(_material_ui_core_styles__WEBPACK_IMPORTED_MODULE_2__[\"withStyles\"])(styles)(DashBody)));\n\n//# sourceURL=webpack:///./client/src/components/DashBody.jsx?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ \"./node_modules/react/index.js\");\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! prop-types */ \"./node_modules/prop-types/index.js\");\n/* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(prop_types__WEBPACK_IMPORTED_MODULE_1__);\n/* harmony import */ var _material_ui_core_styles__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @material-ui/core/styles */ \"./node_modules/@material-ui/core/styles/index.js\");\n/* harmony import */ var _material_ui_core_styles__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_material_ui_core_styles__WEBPACK_IMPORTED_MODULE_2__);\n/* harmony import */ var _material_ui_core_Paper__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @material-ui/core/Paper */ \"./node_modules/@material-ui/core/Paper/index.js\");\n/* harmony import */ var _material_ui_core_Paper__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_material_ui_core_Paper__WEBPACK_IMPORTED_MODULE_3__);\n/* harmony import */ var _material_ui_core_Grid__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @material-ui/core/Grid */ \"./node_modules/@material-ui/core/Grid/index.js\");\n/* harmony import */ var _material_ui_core_Grid__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_material_ui_core_Grid__WEBPACK_IMPORTED_MODULE_4__);\n/* harmony import */ var _LeadInfo_jsx__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./LeadInfo.jsx */ \"./client/src/components/LeadInfo.jsx\");\n/* harmony import */ var _ButtonList_jsx__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./ButtonList.jsx */ \"./client/src/components/ButtonList.jsx\");\n/* harmony import */ var _ContactList_jsx__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./ContactList.jsx */ \"./client/src/components/ContactList.jsx\");\n/* harmony import */ var _SearchView_jsx__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./SearchView.jsx */ \"./client/src/components/SearchView.jsx\");\n/* harmony import */ var react_router__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! react-router */ \"./node_modules/react-router/esm/react-router.js\");\n/* harmony import */ var axios__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! axios */ \"./node_modules/axios/index.js\");\n/* harmony import */ var axios__WEBPACK_IMPORTED_MODULE_10___default = /*#__PURE__*/__webpack_require__.n(axios__WEBPACK_IMPORTED_MODULE_10__);\n/* harmony import */ var _AuthService_js__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./AuthService.js */ \"./client/src/components/AuthService.js\");\nfunction _typeof(obj) { if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }\n\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }\n\nfunction _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === \"object\" || typeof call === \"function\")) { return call; } return _assertThisInitialized(self); }\n\nfunction _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }\n\nfunction _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function\"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }\n\nfunction _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }\n\n\n\n\n\n\n\n\n\n\n\n\n\n\nvar DashBody =\n/*#__PURE__*/\nfunction (_React$Component) {\n _inherits(DashBody, _React$Component);\n\n function DashBody(props) {\n var _this;\n\n _classCallCheck(this, DashBody);\n\n _this = _possibleConstructorReturn(this, _getPrototypeOf(DashBody).call(this, props));\n _this.state = {\n // userId = null,\n selectedView: null,\n uploaded: [],\n purchased: [],\n currentLead: {},\n contact: null,\n searchedContacts: [],\n contactView: null,\n renderContactList: false,\n commentBodyText: '',\n comments: [],\n username: '',\n purchaseState: 'Purchase This Contact',\n purchaseColor: 'white',\n showNotes: true\n };\n var classes = props.classes;\n DashBody.propTypes = {\n classes: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.object.isRequired\n };\n _this.selectView = _this.selectView.bind(_assertThisInitialized(_this));\n _this.selectContact = _this.selectContact.bind(_assertThisInitialized(_this));\n _this.searchContact = _this.searchContact.bind(_assertThisInitialized(_this));\n _this.uploadedView = _this.uploadedView.bind(_assertThisInitialized(_this));\n _this.purchasedView = _this.purchasedView.bind(_assertThisInitialized(_this));\n _this.uploadContact = _this.uploadContact.bind(_assertThisInitialized(_this));\n _this.contactPurchase = _this.contactPurchase.bind(_assertThisInitialized(_this));\n _this.renderContactList = _this.renderContactList.bind(_assertThisInitialized(_this));\n _this.handleComment = _this.handleComment.bind(_assertThisInitialized(_this));\n _this.commentBody = _this.commentBody.bind(_assertThisInitialized(_this));\n _this.showModal = _this.showModal.bind(_assertThisInitialized(_this));\n return _this;\n }\n\n _createClass(DashBody, [{\n key: \"componentWillMount\",\n value: function componentWillMount() {\n this.props.history.push('/dashboard');\n document.body.style.backgroundImage = 'none';\n this.props.getUserPoints();\n }\n }, {\n key: \"componentWillUnmount\",\n value: function componentWillUnmount() {\n document.body.style.backgroundImage = \"url('./leaddeal.png')\";\n }\n }, {\n key: \"showModal\",\n value: function showModal() {\n console.log('modal');\n }\n }, {\n key: \"selectView\",\n value: function selectView(button) {\n this.setState({\n selectedView: button\n });\n }\n }, {\n key: \"uploadedView\",\n value: function uploadedView() {\n var _this2 = this;\n\n this.props.auth.fetch(\"/api/users/\".concat(this.props.userId, \"/uploaded_contacts\")).then(function (uploadedContacts) {\n console.log(uploadedContacts);\n\n _this2.setState({\n uploaded: uploadedContacts,\n selectedView: 'uploaded'\n });\n })[\"catch\"](function (err) {\n console.log(err);\n });\n }\n }, {\n key: \"purchasedView\",\n value: function purchasedView() {\n var _this3 = this;\n\n this.props.auth.fetch(\"/api/users/\".concat(this.props.userId, \"/purchased_contacts\")).then(function (purchasedContacts) {\n console.log(purchasedContacts);\n\n _this3.setState({\n purchased: purchasedContacts,\n selectedView: 'purchased'\n });\n })[\"catch\"](function (err) {\n console.log(err);\n });\n }\n }, {\n key: \"selectContact\",\n value: function selectContact(contactId, list, view) {\n var _this4 = this;\n\n if (view === 'access') {\n var contact = this.state[list].filter(function (contact) {\n return contact.id === contactId;\n })[0];\n this.props.auth.fetch(\"/api/users/comments/\".concat(this.props.userId, \"/\").concat(contactId)).then(function (comments) {\n var revComments = comments.reverse();\n\n _this4.setState({\n comments: revComments,\n showNotes: true\n });\n })[\"catch\"](function (err) {\n console.log(err);\n });\n this.setState({\n currentLead: contact,\n contactView: 'access'\n });\n } else {\n var _contact = this.state.searchedContacts.filter(function (contact) {\n return contact.id === contactId;\n })[0];\n this.setState({\n currentLead: _contact,\n contactView: 'limited',\n purchaseState: \"Purchase This Contact\",\n purchaseColor: \"white\"\n });\n }\n }\n }, {\n key: \"searchContact\",\n value: function searchContact(query) {\n var _this5 = this;\n\n //console.log(query)\n var options = {\n method: 'POST',\n body: JSON.stringify(query)\n };\n this.props.auth.fetch(\"/api/users/search/\".concat(this.props.userId), options).then(function (contacts) {\n console.log('im inside this contact', contacts);\n\n _this5.setState({\n searchedContacts: contacts,\n selectedView: 'searched'\n });\n })[\"catch\"](function (err) {\n console.log(err);\n });\n }\n }, {\n key: \"uploadContact\",\n value: function uploadContact(contact) {\n var _this6 = this;\n\n console.log(this.props.userId);\n var options = {\n method: 'POST',\n body: JSON.stringify(contact)\n };\n this.props.auth.fetch2(\"/api/users/\".concat(this.props.userId, \"/upload\"), options).then(function (response) {\n _this6.props.getUserPoints();\n\n _this6.setState({\n currentLead: contact,\n contactView: 'access',\n comments: [],\n showNotes: false\n });\n })[\"catch\"](function (err) {\n console.error(err);\n });\n }\n }, {\n key: \"contactPurchase\",\n value: function contactPurchase(event, contactId) {\n var _this7 = this;\n\n console.log(event.target.innerHTML);\n\n if (this.props.points > 0) {\n var options = {\n method: 'POST'\n };\n this.props.auth.fetch(\"/api/users/purchase_contact/\".concat(this.props.userId, \"/\").concat(contactId), options).then(function (result) {\n console.log('i have just purchased this contact', result);\n\n _this7.props.getUserPoints(); // document.getElementById('purclimitedhase-button').innerHTML = 'Contact Purchased';\n // document.getElementById('purchase-button').style.color = 'grey';\n // event.target.innerHTML = 'Contact Purchased';\n\n\n _this7.setState({\n purchaseState: \"Contact Purchased\",\n purchaseColor: 'grey'\n });\n })[\"catch\"](function (err) {\n console.log(err);\n });\n } else {\n alert('You do not have enough points to complete this purchase. Please upload more contacts to obtain more points');\n }\n }\n }, {\n key: \"handleComment\",\n value: function handleComment(event) {\n var _this8 = this;\n\n event.preventDefault();\n var comment = {};\n comment.body = this.state.commentBodyText;\n var options = {\n method: 'POST',\n body: JSON.stringify(comment)\n };\n this.props.auth.fetch(\"/api/users/comments/\".concat(this.props.userId, \"/\").concat(this.state.currentLead.id), options).then(function (comments) {\n var revComments = comments.reverse();\n\n _this8.setState({\n commentBodyText: '',\n comments: revComments\n });\n })[\"catch\"](function (err) {\n console.log(err);\n\n _this8.setState({\n commentBodyText: ''\n });\n });\n }\n }, {\n key: \"commentBody\",\n value: function commentBody(comment) {\n this.setState({\n commentBodyText: comment\n });\n }\n }, {\n key: \"renderContactList\",\n value: function renderContactList() {\n this.setState({\n renderContactList: true\n });\n }\n }, {\n key: \"render\",\n value: function render() {\n if (this.state.renderContactList) {\n return react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"div\", null, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_material_ui_core_Grid__WEBPACK_IMPORTED_MODULE_4___default.a, {\n container: true,\n spacing: 24\n }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_material_ui_core_Grid__WEBPACK_IMPORTED_MODULE_4___default.a, {\n item: true,\n xs: true\n }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"div\", {\n className: \"left-top-display\"\n }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_ButtonList_jsx__WEBPACK_IMPORTED_MODULE_6__[\"default\"], {\n selectView: this.selectView,\n uploadedView: this.uploadedView,\n purchasedView: this.purchasedView,\n renderContactList: this.renderContactList,\n showModal: this.showModal\n })), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"div\", {\n className: \"left-bottom-display\"\n }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_ContactList_jsx__WEBPACK_IMPORTED_MODULE_7__[\"default\"], {\n uploaded: this.state.uploaded,\n purchased: this.state.purchased,\n selectedView: this.state.selectedView,\n selectContact: this.selectContact,\n searchContact: this.searchContact,\n uploadContact: this.uploadContact\n }), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_SearchView_jsx__WEBPACK_IMPORTED_MODULE_8__[\"default\"], {\n searchedContacts: this.state.searchedContacts,\n selectedView: this.state.selectedView,\n selectContact: this.selectContact\n }))), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_material_ui_core_Grid__WEBPACK_IMPORTED_MODULE_4___default.a, {\n item: true,\n xs: 9\n }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"div\", null), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_LeadInfo_jsx__WEBPACK_IMPORTED_MODULE_5__[\"default\"], {\n currentLead: this.state.currentLead,\n contactView: this.state.contactView,\n contactPurchase: this.contactPurchase,\n commentBody: this.commentBody,\n handleComment: this.handleComment,\n comments: this.state.comments,\n commentBodyText: this.state.commentBodyText,\n purchaseState: this.state.purchaseState,\n purchaseColor: this.state.purchaseColor,\n showNotes: this.state.showNotes\n }))));\n } else {\n return react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"div\", null, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_material_ui_core_Grid__WEBPACK_IMPORTED_MODULE_4___default.a, {\n container: true,\n spacing: 24\n }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_material_ui_core_Grid__WEBPACK_IMPORTED_MODULE_4___default.a, {\n item: true,\n xs: true\n }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"div\", {\n className: \"left-top-display\"\n }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_ButtonList_jsx__WEBPACK_IMPORTED_MODULE_6__[\"default\"], {\n selectView: this.selectView,\n uploadedView: this.uploadedView,\n purchasedView: this.purchasedView,\n renderContactList: this.renderContactList\n }))), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_material_ui_core_Grid__WEBPACK_IMPORTED_MODULE_4___default.a, {\n item: true,\n xs: 9\n }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"div\", null), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_LeadInfo_jsx__WEBPACK_IMPORTED_MODULE_5__[\"default\"], {\n currentLead: this.state.currentLead,\n contactView: this.state.contactView,\n contactPurchase: this.contactPurchase\n }))));\n }\n }\n }]);\n\n return DashBody;\n}(react__WEBPACK_IMPORTED_MODULE_0___default.a.Component);\n\nvar styles = function styles(theme) {\n return {\n root: {\n flexGrow: 1\n },\n paper: {\n padding: theme.spacing.unit * 2,\n textAlign: 'center',\n color: theme.palette.text.secondary\n }\n };\n};\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (Object(react_router__WEBPACK_IMPORTED_MODULE_9__[\"withRouter\"])(Object(_material_ui_core_styles__WEBPACK_IMPORTED_MODULE_2__[\"withStyles\"])(styles)(DashBody)));\n\n//# sourceURL=webpack:///./client/src/components/DashBody.jsx?"); /***/ }), @@ -166,7 +166,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var reac /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ \"./node_modules/react/index.js\");\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _material_ui_core_Toolbar__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @material-ui/core/Toolbar */ \"./node_modules/@material-ui/core/Toolbar/index.js\");\n/* harmony import */ var _material_ui_core_Toolbar__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_material_ui_core_Toolbar__WEBPACK_IMPORTED_MODULE_1__);\n/* harmony import */ var _material_ui_core_Paper__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @material-ui/core/Paper */ \"./node_modules/@material-ui/core/Paper/index.js\");\n/* harmony import */ var _material_ui_core_Paper__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_material_ui_core_Paper__WEBPACK_IMPORTED_MODULE_2__);\n/* harmony import */ var _material_ui_core_Grid__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @material-ui/core/Grid */ \"./node_modules/@material-ui/core/Grid/index.js\");\n/* harmony import */ var _material_ui_core_Grid__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_material_ui_core_Grid__WEBPACK_IMPORTED_MODULE_3__);\n/* harmony import */ var _material_ui_core_Button__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @material-ui/core/Button */ \"./node_modules/@material-ui/core/Button/index.js\");\n/* harmony import */ var _material_ui_core_Button__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_material_ui_core_Button__WEBPACK_IMPORTED_MODULE_4__);\n/* harmony import */ var _material_ui_core_Card__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @material-ui/core/Card */ \"./node_modules/@material-ui/core/Card/index.js\");\n/* harmony import */ var _material_ui_core_Card__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_material_ui_core_Card__WEBPACK_IMPORTED_MODULE_5__);\n/* harmony import */ var _material_ui_core_CardActionArea__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @material-ui/core/CardActionArea */ \"./node_modules/@material-ui/core/CardActionArea/index.js\");\n/* harmony import */ var _material_ui_core_CardActionArea__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(_material_ui_core_CardActionArea__WEBPACK_IMPORTED_MODULE_6__);\n/* harmony import */ var _material_ui_core_CardActions__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @material-ui/core/CardActions */ \"./node_modules/@material-ui/core/CardActions/index.js\");\n/* harmony import */ var _material_ui_core_CardActions__WEBPACK_IMPORTED_MODULE_7___default = /*#__PURE__*/__webpack_require__.n(_material_ui_core_CardActions__WEBPACK_IMPORTED_MODULE_7__);\n/* harmony import */ var _material_ui_core_CardContent__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @material-ui/core/CardContent */ \"./node_modules/@material-ui/core/CardContent/index.js\");\n/* harmony import */ var _material_ui_core_CardContent__WEBPACK_IMPORTED_MODULE_8___default = /*#__PURE__*/__webpack_require__.n(_material_ui_core_CardContent__WEBPACK_IMPORTED_MODULE_8__);\n/* harmony import */ var _material_ui_core_CardMedia__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! @material-ui/core/CardMedia */ \"./node_modules/@material-ui/core/CardMedia/index.js\");\n/* harmony import */ var _material_ui_core_CardMedia__WEBPACK_IMPORTED_MODULE_9___default = /*#__PURE__*/__webpack_require__.n(_material_ui_core_CardMedia__WEBPACK_IMPORTED_MODULE_9__);\n/* harmony import */ var _material_ui_core_Typography__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! @material-ui/core/Typography */ \"./node_modules/@material-ui/core/Typography/index.js\");\n/* harmony import */ var _material_ui_core_Typography__WEBPACK_IMPORTED_MODULE_10___default = /*#__PURE__*/__webpack_require__.n(_material_ui_core_Typography__WEBPACK_IMPORTED_MODULE_10__);\n/* harmony import */ var _material_ui_core_styles__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! @material-ui/core/styles */ \"./node_modules/@material-ui/core/styles/index.js\");\n/* harmony import */ var _material_ui_core_styles__WEBPACK_IMPORTED_MODULE_11___default = /*#__PURE__*/__webpack_require__.n(_material_ui_core_styles__WEBPACK_IMPORTED_MODULE_11__);\n/* harmony import */ var _material_ui_core__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! @material-ui/core */ \"./node_modules/@material-ui/core/index.es.js\");\n/* harmony import */ var _material_ui_core_Input__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! @material-ui/core/Input */ \"./node_modules/@material-ui/core/Input/index.js\");\n/* harmony import */ var _material_ui_core_Input__WEBPACK_IMPORTED_MODULE_13___default = /*#__PURE__*/__webpack_require__.n(_material_ui_core_Input__WEBPACK_IMPORTED_MODULE_13__);\n/* harmony import */ var moment__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! moment */ \"./node_modules/moment/moment.js\");\n/* harmony import */ var moment__WEBPACK_IMPORTED_MODULE_14___default = /*#__PURE__*/__webpack_require__.n(moment__WEBPACK_IMPORTED_MODULE_14__);\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\nvar styles = {\n card: {\n maxWidth: 345\n },\n media: {\n height: 140\n }\n};\n\nvar Practice = function Practice(_ref) {\n var currentLead = _ref.currentLead,\n contactView = _ref.contactView,\n contactPurchase = _ref.contactPurchase,\n handleComment = _ref.handleComment,\n commentBodyText = _ref.commentBodyText,\n comments = _ref.comments,\n commentBody = _ref.commentBody,\n purchaseState = _ref.purchaseState,\n purchaseColor = _ref.purchaseColor;\n var verified;\n\n if (contactView === 'access') {\n if (currentLead.verified) {\n verified = \"Lead the Deal Verified\";\n } else {\n verified = \"Not verified\";\n }\n\n return react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"div\", {\n className: \"contact-card\"\n }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_material_ui_core_Card__WEBPACK_IMPORTED_MODULE_5___default.a, null, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_material_ui_core_CardActionArea__WEBPACK_IMPORTED_MODULE_6___default.a, null, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_material_ui_core_CardContent__WEBPACK_IMPORTED_MODULE_8___default.a, null, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_material_ui_core_Typography__WEBPACK_IMPORTED_MODULE_10___default.a, {\n gutterBottom: true,\n variant: \"h5\",\n component: \"h2\"\n }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"div\", null, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"span\", {\n id: \"contact-list\"\n }, currentLead.name, \" \"), currentLead.verified ? react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"span\", null, \" \", react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"img\", {\n src: \"./checked_contact.jpg\",\n width: \"20px\",\n alt: \"verified icon\"\n })) : react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"span\", null, \" \", react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"img\", {\n src: \"./unchecked_contact.jpg\",\n width: \"20px\",\n alt: \"unverified icon\"\n })))), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_material_ui_core__WEBPACK_IMPORTED_MODULE_12__[\"Divider\"], null), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"div\", {\n className: \"contact-info\"\n }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"div\", null, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"strong\", null, \"Company:\"), \" \", currentLead.company), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"div\", null, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"strong\", null, \"Position:\"), \" \", currentLead.position), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"div\", null, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"strong\", null, \"Industry: \"), currentLead.industry), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"div\", null, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"strong\", null, \"Phone:\"), \" \", currentLead.phone), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"div\", null, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"strong\", null, \"e-mail: \"), currentLead.email), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"div\", null, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"strong\", null, \"Address: \"), currentLead.Address), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"div\", null, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"strong\", null, \"Verified:\"), \" \", verified))))), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"div\", {\n className: \"comments-card\"\n }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_material_ui_core_Card__WEBPACK_IMPORTED_MODULE_5___default.a, null, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_material_ui_core_CardActionArea__WEBPACK_IMPORTED_MODULE_6___default.a, null, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_material_ui_core_CardContent__WEBPACK_IMPORTED_MODULE_8___default.a, null, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_material_ui_core_Typography__WEBPACK_IMPORTED_MODULE_10___default.a, {\n gutterBottom: true,\n variant: \"h5\",\n component: \"h2\"\n }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"div\", {\n id: \"concact-list\"\n }, \"Notes\")), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_material_ui_core__WEBPACK_IMPORTED_MODULE_12__[\"Divider\"], null), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"div\", {\n className: \"contact-info\"\n }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"form\", {\n onSubmit: function onSubmit() {\n handleComment(event);\n }\n }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_material_ui_core_Input__WEBPACK_IMPORTED_MODULE_13___default.a, {\n placeholder: \"Add new comment...\",\n fullWidth: true,\n required: true,\n onChange: function onChange(event) {\n commentBody(event.target.value);\n },\n value: commentBodyText\n }), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"div\", null, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_material_ui_core_Input__WEBPACK_IMPORTED_MODULE_13___default.a, {\n type: \"submit\",\n value: \"Submit\"\n })))))))), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"div\", null, comments.map(function (comment, index) {\n console.log(comment);\n var prettyDate;\n prettyDate = moment__WEBPACK_IMPORTED_MODULE_14___default()(comment.date).format('MMMM Do YYYY, h:mm a');\n return react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"div\", {\n key: index,\n className: \"comments-card\"\n }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_material_ui_core_Card__WEBPACK_IMPORTED_MODULE_5___default.a, null, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_material_ui_core_CardActionArea__WEBPACK_IMPORTED_MODULE_6___default.a, null, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_material_ui_core_CardContent__WEBPACK_IMPORTED_MODULE_8___default.a, null, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_material_ui_core_Typography__WEBPACK_IMPORTED_MODULE_10___default.a, {\n gutterBottom: true,\n variant: \"h6\",\n component: \"h2\"\n }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"div\", null, prettyDate)), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_material_ui_core__WEBPACK_IMPORTED_MODULE_12__[\"Divider\"], null), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"div\", {\n className: \"contact-info\"\n }, comment.comment)))));\n })));\n } else if (contactView === 'limited') {\n var _verified;\n\n if (currentLead.verified) {\n _verified = \"Lead the Deal Verified\";\n } else {\n _verified = \"Not verified\";\n }\n\n return react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"div\", {\n className: \"contact-card\"\n }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_material_ui_core_Card__WEBPACK_IMPORTED_MODULE_5___default.a, null, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_material_ui_core_CardActionArea__WEBPACK_IMPORTED_MODULE_6___default.a, null, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_material_ui_core_CardContent__WEBPACK_IMPORTED_MODULE_8___default.a, null, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_material_ui_core_Typography__WEBPACK_IMPORTED_MODULE_10___default.a, {\n gutterBottom: true,\n variant: \"h5\",\n component: \"h2\"\n }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"div\", null, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"span\", {\n id: \"contact-list\"\n }, currentLead.name, \" \"), currentLead.verified ? react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"span\", null, \" \", react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"img\", {\n src: \"./checked_contact.jpg\",\n width: \"20px\",\n alt: \"verified icon\"\n })) : react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"span\", null, \" \", react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"img\", {\n src: \"./unchecked_contact.jpg\",\n width: \"20px\",\n alt: \"unverified icon\"\n })))), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_material_ui_core__WEBPACK_IMPORTED_MODULE_12__[\"Divider\"], null), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"div\", {\n className: \"contact-info\"\n }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"div\", null, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"strong\", null, \"Company: \"), \" \", currentLead.company), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"div\", null, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"strong\", null, \"Position:\"), \" \", currentLead.position), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"div\", null, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"strong\", null, \"Industry:\"), \" \", currentLead.industry), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"div\", null, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"strong\", null, \"Verified:\"), \" \", _verified)), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_material_ui_core_CardActions__WEBPACK_IMPORTED_MODULE_7___default.a, null, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"div\", {\n id: currentLead.id\n }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_material_ui_core_Button__WEBPACK_IMPORTED_MODULE_4___default.a, {\n size: \"small\",\n variant: \"contained\",\n color: \"primary\",\n onClick: function onClick() {\n return contactPurchase(event, currentLead.id);\n }\n }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"span\", {\n style: {\n color: purchaseColor\n }\n }, purchaseState))))))));\n } else {\n return react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"div\", null);\n }\n};\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (Practice);\n\n//# sourceURL=webpack:///./client/src/components/LeadInfo.jsx?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ \"./node_modules/react/index.js\");\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _material_ui_core_Toolbar__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @material-ui/core/Toolbar */ \"./node_modules/@material-ui/core/Toolbar/index.js\");\n/* harmony import */ var _material_ui_core_Toolbar__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_material_ui_core_Toolbar__WEBPACK_IMPORTED_MODULE_1__);\n/* harmony import */ var _material_ui_core_Paper__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @material-ui/core/Paper */ \"./node_modules/@material-ui/core/Paper/index.js\");\n/* harmony import */ var _material_ui_core_Paper__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_material_ui_core_Paper__WEBPACK_IMPORTED_MODULE_2__);\n/* harmony import */ var _material_ui_core_Grid__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @material-ui/core/Grid */ \"./node_modules/@material-ui/core/Grid/index.js\");\n/* harmony import */ var _material_ui_core_Grid__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_material_ui_core_Grid__WEBPACK_IMPORTED_MODULE_3__);\n/* harmony import */ var _material_ui_core_Button__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @material-ui/core/Button */ \"./node_modules/@material-ui/core/Button/index.js\");\n/* harmony import */ var _material_ui_core_Button__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_material_ui_core_Button__WEBPACK_IMPORTED_MODULE_4__);\n/* harmony import */ var _material_ui_core_Card__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @material-ui/core/Card */ \"./node_modules/@material-ui/core/Card/index.js\");\n/* harmony import */ var _material_ui_core_Card__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_material_ui_core_Card__WEBPACK_IMPORTED_MODULE_5__);\n/* harmony import */ var _material_ui_core_CardActionArea__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @material-ui/core/CardActionArea */ \"./node_modules/@material-ui/core/CardActionArea/index.js\");\n/* harmony import */ var _material_ui_core_CardActionArea__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(_material_ui_core_CardActionArea__WEBPACK_IMPORTED_MODULE_6__);\n/* harmony import */ var _material_ui_core_CardActions__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @material-ui/core/CardActions */ \"./node_modules/@material-ui/core/CardActions/index.js\");\n/* harmony import */ var _material_ui_core_CardActions__WEBPACK_IMPORTED_MODULE_7___default = /*#__PURE__*/__webpack_require__.n(_material_ui_core_CardActions__WEBPACK_IMPORTED_MODULE_7__);\n/* harmony import */ var _material_ui_core_CardContent__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @material-ui/core/CardContent */ \"./node_modules/@material-ui/core/CardContent/index.js\");\n/* harmony import */ var _material_ui_core_CardContent__WEBPACK_IMPORTED_MODULE_8___default = /*#__PURE__*/__webpack_require__.n(_material_ui_core_CardContent__WEBPACK_IMPORTED_MODULE_8__);\n/* harmony import */ var _material_ui_core_CardMedia__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! @material-ui/core/CardMedia */ \"./node_modules/@material-ui/core/CardMedia/index.js\");\n/* harmony import */ var _material_ui_core_CardMedia__WEBPACK_IMPORTED_MODULE_9___default = /*#__PURE__*/__webpack_require__.n(_material_ui_core_CardMedia__WEBPACK_IMPORTED_MODULE_9__);\n/* harmony import */ var _material_ui_core_Typography__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! @material-ui/core/Typography */ \"./node_modules/@material-ui/core/Typography/index.js\");\n/* harmony import */ var _material_ui_core_Typography__WEBPACK_IMPORTED_MODULE_10___default = /*#__PURE__*/__webpack_require__.n(_material_ui_core_Typography__WEBPACK_IMPORTED_MODULE_10__);\n/* harmony import */ var _material_ui_core_styles__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! @material-ui/core/styles */ \"./node_modules/@material-ui/core/styles/index.js\");\n/* harmony import */ var _material_ui_core_styles__WEBPACK_IMPORTED_MODULE_11___default = /*#__PURE__*/__webpack_require__.n(_material_ui_core_styles__WEBPACK_IMPORTED_MODULE_11__);\n/* harmony import */ var _material_ui_core__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! @material-ui/core */ \"./node_modules/@material-ui/core/index.es.js\");\n/* harmony import */ var _material_ui_core_Input__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! @material-ui/core/Input */ \"./node_modules/@material-ui/core/Input/index.js\");\n/* harmony import */ var _material_ui_core_Input__WEBPACK_IMPORTED_MODULE_13___default = /*#__PURE__*/__webpack_require__.n(_material_ui_core_Input__WEBPACK_IMPORTED_MODULE_13__);\n/* harmony import */ var moment__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! moment */ \"./node_modules/moment/moment.js\");\n/* harmony import */ var moment__WEBPACK_IMPORTED_MODULE_14___default = /*#__PURE__*/__webpack_require__.n(moment__WEBPACK_IMPORTED_MODULE_14__);\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\nvar styles = {\n card: {\n maxWidth: 345\n },\n media: {\n height: 140\n }\n};\n\nvar Practice = function Practice(_ref) {\n var currentLead = _ref.currentLead,\n contactView = _ref.contactView,\n contactPurchase = _ref.contactPurchase,\n handleComment = _ref.handleComment,\n commentBodyText = _ref.commentBodyText,\n comments = _ref.comments,\n commentBody = _ref.commentBody,\n purchaseState = _ref.purchaseState,\n purchaseColor = _ref.purchaseColor,\n showNotes = _ref.showNotes;\n var verified;\n\n if (contactView === 'access') {\n if (currentLead.verified) {\n verified = \"Lead the Deal Verified\";\n } else {\n verified = \"Not verified\";\n }\n\n return react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"div\", {\n className: \"contact-card\"\n }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_material_ui_core_Card__WEBPACK_IMPORTED_MODULE_5___default.a, null, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_material_ui_core_CardActionArea__WEBPACK_IMPORTED_MODULE_6___default.a, null, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_material_ui_core_CardContent__WEBPACK_IMPORTED_MODULE_8___default.a, null, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_material_ui_core_Typography__WEBPACK_IMPORTED_MODULE_10___default.a, {\n gutterBottom: true,\n variant: \"h5\",\n component: \"h2\"\n }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"div\", null, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"span\", {\n id: \"contact-list\"\n }, currentLead.name, \" \"), currentLead.verified ? react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"span\", null, \" \", react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"img\", {\n src: \"./checked_contact.jpg\",\n width: \"20px\",\n alt: \"verified icon\"\n })) : react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"span\", null, \" \", react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"img\", {\n src: \"./unchecked_contact.jpg\",\n width: \"20px\",\n alt: \"unverified icon\"\n })))), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_material_ui_core__WEBPACK_IMPORTED_MODULE_12__[\"Divider\"], null), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"div\", {\n className: \"contact-info\"\n }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"div\", null, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"strong\", null, \"Company:\"), \" \", currentLead.company), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"div\", null, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"strong\", null, \"Position:\"), \" \", currentLead.position), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"div\", null, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"strong\", null, \"Industry: \"), currentLead.industry), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"div\", null, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"strong\", null, \"Phone:\"), \" \", currentLead.phone), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"div\", null, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"strong\", null, \"e-mail: \"), currentLead.email), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"div\", null, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"strong\", null, \"Address: \"), currentLead.Address), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"div\", null, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"strong\", null, \"Verified:\"), \" \", verified))))), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"div\", {\n className: \"comments-card\"\n }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_material_ui_core_Card__WEBPACK_IMPORTED_MODULE_5___default.a, null, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_material_ui_core_CardActionArea__WEBPACK_IMPORTED_MODULE_6___default.a, null, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_material_ui_core_CardContent__WEBPACK_IMPORTED_MODULE_8___default.a, null, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_material_ui_core_Typography__WEBPACK_IMPORTED_MODULE_10___default.a, {\n gutterBottom: true,\n variant: \"h5\",\n component: \"h2\"\n }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"div\", {\n id: \"concact-list\"\n }, showNotes ? 'Notes' : 'Success!')), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_material_ui_core__WEBPACK_IMPORTED_MODULE_12__[\"Divider\"], null), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"div\", {\n className: \"contact-info\"\n }, showNotes ? react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"form\", {\n onSubmit: function onSubmit() {\n handleComment(event);\n }\n }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_material_ui_core_Input__WEBPACK_IMPORTED_MODULE_13___default.a, {\n placeholder: \"Add new comment...\",\n fullWidth: true,\n required: true,\n onChange: function onChange(event) {\n commentBody(event.target.value);\n },\n value: commentBodyText\n }), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"div\", null, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_material_ui_core_Input__WEBPACK_IMPORTED_MODULE_13___default.a, {\n type: \"submit\",\n value: \"Submit\"\n }))) : \"This contact has been uploaded!\"))))), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"div\", null, comments.map(function (comment, index) {\n console.log(comment);\n var prettyDate;\n prettyDate = moment__WEBPACK_IMPORTED_MODULE_14___default()(comment.date).format('MMMM Do YYYY, h:mm a');\n return react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"div\", {\n key: index,\n className: \"comments-card\"\n }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_material_ui_core_Card__WEBPACK_IMPORTED_MODULE_5___default.a, null, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_material_ui_core_CardActionArea__WEBPACK_IMPORTED_MODULE_6___default.a, null, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_material_ui_core_CardContent__WEBPACK_IMPORTED_MODULE_8___default.a, null, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_material_ui_core_Typography__WEBPACK_IMPORTED_MODULE_10___default.a, {\n gutterBottom: true,\n variant: \"h6\",\n component: \"h2\"\n }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"div\", null, prettyDate)), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_material_ui_core__WEBPACK_IMPORTED_MODULE_12__[\"Divider\"], null), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"div\", {\n className: \"contact-info\"\n }, comment.comment)))));\n })));\n } else if (contactView === 'limited') {\n var _verified;\n\n if (currentLead.verified) {\n _verified = \"Lead the Deal Verified\";\n } else {\n _verified = \"Not verified\";\n }\n\n return react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"div\", {\n className: \"contact-card\"\n }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_material_ui_core_Card__WEBPACK_IMPORTED_MODULE_5___default.a, null, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_material_ui_core_CardActionArea__WEBPACK_IMPORTED_MODULE_6___default.a, null, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_material_ui_core_CardContent__WEBPACK_IMPORTED_MODULE_8___default.a, null, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_material_ui_core_Typography__WEBPACK_IMPORTED_MODULE_10___default.a, {\n gutterBottom: true,\n variant: \"h5\",\n component: \"h2\"\n }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"div\", null, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"span\", {\n id: \"contact-list\"\n }, currentLead.name, \" \"), currentLead.verified ? react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"span\", null, \" \", react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"img\", {\n src: \"./checked_contact.jpg\",\n width: \"20px\",\n alt: \"verified icon\"\n })) : react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"span\", null, \" \", react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"img\", {\n src: \"./unchecked_contact.jpg\",\n width: \"20px\",\n alt: \"unverified icon\"\n })))), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_material_ui_core__WEBPACK_IMPORTED_MODULE_12__[\"Divider\"], null), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"div\", {\n className: \"contact-info\"\n }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"div\", null, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"strong\", null, \"Company: \"), \" \", currentLead.company), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"div\", null, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"strong\", null, \"Position:\"), \" \", currentLead.position), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"div\", null, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"strong\", null, \"Industry:\"), \" \", currentLead.industry), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"div\", null, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"strong\", null, \"Verified:\"), \" \", _verified)), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_material_ui_core_CardActions__WEBPACK_IMPORTED_MODULE_7___default.a, null, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"div\", {\n id: currentLead.id\n }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_material_ui_core_Button__WEBPACK_IMPORTED_MODULE_4___default.a, {\n size: \"small\",\n variant: \"contained\",\n color: \"primary\",\n onClick: function onClick() {\n return contactPurchase(event, currentLead.id);\n }\n }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"span\", {\n style: {\n color: purchaseColor\n }\n }, purchaseState))))))));\n } else {\n return react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"div\", null);\n }\n};\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (Practice);\n\n//# sourceURL=webpack:///./client/src/components/LeadInfo.jsx?"); /***/ }), diff --git a/client/src/components/DashBody.jsx b/client/src/components/DashBody.jsx index d9b2dea..a13ec62 100644 --- a/client/src/components/DashBody.jsx +++ b/client/src/components/DashBody.jsx @@ -30,7 +30,8 @@ class DashBody extends React.Component { comments: [], username: '', purchaseState: 'Purchase This Contact', - purchaseColor: 'white' + purchaseColor: 'white', + showNotes: true, }; const { classes } = props; DashBody.propTypes = { @@ -102,7 +103,10 @@ selectContact(contactId, list, view){ this.props.auth.fetch(`/api/users/comments/${this.props.userId}/${contactId}`) .then((comments) => { let revComments = comments.reverse(); - this.setState({comments: revComments}) + this.setState({ + comments: revComments, + showNotes: true, + }) }) .catch((err) => { console.log(err); @@ -158,7 +162,10 @@ uploadContact(contact){ this.props.getUserPoints(); this.setState({ currentLead: contact, - contactView: 'access' + contactView: 'access', + comments: [], + showNotes: false, + }) }) .catch((err)=>{ @@ -259,7 +266,8 @@ render(){ + commentBodyText={this.state.commentBodyText} purchaseState={this.state.purchaseState} + purchaseColor={this.state.purchaseColor} showNotes={this.state.showNotes}/> diff --git a/client/src/components/LeadInfo.jsx b/client/src/components/LeadInfo.jsx index 4696ed1..19f76e3 100644 --- a/client/src/components/LeadInfo.jsx +++ b/client/src/components/LeadInfo.jsx @@ -28,7 +28,7 @@ const styles = { -const Practice = ({currentLead, contactView, contactPurchase, handleComment, commentBodyText, comments, commentBody, purchaseState, purchaseColor}) => { +const Practice = ({currentLead, contactView, contactPurchase, handleComment, commentBodyText, comments, commentBody, purchaseState, purchaseColor, showNotes}) => { let verified; if (contactView === 'access'){ if (currentLead.verified) { @@ -69,17 +69,22 @@ const Practice = ({currentLead, contactView, contactPurchase, handleComment, com -
Notes
+
{showNotes ? 'Notes' : 'Success!'}
+ {showNotes ?
{ handleComment(event) }}> {commentBody(event.target.value)}} value={commentBodyText}/> + onChange={(event) => { commentBody(event.target.value) }} value={commentBodyText} />
- +
+ : "This contact has been uploaded!" + + + }
diff --git a/database/index.js b/database/index.js index d2d6a84..4fa27d6 100644 --- a/database/index.js +++ b/database/index.js @@ -10,17 +10,17 @@ const host = process.env.host|| "localhost"; const port = process.env.port || '3000' const dbName = process.env.dbName || 'lead_the_deal' -// const sequelize = new Sequelize('lead_the_deal', username, password, { -// dialect: 'mysql', -// host: host, -// }); +const sequelize = new Sequelize('lead_the_deal', username, password, { + dialect: 'mysql', + host: host, +}); -const sequelize = new Sequelize('lead_the_deal', 'leadthedeal', process.env.AWSPASS, { - host: 'leadthedeal.co5uhag2jtpo.us-east-2.rds.amazonaws.com', - port: 3306, - dialect: 'mysql' -}); +// const sequelize = new Sequelize('lead_the_deal', 'leadthedeal', process.env.AWSPASS, { +// host: 'leadthedeal.co5uhag2jtpo.us-east-2.rds.amazonaws.com', +// port: 3306, +// dialect: 'mysql' +// }); /////////////////// /////MODELS ///////