diff --git a/assets/dist/index.js b/assets/dist/index.js index ae13142..ddb8515 100644 --- a/assets/dist/index.js +++ b/assets/dist/index.js @@ -16,7 +16,7 @@ /***/ ((__unused_webpack_module, __unused_webpack___webpack_exports__, __webpack_require__) => { "use strict"; -eval("/* 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_client__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react-dom/client */ \"./node_modules/react-dom/client.js\");\n/* harmony import */ var ttag__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ttag */ \"./node_modules/ttag/index.js\");\n/* harmony import */ var ttag__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(ttag__WEBPACK_IMPORTED_MODULE_2__);\n/* harmony import */ var p2pu_components_dist_Search_SearchProvider__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! p2pu-components/dist/Search/SearchProvider */ \"./p2pu-components/dist/Search/SearchProvider.js\");\n/* harmony import */ var p2pu_components_dist_LearningCircleSignup_LearningCircleSignup__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! p2pu-components/dist/LearningCircleSignup/LearningCircleSignup */ \"./p2pu-components/dist/LearningCircleSignup/LearningCircleSignup.js\");\n/* harmony import */ var p2pu_components_dist_LearningCircles_Browse__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! p2pu-components/dist/LearningCircles/Browse */ \"./p2pu-components/dist/LearningCircles/Browse.js\");\n/* harmony import */ var p2pu_components_dist_Search_DefaultNoResults__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! p2pu-components/dist/Search/DefaultNoResults */ \"./p2pu-components/dist/Search/DefaultNoResults.js\");\nfunction _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }\n\n\n\n\n\n\n\n\n\n\n//import \"p2pu-components/dist/build.css\"\n\nconst CustomSearch = props => {\n return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement((react__WEBPACK_IMPORTED_MODULE_0___default().Fragment), null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(p2pu_components_dist_LearningCircles_Browse__WEBPACK_IMPORTED_MODULE_3__[\"default\"], _extends({}, props, {\n NoResultsComponent: p2pu_components_dist_Search_DefaultNoResults__WEBPACK_IMPORTED_MODULE_4__[\"default\"]\n })));\n};\nclass App extends (react__WEBPACK_IMPORTED_MODULE_0___default().Component) {\n constructor(props) {\n super(props);\n this.handleLearningCircleSelection = this.handleLearningCircleSelection.bind(this);\n this.handleSignupDialogClose = this.handleSignupDialogClose.bind(this);\n this.state = {\n selectedLearningCircle: null\n };\n }\n handleLearningCircleSelection(learningCircle) {\n console.log(`Clicked on ${learningCircle.url}`);\n this.setState({\n ...this.state,\n selectedLearningCircle: learningCircle\n });\n }\n handleSignupDialogClose(learningCircle) {\n this.setState({\n ...this.state,\n selectedLearningCircle: null\n });\n }\n render() {\n return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"div\", null, this.state.selectedLearningCircle && /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(p2pu_components_dist_LearningCircleSignup_LearningCircleSignup__WEBPACK_IMPORTED_MODULE_5__[\"default\"], {\n onCancel: this.handleSignupDialogClose,\n learningCircle: this.state.selectedLearningCircle,\n signUpUrl: \"https://learningcircles.p2pu.org/api/signup/\"\n }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"div\", {\n className: this.state.selectedLearningCircle ? 'd-none' : ''\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(p2pu_components_dist_Search_SearchProvider__WEBPACK_IMPORTED_MODULE_6__[\"default\"], {\n origin: \"https://learningcircles.p2pu.org\",\n initialState: {\n team_id: 46\n },\n searchSubject: 'learningCircles',\n locale: \"en\",\n defaultImageUrl: \"/assets/img/p2pu-ogimg-default.jpg\",\n onSelectResult: this.handleLearningCircleSelection\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(CustomSearch, null))));\n }\n}\n;\nconst lcRoot = (0,react_dom_client__WEBPACK_IMPORTED_MODULE_1__.createRoot)(document.getElementById(\"learning-circle-search\"));\nlcRoot.render( /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(App, null));\nconst FacilitatorCard = ({\n image,\n name,\n bio\n}) => {\n return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"div\", {\n className: \"facilitator-card col-8 offset-2 col-lg-4 offset-lg-4\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"img\", {\n className: \"rounded-circle\",\n width: \"200\",\n height: \"200\",\n src: image\n }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"div\", {\n className: \"profile\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"h2\", null, name), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"p\", null, bio)));\n};\nconst Facilitators = props => {\n // `${API_ORIGIN}/api/teams/${TEAM_ID}/`\n const [facilitators, setFacilitators] = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)([]);\n (0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)(() => {\n fetch(`${props.API_ORIGIN}/api/teams/${props.teamId}/`).then(resp => {\n // TODO errors and stuff\n return resp.json();\n }).then(data => {\n setFacilitators(data.item.facilitators);\n });\n }, []);\n return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"div\", {\n id: \"carouselExampleFade\",\n class: \"carousel carousel-dark slide\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"div\", {\n class: \"carousel-inner\"\n }, facilitators.map((fa, idx) => /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"div\", {\n class: \"carousel-item\" + (idx == 0 ? \" active\" : \"\")\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(FacilitatorCard, {\n image: fa.avatar_url ? fa.avatar_url : \"https://learningcircles.p2pu.org/static/images/avatars/p2pu_avatar_blue.png\",\n name: fa.first_name,\n bio: fa.bio\n })))), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"button\", {\n class: \"carousel-control-prev\",\n type: \"button\",\n \"data-bs-target\": \"#carouselExampleFade\",\n \"data-bs-slide\": \"prev\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"span\", {\n class: \"carousel-control-prev-icon\",\n \"aria-hidden\": \"true\"\n }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"span\", {\n class: \"visually-hidden\"\n }, \"Previous\")), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"button\", {\n class: \"carousel-control-next\",\n type: \"button\",\n \"data-bs-target\": \"#carouselExampleFade\",\n \"data-bs-slide\": \"next\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"span\", {\n class: \"carousel-control-next-icon\",\n \"aria-hidden\": \"true\"\n }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"span\", {\n class: \"visually-hidden\"\n }, \"Next\")));\n};\nconst facilitatorsRoot = (0,react_dom_client__WEBPACK_IMPORTED_MODULE_1__.createRoot)(document.getElementById(\"team-facilitators\"));\nfacilitatorsRoot.render( /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(Facilitators, {\n API_ORIGIN: \"https://learningcircles.p2pu.org\",\n teamId: \"46\"\n}));\n\n//# sourceURL=webpack://digital-detroit/./assets/jsx/index.jsx?"); +eval("/* 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_client__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react-dom/client */ \"./node_modules/react-dom/client.js\");\n/* harmony import */ var ttag__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ttag */ \"./node_modules/ttag/index.js\");\n/* harmony import */ var ttag__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(ttag__WEBPACK_IMPORTED_MODULE_2__);\n/* harmony import */ var p2pu_components_dist_Search_SearchProvider__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! p2pu-components/dist/Search/SearchProvider */ \"./p2pu-components/dist/Search/SearchProvider.js\");\n/* harmony import */ var p2pu_components_dist_LearningCircleSignup_LearningCircleSignup__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! p2pu-components/dist/LearningCircleSignup/LearningCircleSignup */ \"./p2pu-components/dist/LearningCircleSignup/LearningCircleSignup.js\");\n/* harmony import */ var p2pu_components_dist_LearningCircles_Browse__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! p2pu-components/dist/LearningCircles/Browse */ \"./p2pu-components/dist/LearningCircles/Browse.js\");\nfunction _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }\n\n\n\n\n\n\n\n\n\n//import \"p2pu-components/dist/build.css\"\n\nconst NoNoResultsComponent = props => /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement((react__WEBPACK_IMPORTED_MODULE_0___default().Fragment), null);\nconst CustomSearch = props => {\n return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement((react__WEBPACK_IMPORTED_MODULE_0___default().Fragment), null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(p2pu_components_dist_LearningCircles_Browse__WEBPACK_IMPORTED_MODULE_3__[\"default\"], _extends({}, props, {\n NoResultsComponent: NoNoResultsComponent\n })));\n};\nclass App extends (react__WEBPACK_IMPORTED_MODULE_0___default().Component) {\n constructor(props) {\n super(props);\n this.handleLearningCircleSelection = this.handleLearningCircleSelection.bind(this);\n this.handleSignupDialogClose = this.handleSignupDialogClose.bind(this);\n this.state = {\n selectedLearningCircle: null\n };\n }\n handleLearningCircleSelection(learningCircle) {\n console.log(`Clicked on ${learningCircle.url}`);\n this.setState({\n ...this.state,\n selectedLearningCircle: learningCircle\n });\n }\n handleSignupDialogClose(learningCircle) {\n this.setState({\n ...this.state,\n selectedLearningCircle: null\n });\n }\n render() {\n return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"div\", null, this.state.selectedLearningCircle && /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(p2pu_components_dist_LearningCircleSignup_LearningCircleSignup__WEBPACK_IMPORTED_MODULE_4__[\"default\"], {\n onCancel: this.handleSignupDialogClose,\n learningCircle: this.state.selectedLearningCircle,\n signUpUrl: \"https://learningcircles.p2pu.org/api/signup/\"\n }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"div\", {\n className: this.state.selectedLearningCircle ? 'd-none' : ''\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(p2pu_components_dist_Search_SearchProvider__WEBPACK_IMPORTED_MODULE_5__[\"default\"], {\n origin: \"https://learningcircles.p2pu.org\",\n initialState: {\n team_id: 46\n },\n searchSubject: 'learningCircles',\n locale: \"en\",\n defaultImageUrl: \"/assets/img/p2pu-ogimg-default.jpg\"\n //onSelectResult={this.handleLearningCircleSelection}\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(CustomSearch, null))));\n }\n}\n;\nconst lcRoot = (0,react_dom_client__WEBPACK_IMPORTED_MODULE_1__.createRoot)(document.getElementById(\"learning-circle-search\"));\nlcRoot.render( /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(App, null));\nconst FacilitatorCard = ({\n image,\n name,\n bio\n}) => {\n return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"div\", {\n className: \"facilitator-card col-8 offset-2 col-lg-4 offset-lg-4\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"img\", {\n className: \"rounded-circle\",\n width: \"200\",\n height: \"200\",\n src: image\n }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"div\", {\n className: \"profile\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"h2\", null, name), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"p\", null, bio)));\n};\nconst Facilitators = props => {\n // `${API_ORIGIN}/api/teams/${TEAM_ID}/`\n const [facilitators, setFacilitators] = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)([]);\n (0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)(() => {\n fetch(`${props.API_ORIGIN}/api/teams/${props.teamId}/`).then(resp => {\n // TODO errors and stuff\n return resp.json();\n }).then(data => {\n setFacilitators(data.item.facilitators);\n });\n }, []);\n return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"div\", {\n id: \"carouselExampleFade\",\n class: \"carousel carousel-dark slide\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"div\", {\n class: \"carousel-inner\"\n }, facilitators.map((fa, idx) => /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"div\", {\n class: \"carousel-item\" + (idx == 0 ? \" active\" : \"\")\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(FacilitatorCard, {\n image: fa.avatar_url ? fa.avatar_url : \"https://learningcircles.p2pu.org/static/images/avatars/p2pu_avatar_blue.png\",\n name: fa.first_name,\n bio: fa.bio\n })))), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"button\", {\n class: \"carousel-control-prev\",\n type: \"button\",\n \"data-bs-target\": \"#carouselExampleFade\",\n \"data-bs-slide\": \"prev\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"span\", {\n class: \"carousel-control-prev-icon\",\n \"aria-hidden\": \"true\"\n }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"span\", {\n class: \"visually-hidden\"\n }, \"Previous\")), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"button\", {\n class: \"carousel-control-next\",\n type: \"button\",\n \"data-bs-target\": \"#carouselExampleFade\",\n \"data-bs-slide\": \"next\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"span\", {\n class: \"carousel-control-next-icon\",\n \"aria-hidden\": \"true\"\n }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"span\", {\n class: \"visually-hidden\"\n }, \"Next\")));\n};\nconst facilitatorsRoot = (0,react_dom_client__WEBPACK_IMPORTED_MODULE_1__.createRoot)(document.getElementById(\"team-facilitators\"));\nfacilitatorsRoot.render( /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(Facilitators, {\n API_ORIGIN: \"https://learningcircles.p2pu.org\",\n teamId: \"46\"\n}));\n\n//# sourceURL=webpack://digital-detroit/./assets/jsx/index.jsx?"); /***/ }), @@ -163,17 +163,6 @@ eval("/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harm /***/ }), -/***/ "./p2pu-components/dist/Search/DefaultNoResults.js": -/*!*********************************************************!*\ - !*** ./p2pu-components/dist/Search/DefaultNoResults.js ***! - \*********************************************************/ -/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { - -"use strict"; -eval("/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (__WEBPACK_DEFAULT_EXPORT__)\n/* harmony export */ });\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 ttag__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ttag */ \"./node_modules/ttag/index.js\");\n/* harmony import */ var ttag__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(ttag__WEBPACK_IMPORTED_MODULE_1__);\n/* harmony import */ var _utils_constants__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../utils/constants */ \"./p2pu-components/dist/utils/constants.js\");\nvar _templateObject, _templateObject2, _templateObject3;\nfunction _taggedTemplateLiteral(strings, raw) {\n if (!raw) {\n raw = strings.slice(0);\n }\n return Object.freeze(Object.defineProperties(strings, {\n raw: {\n value: Object.freeze(raw)\n }\n }));\n}\n\n\n\nvar DefaultNoResults = function DefaultNoResults(props) {\n var renderLinks = function renderLinks() {\n var links = [];\n if (props.updateResultsTab) {\n var otherTab = props.tabIndex === 0 ? 1 : 0;\n var otherTabName = otherTab === 0 ? _utils_constants__WEBPACK_IMPORTED_MODULE_2__.OPEN_TAB_TEXT : _utils_constants__WEBPACK_IMPORTED_MODULE_2__.CLOSED_TAB_TEXT;\n links.push( /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"button\", {\n key: \"reset-btn\",\n className: \"btn p2pu-btn btn-sm dark d-inline-flex align-items-center py-2 px-3\",\n onClick: function onClick() {\n return props.updateResultsTab(otherTab);\n }\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"span\", {\n className: \"material-icons mr-1\"\n }, \"arrow_forward\"), (0,ttag__WEBPACK_IMPORTED_MODULE_1__.t)(_templateObject || (_templateObject = _taggedTemplateLiteral([\"View \", \" learning circles\"])), otherTabName)));\n }\n if (props.contact) {\n links.push( /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"a\", {\n key: \"contact-btn\",\n href: \"mailto:\".concat(props.contact),\n className: \"btn p2pu-btn btn-sm dark d-inline-flex align-items-center py-2 px-3\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"span\", {\n className: \"material-icons mr-1\"\n }, \"alternate_email\"), (0,ttag__WEBPACK_IMPORTED_MODULE_1__.t)(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral([\"Contact this team\"])))));\n }\n return links;\n };\n return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"div\", {\n className: \"my-4\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"p\", null, (0,ttag__WEBPACK_IMPORTED_MODULE_1__.t)(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral([\"There are no learning circles available right now.\"])))), renderLinks());\n};\n/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (DefaultNoResults);\n\n//# sourceURL=webpack://digital-detroit/./p2pu-components/dist/Search/DefaultNoResults.js?"); - -/***/ }), - /***/ "./p2pu-components/dist/Search/SearchProvider.js": /*!*******************************************************!*\ !*** ./p2pu-components/dist/Search/SearchProvider.js ***!