diff --git a/assets/dist/index.js b/assets/dist/index.js index 19ec543..3e54bc7 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: \"http://localhost:8000\",\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://placehold.it/200x200\",\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_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://placehold.it/200x200\",\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?"); /***/ }), diff --git a/assets/jsx/index.jsx b/assets/jsx/index.jsx index 09eb66d..989ec48 100644 --- a/assets/jsx/index.jsx +++ b/assets/jsx/index.jsx @@ -55,7 +55,7 @@ class App extends React.Component { }