diff --git a/.babelrc b/.babelrc index 0960c01..1f45614 100644 --- a/.babelrc +++ b/.babelrc @@ -2,5 +2,10 @@ "presets": [ "@babel/preset-env", "@babel/preset-react" + ], + "plugins": [ + [ + "@babel/plugin-proposal-class-properties" + ] ] } \ No newline at end of file diff --git a/client/dist/bundle.js b/client/dist/bundle.js index 8eff73e..57d7a33 100644 --- a/client/dist/bundle.js +++ b/client/dist/bundle.js @@ -106,7 +106,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) * /***/ (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_Button__WEBPACK_IMPORTED_MODULE_3__ = __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_3___default = /*#__PURE__*/__webpack_require__.n(_material_ui_core_Button__WEBPACK_IMPORTED_MODULE_3__);\n/* harmony import */ var _material_ui_core_Fab__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @material-ui/core/Fab */ \"./node_modules/@material-ui/core/Fab/index.js\");\n/* harmony import */ var _material_ui_core_Fab__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_material_ui_core_Fab__WEBPACK_IMPORTED_MODULE_4__);\n/* harmony import */ var _material_ui_core_IconButton__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @material-ui/core/IconButton */ \"./node_modules/@material-ui/core/IconButton/index.js\");\n/* harmony import */ var _material_ui_core_IconButton__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_material_ui_core_IconButton__WEBPACK_IMPORTED_MODULE_5__);\n/* harmony import */ var _material_ui_icons_Add__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @material-ui/icons/Add */ \"./node_modules/@material-ui/icons/Add.js\");\n/* harmony import */ var _material_ui_icons_Add__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(_material_ui_icons_Add__WEBPACK_IMPORTED_MODULE_6__);\n/* harmony import */ var _material_ui_icons_Delete__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @material-ui/icons/Delete */ \"./node_modules/@material-ui/icons/Delete.js\");\n/* harmony import */ var _material_ui_icons_Delete__WEBPACK_IMPORTED_MODULE_7___default = /*#__PURE__*/__webpack_require__.n(_material_ui_icons_Delete__WEBPACK_IMPORTED_MODULE_7__);\n/* harmony import */ var _material_ui_icons_Navigation__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @material-ui/icons/Navigation */ \"./node_modules/@material-ui/icons/Navigation.js\");\n/* harmony import */ var _material_ui_icons_Navigation__WEBPACK_IMPORTED_MODULE_8___default = /*#__PURE__*/__webpack_require__.n(_material_ui_icons_Navigation__WEBPACK_IMPORTED_MODULE_8__);\n\n\n\n\n\n\n\n\n\n\nvar ButtonList = function ButtonList(_ref) {\n var selectView = _ref.selectView,\n uploadedView = _ref.uploadedView,\n purchasedView = _ref.purchasedView,\n renderContactList = _ref.renderContactList;\n\n var styles = function styles(theme) {\n return {\n margin: {\n margin: theme.spacing.unit\n },\n extendedIcon: {\n marginRight: theme.spacing.unit\n }\n };\n };\n\n return react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"div\", {\n className: \"dashboard\"\n }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"div\", null, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"h4\", null, \"Dashboard\")), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"div\", {\n onClick: function onClick() {\n uploadedView();\n renderContactList();\n }\n }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_material_ui_core_Button__WEBPACK_IMPORTED_MODULE_3___default.a, {\n size: \"medium\"\n }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"span\", {\n className: \"dash-text\"\n }, \"Uploaded Contacts\"))), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"div\", null, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_material_ui_core_Button__WEBPACK_IMPORTED_MODULE_3___default.a, {\n size: \"medium\",\n onClick: function onClick() {\n purchasedView();\n renderContactList();\n }\n }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"span\", {\n className: \"dash-text\"\n }, \"Purchased Contacts\"))), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"div\", null, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_material_ui_core_Button__WEBPACK_IMPORTED_MODULE_3___default.a, {\n size: \"medium\",\n onClick: function onClick() {\n selectView('upload');\n renderContactList();\n }\n }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"span\", {\n className: \"dash-text\"\n }, \"Upload Contact\"))), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"div\", null, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_material_ui_core_Button__WEBPACK_IMPORTED_MODULE_3___default.a, {\n size: \"medium\",\n onClick: function onClick() {\n selectView('search');\n renderContactList();\n }\n }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"span\", {\n className: \"dash-text\"\n }, \"Search Contacts\"))));\n};\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (ButtonList);\n\n//# sourceURL=webpack:///./client/src/components/ButtonList.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_Button__WEBPACK_IMPORTED_MODULE_3__ = __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_3___default = /*#__PURE__*/__webpack_require__.n(_material_ui_core_Button__WEBPACK_IMPORTED_MODULE_3__);\n/* harmony import */ var _material_ui_core_Fab__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @material-ui/core/Fab */ \"./node_modules/@material-ui/core/Fab/index.js\");\n/* harmony import */ var _material_ui_core_Fab__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_material_ui_core_Fab__WEBPACK_IMPORTED_MODULE_4__);\n/* harmony import */ var _material_ui_core_IconButton__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @material-ui/core/IconButton */ \"./node_modules/@material-ui/core/IconButton/index.js\");\n/* harmony import */ var _material_ui_core_IconButton__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_material_ui_core_IconButton__WEBPACK_IMPORTED_MODULE_5__);\n/* harmony import */ var _material_ui_icons_Add__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @material-ui/icons/Add */ \"./node_modules/@material-ui/icons/Add.js\");\n/* harmony import */ var _material_ui_icons_Add__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(_material_ui_icons_Add__WEBPACK_IMPORTED_MODULE_6__);\n/* harmony import */ var _material_ui_icons_Delete__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @material-ui/icons/Delete */ \"./node_modules/@material-ui/icons/Delete.js\");\n/* harmony import */ var _material_ui_icons_Delete__WEBPACK_IMPORTED_MODULE_7___default = /*#__PURE__*/__webpack_require__.n(_material_ui_icons_Delete__WEBPACK_IMPORTED_MODULE_7__);\n/* harmony import */ var _material_ui_icons_Navigation__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @material-ui/icons/Navigation */ \"./node_modules/@material-ui/icons/Navigation.js\");\n/* harmony import */ var _material_ui_icons_Navigation__WEBPACK_IMPORTED_MODULE_8___default = /*#__PURE__*/__webpack_require__.n(_material_ui_icons_Navigation__WEBPACK_IMPORTED_MODULE_8__);\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\nfunction _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\n\n\n\n\n\n\n\n\n //selectView, uploadedView, purchasedView, renderContactList\n\nvar styles = function styles(theme) {\n return {\n margin: {\n margin: theme.spacing.unit\n },\n extendedIcon: {\n marginRight: theme.spacing.unit\n }\n };\n};\n\nvar Modal = function Modal(_ref) {\n var handleClose = _ref.handleClose,\n show = _ref.show,\n children = _ref.children;\n var showHideClassName = show ? \"modal display-block\" : \"modal display-none\";\n return react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"div\", {\n className: showHideClassName\n }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"section\", {\n className: \"modal-main\"\n }, children, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_material_ui_core_Button__WEBPACK_IMPORTED_MODULE_3___default.a, {\n color: \"primary\",\n onClick: handleClose\n }, \"close\")));\n};\n\nvar ButtonList =\n/*#__PURE__*/\nfunction (_React$Component) {\n _inherits(ButtonList, _React$Component);\n\n function ButtonList(props) {\n var _this;\n\n _classCallCheck(this, ButtonList);\n\n _this = _possibleConstructorReturn(this, _getPrototypeOf(ButtonList).call(this, props));\n\n _defineProperty(_assertThisInitialized(_this), \"showModal\", function () {\n _this.setState({\n show: true\n });\n });\n\n _defineProperty(_assertThisInitialized(_this), \"hideModal\", function () {\n _this.setState({\n show: false\n });\n });\n\n _this.state = {\n show: false\n };\n _this.showModal = _this.showModal.bind(_assertThisInitialized(_this));\n return _this;\n }\n\n _createClass(ButtonList, [{\n key: \"render\",\n value: function render() {\n var _this$props = this.props,\n selectView = _this$props.selectView,\n uploadedView = _this$props.uploadedView,\n purchasedView = _this$props.purchasedView,\n renderContactList = _this$props.renderContactList;\n return react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"div\", {\n className: \"dashboard\"\n }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(Modal, {\n show: this.state.show,\n handleClose: this.hideModal\n }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"h1\", null, \"Lead the Deal\"), \"Lead the deal is a Business to Business platform that serves as a marketplace for contact information. A user starts off with 10 points, which you can use to purchase contacts. If you run out of points, you can upload new contacts in order to obtain more points and access any further contacts from the database.\", react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"h3\", null, \"Uploaded Contacts\"), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"p\", null, \"Click to see a list of all the contacts that you have uploaded to the databse. You also have access to a notepad for each different user that will only be visible to you.\"), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"h3\", null, \"Purchased Contacts\"), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"p\", null, \"Once you have purchased a contact this section will show you all the relevant contact information, along with a notes section where you can keep track of when you have contacted this person. \"), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"h3\", null, \"Upload Contact\"), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"p\", null, \"Will show a form where you can upload new contacts and obtain one point per contact uploaded. Please be sure to fill out all relevant information accurately. The contacts will be verified upon submission and if the person's name and phone number do not match your contact will not be verified. \"), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"h3\", null, \"Search Contacts\"), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"p\", null, \"Will show a form where you can search contacts by name, company, industry, position, or address. You can fill one, any or all of the fields available. \")), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"div\", null, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"p\", null, \" \", react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"strong\", null, \" Dashboard\"), \" \\u2003 \", react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"span\", null, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"img\", {\n id: \"help\",\n onClick: this.showModal,\n src: \"./help_icon.png\",\n width: \"17px\",\n alt: \"help icon\"\n })))), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"div\", {\n onClick: function onClick() {\n uploadedView();\n renderContactList();\n }\n }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_material_ui_core_Button__WEBPACK_IMPORTED_MODULE_3___default.a, {\n size: \"medium\"\n }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"span\", {\n className: \"dash-text\"\n }, \"Uploaded Contacts\"))), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"div\", null, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_material_ui_core_Button__WEBPACK_IMPORTED_MODULE_3___default.a, {\n size: \"medium\",\n onClick: function onClick() {\n purchasedView();\n renderContactList();\n }\n }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"span\", {\n className: \"dash-text\"\n }, \"Purchased Contacts\"))), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"div\", null, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_material_ui_core_Button__WEBPACK_IMPORTED_MODULE_3___default.a, {\n size: \"medium\",\n onClick: function onClick() {\n selectView('upload');\n renderContactList();\n }\n }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"span\", {\n className: \"dash-text\"\n }, \"Upload Contact\"))), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"div\", null, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_material_ui_core_Button__WEBPACK_IMPORTED_MODULE_3___default.a, {\n size: \"medium\",\n onClick: function onClick() {\n selectView('search');\n renderContactList();\n }\n }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"span\", {\n className: \"dash-text\"\n }, \"Search Contacts\"))));\n }\n }]);\n\n return ButtonList;\n}(react__WEBPACK_IMPORTED_MODULE_0___default.a.Component);\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (ButtonList);\n\n//# sourceURL=webpack:///./client/src/components/ButtonList.jsx?"); /***/ }), @@ -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 leads: [{\n name: 'patrick ryan',\n company: 'zlien',\n id: 1\n }, {\n name: 'winntana B.',\n company: 'Operation Spark',\n id: 2\n }, {\n name: 'arnulfo Man',\n company: 'guitar'\n }],\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 date: 'Add comments to keep track of your leads!',\n comment: 'The easiest place to keep track of lead data!'\n }],\n username: ''\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 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: \"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 });\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('purchase-button').innerHTML = 'Contact Purchased';\n // document.getElementById('purchase-button').style.color = 'grey';\n\n\n event.target.innerHTML = 'Contact Purchased';\n event.target.style.color = 'grey';\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 })), 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 }))));\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 leads: [{\n name: 'patrick ryan',\n company: 'zlien',\n id: 1\n }, {\n name: 'winntana B.',\n company: 'Operation Spark',\n id: 2\n }, {\n name: 'arnulfo Man',\n company: 'guitar'\n }],\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 date: 'Add comments to keep track of your leads!',\n comment: 'The easiest place to keep track of lead data!'\n }],\n username: ''\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 });\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('purchase-button').innerHTML = 'Contact Purchased';\n // document.getElementById('purchase-button').style.color = 'grey';\n\n\n event.target.innerHTML = 'Contact Purchased';\n event.target.style.color = 'grey';\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 }))));\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?"); /***/ }), @@ -226,7 +226,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 react_dom__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react-dom */ \"./node_modules/react-dom/index.js\");\n/* harmony import */ var react_dom__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react_dom__WEBPACK_IMPORTED_MODULE_1__);\n/* harmony import */ var _material_ui_core_Button__WEBPACK_IMPORTED_MODULE_2__ = __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_2___default = /*#__PURE__*/__webpack_require__.n(_material_ui_core_Button__WEBPACK_IMPORTED_MODULE_2__);\n/* harmony import */ var _components_DashboardHeader_jsx__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./components/DashboardHeader.jsx */ \"./client/src/components/DashboardHeader.jsx\");\n/* harmony import */ var _components_DashBody_jsx__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./components/DashBody.jsx */ \"./client/src/components/DashBody.jsx\");\n/* harmony import */ var _components_Login_jsx__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./components/Login.jsx */ \"./client/src/components/Login.jsx\");\n/* harmony import */ var _components_Register_jsx__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./components/Register.jsx */ \"./client/src/components/Register.jsx\");\n/* harmony import */ var react_router_dom__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! react-router-dom */ \"./node_modules/react-router-dom/esm/react-router-dom.js\");\n/* harmony import */ var axios__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! axios */ \"./node_modules/axios/index.js\");\n/* harmony import */ var axios__WEBPACK_IMPORTED_MODULE_8___default = /*#__PURE__*/__webpack_require__.n(axios__WEBPACK_IMPORTED_MODULE_8__);\n/* harmony import */ var _components_AuthService_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./components/AuthService.js */ \"./client/src/components/AuthService.js\");\n/* harmony import */ var _components_UserHeader_jsx__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./components/UserHeader.jsx */ \"./client/src/components/UserHeader.jsx\");\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 _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }\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 //Material UI stuff\n\nvar styles = {\n paperContainer: {\n backgroundImage: \"url(\".concat(Image, \")\")\n }\n};\n\nvar App =\n/*#__PURE__*/\nfunction (_React$Component) {\n _inherits(App, _React$Component);\n\n function App(props) {\n var _this;\n\n _classCallCheck(this, App);\n\n _this = _possibleConstructorReturn(this, _getPrototypeOf(App).call(this, props));\n _this.state = {\n isLoggedin: false,\n userId: null,\n redirectTo: '',\n username: '',\n points: null\n };\n _this.registerUser = _this.registerUser.bind(_assertThisInitialized(_this));\n _this.loginUser = _this.loginUser.bind(_assertThisInitialized(_this));\n _this.logOutUser = _this.logOutUser.bind(_assertThisInitialized(_this));\n _this.getUserPoints = _this.getUserPoints.bind(_assertThisInitialized(_this));\n _this.Auth = new _components_AuthService_js__WEBPACK_IMPORTED_MODULE_9__[\"default\"]();\n return _this;\n }\n\n _createClass(App, [{\n key: \"componentWillMount\",\n value: function componentWillMount() {// if (this.Auth.loggedIn()){\n // this.setState({\n // isLoggedin: true,\n // redirectTo: '/dashboard'\n // })\n // } else{\n // this.setState({\n // isLoggedin: false\n // })\n // }\n }\n }, {\n key: \"getUserPoints\",\n value: function getUserPoints() {\n var _this2 = this;\n\n this.Auth.fetch(\"/api/users/\".concat(this.state.userId)).then(function (user) {\n _this2.setState({\n points: user.points\n });\n })[\"catch\"](function (err) {\n console.error(err);\n });\n }\n }, {\n key: \"registerUser\",\n value: function registerUser(user) {\n var _this3 = this;\n\n axios__WEBPACK_IMPORTED_MODULE_8___default.a.post('/api/auth/signup', user).then(function (response) {\n console.log(response);\n\n if (response.data) {\n console.log('succesful signup');\n\n _this3.setState({\n redirectTo: '/login'\n });\n } else {\n console.log('signup error');\n }\n })[\"catch\"](function (err) {\n console.log('sign up server error', err);\n });\n }\n }, {\n key: \"loginUser\",\n value: function loginUser(username, password) {\n var _this4 = this;\n\n this.Auth.login(username, password).then(function (res) {\n console.log(res);\n\n _this4.setState({\n isLoggedin: true,\n userId: res.id,\n username: res.username\n });\n })[\"catch\"](function (err) {\n alert('The username and password you entered did not match our records. Please double-check and try again.');\n });\n }\n }, {\n key: \"logOutUser\",\n value: function logOutUser() {\n this.Auth.logout();\n this.setState({\n isLoggedin: false,\n userId: null,\n redirectTo: '/login'\n });\n }\n }, {\n key: \"render\",\n value: function render() {\n var _this5 = this;\n\n return react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(react_router_dom__WEBPACK_IMPORTED_MODULE_7__[\"BrowserRouter\"], null, this.state.isLoggedin ? react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"div\", null, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_components_UserHeader_jsx__WEBPACK_IMPORTED_MODULE_10__[\"default\"], {\n logOutUser: this.logOutUser,\n userId: this.state.userId,\n points: this.state.points,\n username: this.state.username\n }), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_components_DashBody_jsx__WEBPACK_IMPORTED_MODULE_4__[\"default\"], {\n auth: this.Auth,\n userId: this.state.userId,\n username: this.state.username,\n updatePoints: this.updatePoints,\n getUserPoints: this.getUserPoints,\n points: this.state.points\n }), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(react_router_dom__WEBPACK_IMPORTED_MODULE_7__[\"Route\"], {\n exact: true,\n path: \"/dashboard\"\n })) : react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"div\", {\n className: \"intro-body\"\n }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_components_DashboardHeader_jsx__WEBPACK_IMPORTED_MODULE_3__[\"default\"], {\n isLoggedin: this.state.isLoggedin,\n logOutUser: this.logOutUser\n }), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(react_router_dom__WEBPACK_IMPORTED_MODULE_7__[\"Route\"], {\n path: \"/register\",\n render: function render(routeProps) {\n return react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_components_Register_jsx__WEBPACK_IMPORTED_MODULE_6__[\"default\"], _extends({}, routeProps, {\n registerUser: _this5.registerUser\n }));\n }\n }), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(react_router_dom__WEBPACK_IMPORTED_MODULE_7__[\"Route\"], {\n path: \"/login\",\n render: function render(routeProps) {\n return react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_components_Login_jsx__WEBPACK_IMPORTED_MODULE_5__[\"default\"], _extends({}, routeProps, {\n Auth: _this5.Auth,\n isLoggedin: _this5.state.isLoggedin,\n loginUser: _this5.loginUser\n }));\n }\n })));\n }\n }]);\n\n return App;\n}(react__WEBPACK_IMPORTED_MODULE_0___default.a.Component);\n\nreact_dom__WEBPACK_IMPORTED_MODULE_1___default.a.render(react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(App, null), document.getElementById('root'));\n\n//# sourceURL=webpack:///./client/src/index.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 react_dom__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react-dom */ \"./node_modules/react-dom/index.js\");\n/* harmony import */ var react_dom__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react_dom__WEBPACK_IMPORTED_MODULE_1__);\n/* harmony import */ var _material_ui_core_Button__WEBPACK_IMPORTED_MODULE_2__ = __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_2___default = /*#__PURE__*/__webpack_require__.n(_material_ui_core_Button__WEBPACK_IMPORTED_MODULE_2__);\n/* harmony import */ var _components_DashboardHeader_jsx__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./components/DashboardHeader.jsx */ \"./client/src/components/DashboardHeader.jsx\");\n/* harmony import */ var _components_DashBody_jsx__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./components/DashBody.jsx */ \"./client/src/components/DashBody.jsx\");\n/* harmony import */ var _components_Login_jsx__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./components/Login.jsx */ \"./client/src/components/Login.jsx\");\n/* harmony import */ var _components_Register_jsx__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./components/Register.jsx */ \"./client/src/components/Register.jsx\");\n/* harmony import */ var react_router_dom__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! react-router-dom */ \"./node_modules/react-router-dom/esm/react-router-dom.js\");\n/* harmony import */ var axios__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! axios */ \"./node_modules/axios/index.js\");\n/* harmony import */ var axios__WEBPACK_IMPORTED_MODULE_8___default = /*#__PURE__*/__webpack_require__.n(axios__WEBPACK_IMPORTED_MODULE_8__);\n/* harmony import */ var _components_AuthService_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./components/AuthService.js */ \"./client/src/components/AuthService.js\");\n/* harmony import */ var _components_UserHeader_jsx__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./components/UserHeader.jsx */ \"./client/src/components/UserHeader.jsx\");\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 _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }\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 //Material UI stuff\n\nvar styles = {\n paperContainer: {\n backgroundImage: \"url(\".concat(Image, \")\")\n }\n};\n\nvar App =\n/*#__PURE__*/\nfunction (_React$Component) {\n _inherits(App, _React$Component);\n\n function App(props) {\n var _this;\n\n _classCallCheck(this, App);\n\n _this = _possibleConstructorReturn(this, _getPrototypeOf(App).call(this, props));\n _this.state = {\n isLoggedin: false,\n userId: null,\n redirectTo: '',\n username: '',\n points: null\n };\n _this.registerUser = _this.registerUser.bind(_assertThisInitialized(_this));\n _this.loginUser = _this.loginUser.bind(_assertThisInitialized(_this));\n _this.logOutUser = _this.logOutUser.bind(_assertThisInitialized(_this));\n _this.getUserPoints = _this.getUserPoints.bind(_assertThisInitialized(_this));\n _this.Auth = new _components_AuthService_js__WEBPACK_IMPORTED_MODULE_9__[\"default\"]();\n _this.showModal = _this.showModal.bind(_assertThisInitialized(_this));\n return _this;\n }\n\n _createClass(App, [{\n key: \"componentWillMount\",\n value: function componentWillMount() {// if (this.Auth.loggedIn()){\n // this.setState({\n // isLoggedin: true,\n // redirectTo: '/dashboard'\n // })\n // } else{\n // this.setState({\n // isLoggedin: false\n // })\n // }\n }\n }, {\n key: \"showModal\",\n value: function showModal() {\n console.log('modal');\n }\n }, {\n key: \"getUserPoints\",\n value: function getUserPoints() {\n var _this2 = this;\n\n this.Auth.fetch(\"/api/users/\".concat(this.state.userId)).then(function (user) {\n _this2.setState({\n points: user.points\n });\n })[\"catch\"](function (err) {\n console.error(err);\n });\n }\n }, {\n key: \"registerUser\",\n value: function registerUser(user) {\n var _this3 = this;\n\n axios__WEBPACK_IMPORTED_MODULE_8___default.a.post('/api/auth/signup', user).then(function (response) {\n console.log(response);\n\n if (response.data) {\n console.log('succesful signup');\n\n _this3.setState({\n redirectTo: '/login'\n });\n } else {\n console.log('signup error');\n }\n })[\"catch\"](function (err) {\n console.log('sign up server error', err);\n });\n }\n }, {\n key: \"loginUser\",\n value: function loginUser(username, password) {\n var _this4 = this;\n\n this.Auth.login(username, password).then(function (res) {\n console.log(res);\n\n _this4.setState({\n isLoggedin: true,\n userId: res.id,\n username: res.username\n });\n })[\"catch\"](function (err) {\n alert('The username and password you entered did not match our records. Please double-check and try again.');\n });\n }\n }, {\n key: \"logOutUser\",\n value: function logOutUser() {\n this.Auth.logout();\n this.setState({\n isLoggedin: false,\n userId: null,\n redirectTo: '/login'\n });\n }\n }, {\n key: \"render\",\n value: function render() {\n var _this5 = this;\n\n return react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(react_router_dom__WEBPACK_IMPORTED_MODULE_7__[\"BrowserRouter\"], null, this.state.isLoggedin ? react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"div\", null, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_components_UserHeader_jsx__WEBPACK_IMPORTED_MODULE_10__[\"default\"], {\n logOutUser: this.logOutUser,\n userId: this.state.userId,\n points: this.state.points,\n username: this.state.username\n }), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_components_DashBody_jsx__WEBPACK_IMPORTED_MODULE_4__[\"default\"], {\n auth: this.Auth,\n userId: this.state.userId,\n username: this.state.username,\n updatePoints: this.updatePoints,\n getUserPoints: this.getUserPoints,\n points: this.state.points\n }), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(react_router_dom__WEBPACK_IMPORTED_MODULE_7__[\"Route\"], {\n exact: true,\n path: \"/dashboard\"\n })) : react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"div\", {\n className: \"intro-body\"\n }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_components_DashboardHeader_jsx__WEBPACK_IMPORTED_MODULE_3__[\"default\"], {\n isLoggedin: this.state.isLoggedin,\n logOutUser: this.logOutUser\n }), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(react_router_dom__WEBPACK_IMPORTED_MODULE_7__[\"Route\"], {\n path: \"/register\",\n render: function render(routeProps) {\n return react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_components_Register_jsx__WEBPACK_IMPORTED_MODULE_6__[\"default\"], _extends({}, routeProps, {\n registerUser: _this5.registerUser\n }));\n }\n }), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(react_router_dom__WEBPACK_IMPORTED_MODULE_7__[\"Route\"], {\n path: \"/login\",\n render: function render(routeProps) {\n return react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_components_Login_jsx__WEBPACK_IMPORTED_MODULE_5__[\"default\"], _extends({}, routeProps, {\n Auth: _this5.Auth,\n isLoggedin: _this5.state.isLoggedin,\n loginUser: _this5.loginUser\n }));\n }\n })));\n }\n }]);\n\n return App;\n}(react__WEBPACK_IMPORTED_MODULE_0___default.a.Component);\n\nreact_dom__WEBPACK_IMPORTED_MODULE_1___default.a.render(react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(App, null), document.getElementById('root'));\n\n//# sourceURL=webpack:///./client/src/index.jsx?"); /***/ }), diff --git a/client/dist/help_icon.png b/client/dist/help_icon.png new file mode 100644 index 0000000..ab6d56b Binary files /dev/null and b/client/dist/help_icon.png differ diff --git a/client/dist/styles.css b/client/dist/styles.css index 0cbff07..7479984 100644 --- a/client/dist/styles.css +++ b/client/dist/styles.css @@ -59,4 +59,42 @@ display: block; #contact-list{ font-family: 'Oswald', sans-serif; +} + +#help:hover{ +width: 18px; +cursor: pointer; +} + +.modal { + position: fixed; + top: 0; + left: 0; + width:100%; + height: 100%; + background: rgba(0, 0, 0, 0.6); +} + +.modal-main { + position:fixed; + background: white; + width: 60%; + height: auto; + top:50%; + left:50%; + transform: translate(-50%,-50%); + z-index: 10; + border-radius: 6px; + padding: 10px; +} + +.display-block { + display: block; + z-index: 10; + +} + +.display-none { + display: none; + } \ No newline at end of file diff --git a/client/src/components/ButtonList.jsx b/client/src/components/ButtonList.jsx index f440a86..9de82c5 100644 --- a/client/src/components/ButtonList.jsx +++ b/client/src/components/ButtonList.jsx @@ -9,20 +9,78 @@ import DeleteIcon from '@material-ui/icons/Delete'; import NavigationIcon from '@material-ui/icons/Navigation'; -const ButtonList = ({selectView, uploadedView, purchasedView, renderContactList }) => { - const styles = theme => ({ - margin: { - margin: theme.spacing.unit, - }, - extendedIcon: { - marginRight: theme.spacing.unit, - }, - }); +//selectView, uploadedView, purchasedView, renderContactList +const styles = theme => ({ + margin: { + margin: theme.spacing.unit, + }, + extendedIcon: { + marginRight: theme.spacing.unit, + }, +}); + + +const Modal = ({ handleClose, show, children }) => { + const showHideClassName = show ? "modal display-block" : "modal display-none"; return ( +
Click to see a list of all the contacts that you have uploaded to the databse. You also have access to a notepad for each different user + that will only be visible to you. +
+Once you have purchased a contact this section will show you all the relevant contact information, along with a notes section where you can keep track of when you have contacted this person.
+Will show a form where you can upload new contacts and obtain one point per contact uploaded. Please be sure to fill out all relevant information accurately. + The contacts will be verified upon submission and if the person's name and phone number do not match your contact will not be verified.
+Will show a form where you can search contacts by name, company, industry, position, or address. You can fill one, any or all of the fields available.
+Dashboard + +