|
- (function() {
- var exports = {};
- exports.id = 215;
- exports.ids = [215];
- exports.modules = {
-
- /***/ 578:
- /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
-
- "use strict";
- // ESM COMPAT FLAG
- __webpack_require__.r(__webpack_exports__);
-
- // EXPORTS
- __webpack_require__.d(__webpack_exports__, {
- "default": function() { return /* binding */ Product_Motor; },
- "getServerSideProps": function() { return /* binding */ getServerSideProps; }
- });
-
- // EXTERNAL MODULE: external "react/jsx-runtime"
- var jsx_runtime_ = __webpack_require__(5282);
- // EXTERNAL MODULE: external "react"
- var external_react_ = __webpack_require__(9297);
- // EXTERNAL MODULE: ./components/_App/NavbarYamaha.js
- var NavbarYamaha = __webpack_require__(2478);
- // EXTERNAL MODULE: ./components/_App/FooterYamaha.js
- var FooterYamaha = __webpack_require__(362);
- // EXTERNAL MODULE: ./components/Common/PageBanner.js
- var PageBanner = __webpack_require__(1288);
- // EXTERNAL MODULE: ./node_modules/next/link.js
- var next_link = __webpack_require__(1664);
- // EXTERNAL MODULE: external "react-feather"
- var external_react_feather_ = __webpack_require__(9337);
- // EXTERNAL MODULE: external "react-redux"
- var external_react_redux_ = __webpack_require__(79);
- // EXTERNAL MODULE: ./components/Shop/AddToCartBtn.js
- var AddToCartBtn = __webpack_require__(2337);
- // EXTERNAL MODULE: external "react-number-format"
- var external_react_number_format_ = __webpack_require__(3230);
- var external_react_number_format_default = /*#__PURE__*/__webpack_require__.n(external_react_number_format_);
- ;// CONCATENATED MODULE: ./components/Yamaha/Product/Motor.js
-
-
-
- function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }
-
- function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
-
- function _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; }
-
- function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
-
- function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
-
-
-
-
-
-
-
-
- const ProductCard = function (_ref) {
- let {
- product,
- backend,
- user
- } = _ref,
- props = _objectWithoutProperties(_ref, ["product", "backend", "user"]);
-
- const products = (0,external_react_redux_.useSelector)(state => state.products);
- console.log(product);
- const Product = product.map(data => {
- return /*#__PURE__*/jsx_runtime_.jsx("div", {
- className: "col-lg-3 col-md-6 col-sm-6",
- children: /*#__PURE__*/(0,jsx_runtime_.jsxs)("div", {
- className: "single-products",
- children: [/*#__PURE__*/(0,jsx_runtime_.jsxs)("div", {
- className: "products-image",
- children: [/*#__PURE__*/jsx_runtime_.jsx("img", {
- src: `${backend}${data.img[0]["url"]}`
- }), /*#__PURE__*/(0,jsx_runtime_.jsxs)("ul", {
- children: [/*#__PURE__*/jsx_runtime_.jsx("li", {
- children: /*#__PURE__*/jsx_runtime_.jsx("a", {
- href: "#",
- children: /*#__PURE__*/jsx_runtime_.jsx(external_react_feather_.Search, {})
- })
- }), /*#__PURE__*/jsx_runtime_.jsx("li", {
- children: /*#__PURE__*/jsx_runtime_.jsx("a", {
- href: "#",
- children: /*#__PURE__*/jsx_runtime_.jsx(external_react_feather_.Heart, {})
- })
- }), /*#__PURE__*/jsx_runtime_.jsx("li", {
- children: /*#__PURE__*/jsx_runtime_.jsx(next_link.default, {
- href: "/products/[id]",
- as: `/products/${product.id}`,
- children: /*#__PURE__*/jsx_runtime_.jsx("a", {
- children: /*#__PURE__*/jsx_runtime_.jsx(external_react_feather_.Link, {})
- })
- })
- })]
- })]
- }), /*#__PURE__*/(0,jsx_runtime_.jsxs)("div", {
- className: "products-content",
- children: [/*#__PURE__*/jsx_runtime_.jsx("h3", {
- children: /*#__PURE__*/jsx_runtime_.jsx(next_link.default, {
- href: "/yamaha/Product/Motor_Detail?s=" + data.id,
- children: /*#__PURE__*/jsx_runtime_.jsx("a", {
- children: data.name
- })
- })
- }), /*#__PURE__*/(0,jsx_runtime_.jsxs)("span", {
- children: [/*#__PURE__*/jsx_runtime_.jsx((external_react_number_format_default()), {
- value: data.price,
- displayType: 'text',
- thousandSeparator: true,
- prefix: 'Rp.'
- }), " s/d ", /*#__PURE__*/jsx_runtime_.jsx((external_react_number_format_default()), {
- value: data.price2,
- displayType: 'text',
- thousandSeparator: true,
- prefix: 'Rp.'
- })]
- }), /*#__PURE__*/(0,jsx_runtime_.jsxs)("ul", {
- children: [/*#__PURE__*/jsx_runtime_.jsx("li", {
- children: /*#__PURE__*/jsx_runtime_.jsx("i", {
- className: "flaticon-star-1"
- })
- }), /*#__PURE__*/jsx_runtime_.jsx("li", {
- children: /*#__PURE__*/jsx_runtime_.jsx("i", {
- className: "flaticon-star-1"
- })
- }), /*#__PURE__*/jsx_runtime_.jsx("li", {
- children: /*#__PURE__*/jsx_runtime_.jsx("i", {
- className: "flaticon-star-1"
- })
- }), /*#__PURE__*/jsx_runtime_.jsx("li", {
- children: /*#__PURE__*/jsx_runtime_.jsx("i", {
- className: "flaticon-star-1"
- })
- }), /*#__PURE__*/jsx_runtime_.jsx("li", {
- children: /*#__PURE__*/jsx_runtime_.jsx("i", {
- className: "flaticon-star-1"
- })
- })]
- }), /*#__PURE__*/jsx_runtime_.jsx(AddToCartBtn/* default */.Z, _objectSpread({}, product))]
- })]
- })
- }, product.id);
- });
- return /*#__PURE__*/jsx_runtime_.jsx("div", {
- className: "shop-area ptb-80",
- children: /*#__PURE__*/(0,jsx_runtime_.jsxs)("div", {
- className: "container",
- children: [/*#__PURE__*/jsx_runtime_.jsx("div", {
- className: "woocommerce-topbar",
- children: /*#__PURE__*/(0,jsx_runtime_.jsxs)("div", {
- className: "row align-items-center",
- children: [/*#__PURE__*/jsx_runtime_.jsx("div", {
- className: "col-lg-9 col-md-7 col-sm-7",
- children: /*#__PURE__*/jsx_runtime_.jsx("div", {
- className: "woocommerce-result-count",
- children: /*#__PURE__*/jsx_runtime_.jsx("p", {
- children: "Showing 1-8 of 14 results"
- })
- })
- }), /*#__PURE__*/jsx_runtime_.jsx("div", {
- className: "col-lg-3 col-md-5 col-sm-5",
- children: /*#__PURE__*/jsx_runtime_.jsx("div", {
- className: "woocommerce-topbar-ordering",
- children: /*#__PURE__*/(0,jsx_runtime_.jsxs)("select", {
- className: "form-select",
- children: [/*#__PURE__*/jsx_runtime_.jsx("option", {
- value: "1",
- children: "Sort by Popularity"
- }), /*#__PURE__*/jsx_runtime_.jsx("option", {
- value: "2",
- children: "Sort by Average Rating"
- }), /*#__PURE__*/jsx_runtime_.jsx("option", {
- value: "3",
- children: "Sort by Latest"
- }), /*#__PURE__*/jsx_runtime_.jsx("option", {
- value: "4",
- children: "Sort by price: Low to High"
- }), /*#__PURE__*/jsx_runtime_.jsx("option", {
- value: "5",
- children: "Sort by price: High to Low"
- }), /*#__PURE__*/jsx_runtime_.jsx("option", {
- value: "6",
- children: "Sort by New"
- })]
- })
- })
- })]
- })
- }), /*#__PURE__*/(0,jsx_runtime_.jsxs)("div", {
- className: "row justify-content-md-center",
- children: [Product, /*#__PURE__*/jsx_runtime_.jsx("div", {
- className: "col-lg-12 col-md-12 col-sm-12",
- children: /*#__PURE__*/jsx_runtime_.jsx("div", {
- className: "pagination-area",
- children: /*#__PURE__*/jsx_runtime_.jsx("nav", {
- "aria-label": "Page navigation",
- children: /*#__PURE__*/(0,jsx_runtime_.jsxs)("ul", {
- className: "pagination justify-content-center",
- children: [/*#__PURE__*/jsx_runtime_.jsx("li", {
- className: "page-item",
- children: /*#__PURE__*/jsx_runtime_.jsx("a", {
- className: "page-link",
- href: "#",
- children: "Prev"
- })
- }), /*#__PURE__*/jsx_runtime_.jsx("li", {
- className: "page-item active",
- children: /*#__PURE__*/jsx_runtime_.jsx("a", {
- className: "page-link",
- href: "#",
- children: "1"
- })
- }), /*#__PURE__*/jsx_runtime_.jsx("li", {
- className: "page-item",
- children: /*#__PURE__*/jsx_runtime_.jsx("a", {
- className: "page-link",
- href: "#",
- children: "2"
- })
- }), /*#__PURE__*/jsx_runtime_.jsx("li", {
- className: "page-item",
- children: /*#__PURE__*/jsx_runtime_.jsx("a", {
- className: "page-link",
- href: "#",
- children: "3"
- })
- }), /*#__PURE__*/jsx_runtime_.jsx("li", {
- className: "page-item",
- children: /*#__PURE__*/jsx_runtime_.jsx("a", {
- className: "page-link",
- href: "#",
- children: "Next"
- })
- })]
- })
- })
- })
- })]
- })]
- })
- });
- };
-
- /* harmony default export */ var Motor = (ProductCard);
- // EXTERNAL MODULE: ./api/product/product.js
- var product_product = __webpack_require__(9965);
- var product_default = /*#__PURE__*/__webpack_require__.n(product_product);
- // EXTERNAL MODULE: external "cookies"
- var external_cookies_ = __webpack_require__(9038);
- var external_cookies_default = /*#__PURE__*/__webpack_require__.n(external_cookies_);
- ;// CONCATENATED MODULE: ./pages/yamaha/Product/Motor.js
-
-
-
-
- function Motor_objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = Motor_objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
-
- function Motor_objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
-
-
-
-
-
-
-
-
-
- const Shop = function (_ref) {
- let {
- product,
- backend,
- user
- } = _ref,
- props = Motor_objectWithoutProperties(_ref, ["product", "backend", "user"]);
-
- return /*#__PURE__*/(0,jsx_runtime_.jsxs)(jsx_runtime_.Fragment, {
- children: [/*#__PURE__*/jsx_runtime_.jsx(NavbarYamaha/* default */.Z, {}), /*#__PURE__*/jsx_runtime_.jsx(PageBanner/* default */.Z, {
- pageTitle: "Products"
- }), /*#__PURE__*/jsx_runtime_.jsx(Motor, {
- product: product,
- backend: backend,
- user: user
- }), /*#__PURE__*/jsx_runtime_.jsx(FooterYamaha/* default */.Z, {})]
- });
- };
-
- /* harmony default export */ var Product_Motor = (Shop);
- async function getServerSideProps(context) {
- var product = [];
- const backend = process.env.BACKEND_SERVER_URI;
- var {
- req,
- resp
- } = context;
- const cookies = new (external_cookies_default())(req, resp);
- var user = "";
- var userObj = (await cookies.get("user")) ? JSON.parse(await cookies.get("user")) : null;
-
- if (userObj) {
- let sessionId = userObj["partners_login_states"].filter(function (i) {
- return i.business_partner && i.business_partner.name.toUpperCase() == "YAMAHA";
- });
- if (sessionId.length != 0) user = userObj["username"];
- }
-
- var res = await product_default().GetProduct();
-
- if (res["STATUS"] === 1) {
- product = res["DATA"]["products"];
- }
-
- return {
- props: {
- product,
- backend,
- user
- } // will be passed to the page component as props
-
- };
- }
-
- /***/ }),
-
- /***/ 8074:
- /***/ (function(module) {
-
- "use strict";
- module.exports = require("@apollo/client");;
-
- /***/ }),
-
- /***/ 9038:
- /***/ (function(module) {
-
- "use strict";
- module.exports = require("cookies");;
-
- /***/ }),
-
- /***/ 1683:
- /***/ (function(module) {
-
- "use strict";
- module.exports = require("cross-fetch");;
-
- /***/ }),
-
- /***/ 8417:
- /***/ (function(module) {
-
- "use strict";
- module.exports = require("next/dist/next-server/lib/router-context.js");;
-
- /***/ }),
-
- /***/ 2238:
- /***/ (function(module) {
-
- "use strict";
- module.exports = require("next/dist/next-server/lib/router/utils/get-asset-path-from-route.js");;
-
- /***/ }),
-
- /***/ 6731:
- /***/ (function(module) {
-
- "use strict";
- module.exports = require("next/router");;
-
- /***/ }),
-
- /***/ 9297:
- /***/ (function(module) {
-
- "use strict";
- module.exports = require("react");;
-
- /***/ }),
-
- /***/ 9337:
- /***/ (function(module) {
-
- "use strict";
- module.exports = require("react-feather");;
-
- /***/ }),
-
- /***/ 3230:
- /***/ (function(module) {
-
- "use strict";
- module.exports = require("react-number-format");;
-
- /***/ }),
-
- /***/ 79:
- /***/ (function(module) {
-
- "use strict";
- module.exports = require("react-redux");;
-
- /***/ }),
-
- /***/ 9614:
- /***/ (function(module) {
-
- "use strict";
- module.exports = require("react-toast-notifications");;
-
- /***/ }),
-
- /***/ 5282:
- /***/ (function(module) {
-
- "use strict";
- module.exports = require("react/jsx-runtime");;
-
- /***/ })
-
- };
- ;
-
- // load runtime
- var __webpack_require__ = require("../../../webpack-runtime.js");
- __webpack_require__.C(exports);
- var __webpack_exec__ = function(moduleId) { return __webpack_require__(__webpack_require__.s = moduleId); }
- var __webpack_exports__ = __webpack_require__.X(0, [1664,4755,6371,7798,6120,9965], function() { return __webpack_exec__(578); });
- module.exports = __webpack_exports__;
-
- })();
|