@nyris/nyris-webapp 0.3.5 → 0.3.12

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (206) hide show
  1. package/build/asset-manifest.json +18 -32
  2. package/build/index.html +1 -1
  3. package/build/{precache-manifest.bbb31f2ce7710d7eb3175b1b48241d24.js → precache-manifest.1b00dd5c15aa0815244681503d6fa9da.js} +13 -89
  4. package/build/service-worker.js +1 -1
  5. package/build/static/css/2.43a1c8b7.chunk.css +2 -0
  6. package/build/static/css/2.43a1c8b7.chunk.css.map +1 -0
  7. package/build/static/css/main.0c9239ba.chunk.css +2 -0
  8. package/build/static/css/main.0c9239ba.chunk.css.map +1 -0
  9. package/build/static/js/2.520bb6d6.chunk.js +3 -0
  10. package/build/static/js/2.520bb6d6.chunk.js.LICENSE.txt +79 -0
  11. package/build/static/js/2.520bb6d6.chunk.js.map +1 -0
  12. package/build/static/js/main.ef6a9744.chunk.js +2 -0
  13. package/build/static/js/main.ef6a9744.chunk.js.map +1 -0
  14. package/build/static/js/{runtime-main.b418ff16.js → runtime-main.f5553a9b.js} +1 -1
  15. package/build/static/js/{runtime-main.b418ff16.js.map → runtime-main.f5553a9b.js.map} +1 -1
  16. package/package.json +7 -30
  17. package/src/App.css +64 -20
  18. package/src/App.test.tsx +49 -0
  19. package/src/App.tsx +386 -15
  20. package/src/AppMD.tsx +320 -0
  21. package/src/actions/nyrisAppActions.ts +80 -0
  22. package/src/actions/searchActions.ts +323 -0
  23. package/src/components/CategoryFilter.tsx +16 -13
  24. package/src/components/Codes.tsx +20 -16
  25. package/src/components/ExampleImages.tsx +10 -15
  26. package/src/components/Feedback.tsx +12 -21
  27. package/src/components/FiltersList.tsx +122 -0
  28. package/src/components/Header.tsx +26 -29
  29. package/src/components/PredictedCategories.tsx +15 -12
  30. package/src/components/SelectedFiltersSummary.tsx +85 -0
  31. package/src/components/Sidebar.tsx +52 -0
  32. package/src/defaults.ts +3 -4
  33. package/src/epics/feedback.ts +59 -0
  34. package/src/epics/index.ts +223 -0
  35. package/src/epics/search.ts +239 -0
  36. package/src/epics/types.ts +12 -0
  37. package/src/{common/assets/fonts → fonts}/roboto-bold-webfont.woff +0 -0
  38. package/src/{common/assets/fonts → fonts}/roboto-bold-webfont.woff2 +0 -0
  39. package/src/{common/assets/fonts → fonts}/roboto-italic-webfont.woff +0 -0
  40. package/src/{common/assets/fonts → fonts}/roboto-italic-webfont.woff2 +0 -0
  41. package/src/{common/assets/fonts → fonts}/roboto-regular-webfont.woff +0 -0
  42. package/src/{common/assets/fonts → fonts}/roboto-regular-webfont.woff2 +0 -0
  43. package/src/{common/assets/fonts → fonts}/robotocondensed-bold-webfont.woff +0 -0
  44. package/src/{common/assets/fonts → fonts}/robotocondensed-bold-webfont.woff2 +0 -0
  45. package/src/{common/assets/fonts → fonts}/robotocondensed-bolditalic-webfont.woff +0 -0
  46. package/src/{common/assets/fonts → fonts}/robotocondensed-bolditalic-webfont.woff2 +0 -0
  47. package/src/{common/assets/images → images}/fav/android-icon-192x192.png +0 -0
  48. package/src/{common/assets/images → images}/fav/apple-icon-114x114.png +0 -0
  49. package/src/{common/assets/images → images}/fav/apple-icon-120x120.png +0 -0
  50. package/src/{common/assets/images → images}/fav/apple-icon-144x144.png +0 -0
  51. package/src/{common/assets/images → images}/fav/apple-icon-152x152.png +0 -0
  52. package/src/{common/assets/images → images}/fav/apple-icon-180x180.png +0 -0
  53. package/src/{common/assets/images → images}/fav/apple-icon-57x57.png +0 -0
  54. package/src/{common/assets/images → images}/fav/apple-icon-60x60.png +0 -0
  55. package/src/{common/assets/images → images}/fav/apple-icon-72x72.png +0 -0
  56. package/src/{common/assets/images → images}/fav/apple-icon-76x76.png +0 -0
  57. package/src/{common/assets/images → images}/fav/browserconfig.xml +0 -0
  58. package/src/{common/assets/images → images}/fav/favicon-16x16.png +0 -0
  59. package/src/{common/assets/images → images}/fav/favicon-32x32.png +0 -0
  60. package/src/{common/assets/images → images}/fav/favicon-96x96.png +0 -0
  61. package/src/{common/assets/images → images}/fav/manifest.json +0 -0
  62. package/src/{common/assets/images → images}/ic_cam.png +0 -0
  63. package/src/{common/assets/images → images}/ic_cam.svg +0 -0
  64. package/src/{common/assets/images → images}/ic_cam_large.png +0 -0
  65. package/src/{common/assets/images → images}/ic_cam_large.svg +0 -0
  66. package/src/{common/assets/images → images}/ic_cam_large_noimage.png +0 -0
  67. package/src/{common/assets/images → images}/ic_close_feedback.png +0 -0
  68. package/src/{common/assets/images → images}/ic_close_feedback.svg +0 -0
  69. package/src/{common/assets/images → images}/ic_shopNow.png +0 -0
  70. package/src/{common/assets/images → images}/ic_shopNow.svg +0 -0
  71. package/src/{common/assets/images → images}/ic_shopNowLight.png +0 -0
  72. package/src/{common/assets/images → images}/ic_shopNowLight.svg +0 -0
  73. package/src/{common/assets/images → images}/nyris_logo.png +0 -0
  74. package/src/{common/assets/images → images}/rewe.svg +0 -0
  75. package/src/{common/assets/images → images}/sectionTransBack.png +0 -0
  76. package/src/{common/assets/images → images}/sectionTransBack.svg +0 -0
  77. package/src/{common/assets/images → images}/sectionTransTop.png +0 -0
  78. package/src/{common/assets/images → images}/sectionTransTop.svg +0 -0
  79. package/src/index.css +502 -570
  80. package/src/index.tsx +170 -16
  81. package/src/types.ts +7 -51
  82. package/src/utils.ts +5 -0
  83. package/tsconfig.json +8 -3
  84. package/build/js/settings.example.js +0 -31
  85. package/build/js/test.js +0 -56
  86. package/build/static/css/2.8285176a.chunk.css +0 -2
  87. package/build/static/css/2.8285176a.chunk.css.map +0 -1
  88. package/build/static/css/main.6676fe1f.chunk.css +0 -2
  89. package/build/static/css/main.6676fe1f.chunk.css.map +0 -1
  90. package/build/static/js/2.4a55bc61.chunk.js +0 -3
  91. package/build/static/js/2.4a55bc61.chunk.js.LICENSE.txt +0 -124
  92. package/build/static/js/2.4a55bc61.chunk.js.map +0 -1
  93. package/build/static/js/main.2660f94a.chunk.js +0 -2
  94. package/build/static/js/main.2660f94a.chunk.js.map +0 -1
  95. package/build/static/media/Fill.37094b44.svg +0 -3
  96. package/build/static/media/Montserrat-Bold.5a052e98.otf +0 -0
  97. package/build/static/media/Montserrat-Light.21789e89.otf +0 -0
  98. package/build/static/media/Montserrat-Medium.a53e0373.otf +0 -0
  99. package/build/static/media/Montserrat-Regular.71cdc681.otf +0 -0
  100. package/build/static/media/Montserrat-SemiBold.f613d915.otf +0 -0
  101. package/build/static/media/Rectangle.4dd8b747.png +0 -0
  102. package/build/static/media/admin.9529c7f6.svg +0 -3
  103. package/build/static/media/bg-support-page.6ac55268.svg +0 -9
  104. package/build/static/media/book_mark.8e294c0b.svg +0 -3
  105. package/build/static/media/icon_dislike.94607ca6.svg +0 -3
  106. package/build/static/media/icon_like.a4fb1b18.svg +0 -3
  107. package/build/static/media/icon_modal_image.3068d0ea.svg +0 -21
  108. package/build/static/media/icon_search_image.c2c728c0.svg +0 -3
  109. package/build/static/media/nyris_logo.22d8f250.svg +0 -3
  110. package/build/static/media/reload_icon.4b579a74.svg +0 -3
  111. package/build/static/media/save_search.bebaeebf.svg +0 -3
  112. package/build/static/media/support.289c3a3c.svg +0 -3
  113. package/build/static/media/translate_icon.f0492297.svg +0 -3
  114. package/public/js/settings.example.js +0 -31
  115. package/public/js/test.js +0 -56
  116. package/src/Router.tsx +0 -97
  117. package/src/Store/Auth.ts +0 -44
  118. package/src/Store/Nyris.ts +0 -77
  119. package/src/Store/Search.ts +0 -243
  120. package/src/Store/Store.ts +0 -53
  121. package/src/common/assets/fonts/Montserrat_OTF/Montserrat-Bold.otf +0 -0
  122. package/src/common/assets/fonts/Montserrat_OTF/Montserrat-Light.otf +0 -0
  123. package/src/common/assets/fonts/Montserrat_OTF/Montserrat-Medium.otf +0 -0
  124. package/src/common/assets/fonts/Montserrat_OTF/Montserrat-Regular.otf +0 -0
  125. package/src/common/assets/fonts/Montserrat_OTF/Montserrat-SemiBold.otf +0 -0
  126. package/src/common/assets/icons/Fill.png +0 -0
  127. package/src/common/assets/icons/Fill.svg +0 -3
  128. package/src/common/assets/icons/Icon_wechat.png +0 -0
  129. package/src/common/assets/icons/Icon_whatsapp.png +0 -0
  130. package/src/common/assets/icons/admin.png +0 -0
  131. package/src/common/assets/icons/admin.svg +0 -3
  132. package/src/common/assets/icons/book_mark.png +0 -0
  133. package/src/common/assets/icons/book_mark.svg +0 -3
  134. package/src/common/assets/icons/icon_barcode.png +0 -0
  135. package/src/common/assets/icons/icon_camera.png +0 -0
  136. package/src/common/assets/icons/icon_dislike.svg +0 -3
  137. package/src/common/assets/icons/icon_disslike.png +0 -0
  138. package/src/common/assets/icons/icon_email.png +0 -0
  139. package/src/common/assets/icons/icon_like.png +0 -0
  140. package/src/common/assets/icons/icon_like.svg +0 -3
  141. package/src/common/assets/icons/icon_modal_image.png +0 -0
  142. package/src/common/assets/icons/icon_modal_image.svg +0 -21
  143. package/src/common/assets/icons/icon_picture.png +0 -0
  144. package/src/common/assets/icons/icon_search_image.png +0 -0
  145. package/src/common/assets/icons/icon_search_image.svg +0 -3
  146. package/src/common/assets/icons/nyris_logo.svg +0 -3
  147. package/src/common/assets/icons/reload_icon.png +0 -0
  148. package/src/common/assets/icons/reload_icon.svg +0 -3
  149. package/src/common/assets/icons/save_search.png +0 -0
  150. package/src/common/assets/icons/save_search.svg +0 -3
  151. package/src/common/assets/icons/setting_search_icon.png +0 -0
  152. package/src/common/assets/icons/support.png +0 -0
  153. package/src/common/assets/icons/support.svg +0 -3
  154. package/src/common/assets/icons/translate_icon.png +0 -0
  155. package/src/common/assets/icons/translate_icon.svg +0 -3
  156. package/src/common/assets/icons/view_off.png +0 -0
  157. package/src/common/assets/images/Rectangle.png +0 -0
  158. package/src/common/assets/images/bg-support-page.svg +0 -9
  159. package/src/common/assets/images/image_test.png +0 -0
  160. package/src/components/CustomHits/index.tsx +0 -57
  161. package/src/components/DetailItem.tsx +0 -175
  162. package/src/components/DragDropFile.tsx +0 -192
  163. package/src/components/FilterComponent.tsx +0 -33
  164. package/src/components/Footer.tsx +0 -29
  165. package/src/components/FooterMD.tsx +0 -54
  166. package/src/components/FooterNewVersion.tsx +0 -12
  167. package/src/components/FooterResult.tsx +0 -47
  168. package/src/components/HeaderMd.tsx +0 -38
  169. package/src/components/HeaderNewVersion.tsx +0 -92
  170. package/src/components/Layout.tsx +0 -46
  171. package/src/components/LoadingScreen/index.tsx +0 -29
  172. package/src/components/Navigation.tsx +0 -34
  173. package/src/components/Panigation/Pagination.tsx +0 -140
  174. package/src/components/Panigation/cx.js +0 -3
  175. package/src/components/Panigation/isModifierClick.js +0 -10
  176. package/src/components/Saved/AllItem.tsx +0 -32
  177. package/src/components/Saved/Category.tsx +0 -16
  178. package/src/components/carousel/DefaultCarousel.tsx +0 -48
  179. package/src/components/common.d.ts +0 -9
  180. package/src/components/common.scss +0 -54
  181. package/src/components/default-select.tsx +0 -44
  182. package/src/components/hitItem/hits.tsx +0 -50
  183. package/src/components/hitItem/infinitiHits.tsx +0 -33
  184. package/src/components/input/inputSearch.tsx +0 -77
  185. package/src/components/modal/DefaultModal.tsx +0 -28
  186. package/src/components/results/ItemResult.tsx +0 -155
  187. package/src/components/search/ListSearch.tsx +0 -209
  188. package/src/modules/LandingPage/App.tsx +0 -318
  189. package/src/modules/LandingPage/AppMD.tsx +0 -399
  190. package/src/modules/LandingPage/common.scss +0 -1304
  191. package/src/modules/LandingPage/index.tsx +0 -169
  192. package/src/modules/LandingPage/indexNewVersion.tsx +0 -110
  193. package/src/modules/LandingPage/propsType.ts +0 -43
  194. package/src/page/Auth/login.tsx +0 -7
  195. package/src/page/Exception/404.tsx +0 -11
  196. package/src/page/History/index.tsx +0 -76
  197. package/src/page/Profile/index.tsx +0 -87
  198. package/src/page/Saved/MockData.ts +0 -223
  199. package/src/page/Saved/index.tsx +0 -166
  200. package/src/page/Support/index.tsx +0 -160
  201. package/src/page/result/MockData.ts +0 -36
  202. package/src/page/result/index.tsx +0 -418
  203. package/src/services/Feedback.ts +0 -64
  204. package/src/services/image.ts +0 -40
  205. package/src/services/session.ts +0 -17
  206. package/src/services/types.ts +0 -50
@@ -1 +1 @@
1
- {"version":3,"sources":["../webpack/bootstrap"],"names":["webpackJsonpCallback","data","moduleId","chunkId","chunkIds","moreModules","executeModules","i","resolves","length","Object","prototype","hasOwnProperty","call","installedChunks","push","modules","parentJsonpFunction","shift","deferredModules","apply","checkDeferredModules","result","deferredModule","fulfilled","j","depId","splice","__webpack_require__","s","installedModules","1","exports","module","l","m","c","d","name","getter","o","defineProperty","enumerable","get","r","Symbol","toStringTag","value","t","mode","__esModule","ns","create","key","bind","n","object","property","p","jsonpArray","this","oldJsonpFunction","slice"],"mappings":"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","file":"static/js/runtime-main.b418ff16.js","sourcesContent":[" \t// install a JSONP callback for chunk loading\n \tfunction webpackJsonpCallback(data) {\n \t\tvar chunkIds = data[0];\n \t\tvar moreModules = data[1];\n \t\tvar executeModules = data[2];\n\n \t\t// add \"moreModules\" to the modules object,\n \t\t// then flag all \"chunkIds\" as loaded and fire callback\n \t\tvar moduleId, chunkId, i = 0, resolves = [];\n \t\tfor(;i < chunkIds.length; i++) {\n \t\t\tchunkId = chunkIds[i];\n \t\t\tif(Object.prototype.hasOwnProperty.call(installedChunks, chunkId) && installedChunks[chunkId]) {\n \t\t\t\tresolves.push(installedChunks[chunkId][0]);\n \t\t\t}\n \t\t\tinstalledChunks[chunkId] = 0;\n \t\t}\n \t\tfor(moduleId in moreModules) {\n \t\t\tif(Object.prototype.hasOwnProperty.call(moreModules, moduleId)) {\n \t\t\t\tmodules[moduleId] = moreModules[moduleId];\n \t\t\t}\n \t\t}\n \t\tif(parentJsonpFunction) parentJsonpFunction(data);\n\n \t\twhile(resolves.length) {\n \t\t\tresolves.shift()();\n \t\t}\n\n \t\t// add entry modules from loaded chunk to deferred list\n \t\tdeferredModules.push.apply(deferredModules, executeModules || []);\n\n \t\t// run deferred modules when all chunks ready\n \t\treturn checkDeferredModules();\n \t};\n \tfunction checkDeferredModules() {\n \t\tvar result;\n \t\tfor(var i = 0; i < deferredModules.length; i++) {\n \t\t\tvar deferredModule = deferredModules[i];\n \t\t\tvar fulfilled = true;\n \t\t\tfor(var j = 1; j < deferredModule.length; j++) {\n \t\t\t\tvar depId = deferredModule[j];\n \t\t\t\tif(installedChunks[depId] !== 0) fulfilled = false;\n \t\t\t}\n \t\t\tif(fulfilled) {\n \t\t\t\tdeferredModules.splice(i--, 1);\n \t\t\t\tresult = __webpack_require__(__webpack_require__.s = deferredModule[0]);\n \t\t\t}\n \t\t}\n\n \t\treturn result;\n \t}\n\n \t// The module cache\n \tvar installedModules = {};\n\n \t// object to store loaded and loading chunks\n \t// undefined = chunk not loaded, null = chunk preloaded/prefetched\n \t// Promise = chunk loading, 0 = chunk loaded\n \tvar installedChunks = {\n \t\t1: 0\n \t};\n\n \tvar deferredModules = [];\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n \t\t}\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// create a fake namespace object\n \t// mode & 1: value is a module id, require it\n \t// mode & 2: merge all properties of value into the ns\n \t// mode & 4: return value when already ns object\n \t// mode & 8|1: behave like require\n \t__webpack_require__.t = function(value, mode) {\n \t\tif(mode & 1) value = __webpack_require__(value);\n \t\tif(mode & 8) return value;\n \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n \t\tvar ns = Object.create(null);\n \t\t__webpack_require__.r(ns);\n \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n \t\treturn ns;\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"./\";\n\n \tvar jsonpArray = this[\"webpackJsonp@nyris/nyris-webapp\"] = this[\"webpackJsonp@nyris/nyris-webapp\"] || [];\n \tvar oldJsonpFunction = jsonpArray.push.bind(jsonpArray);\n \tjsonpArray.push = webpackJsonpCallback;\n \tjsonpArray = jsonpArray.slice();\n \tfor(var i = 0; i < jsonpArray.length; i++) webpackJsonpCallback(jsonpArray[i]);\n \tvar parentJsonpFunction = oldJsonpFunction;\n\n\n \t// run deferred modules from other chunks\n \tcheckDeferredModules();\n"],"sourceRoot":""}
1
+ {"version":3,"sources":["../webpack/bootstrap"],"names":["webpackJsonpCallback","data","moduleId","chunkId","chunkIds","moreModules","executeModules","i","resolves","length","Object","prototype","hasOwnProperty","call","installedChunks","push","modules","parentJsonpFunction","shift","deferredModules","apply","checkDeferredModules","result","deferredModule","fulfilled","j","depId","splice","__webpack_require__","s","installedModules","1","exports","module","l","m","c","d","name","getter","o","defineProperty","enumerable","get","r","Symbol","toStringTag","value","t","mode","__esModule","ns","create","key","bind","n","object","property","p","jsonpArray","this","oldJsonpFunction","slice"],"mappings":"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","file":"static/js/runtime-main.f5553a9b.js","sourcesContent":[" \t// install a JSONP callback for chunk loading\n \tfunction webpackJsonpCallback(data) {\n \t\tvar chunkIds = data[0];\n \t\tvar moreModules = data[1];\n \t\tvar executeModules = data[2];\n\n \t\t// add \"moreModules\" to the modules object,\n \t\t// then flag all \"chunkIds\" as loaded and fire callback\n \t\tvar moduleId, chunkId, i = 0, resolves = [];\n \t\tfor(;i < chunkIds.length; i++) {\n \t\t\tchunkId = chunkIds[i];\n \t\t\tif(Object.prototype.hasOwnProperty.call(installedChunks, chunkId) && installedChunks[chunkId]) {\n \t\t\t\tresolves.push(installedChunks[chunkId][0]);\n \t\t\t}\n \t\t\tinstalledChunks[chunkId] = 0;\n \t\t}\n \t\tfor(moduleId in moreModules) {\n \t\t\tif(Object.prototype.hasOwnProperty.call(moreModules, moduleId)) {\n \t\t\t\tmodules[moduleId] = moreModules[moduleId];\n \t\t\t}\n \t\t}\n \t\tif(parentJsonpFunction) parentJsonpFunction(data);\n\n \t\twhile(resolves.length) {\n \t\t\tresolves.shift()();\n \t\t}\n\n \t\t// add entry modules from loaded chunk to deferred list\n \t\tdeferredModules.push.apply(deferredModules, executeModules || []);\n\n \t\t// run deferred modules when all chunks ready\n \t\treturn checkDeferredModules();\n \t};\n \tfunction checkDeferredModules() {\n \t\tvar result;\n \t\tfor(var i = 0; i < deferredModules.length; i++) {\n \t\t\tvar deferredModule = deferredModules[i];\n \t\t\tvar fulfilled = true;\n \t\t\tfor(var j = 1; j < deferredModule.length; j++) {\n \t\t\t\tvar depId = deferredModule[j];\n \t\t\t\tif(installedChunks[depId] !== 0) fulfilled = false;\n \t\t\t}\n \t\t\tif(fulfilled) {\n \t\t\t\tdeferredModules.splice(i--, 1);\n \t\t\t\tresult = __webpack_require__(__webpack_require__.s = deferredModule[0]);\n \t\t\t}\n \t\t}\n\n \t\treturn result;\n \t}\n\n \t// The module cache\n \tvar installedModules = {};\n\n \t// object to store loaded and loading chunks\n \t// undefined = chunk not loaded, null = chunk preloaded/prefetched\n \t// Promise = chunk loading, 0 = chunk loaded\n \tvar installedChunks = {\n \t\t1: 0\n \t};\n\n \tvar deferredModules = [];\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n \t\t}\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// create a fake namespace object\n \t// mode & 1: value is a module id, require it\n \t// mode & 2: merge all properties of value into the ns\n \t// mode & 4: return value when already ns object\n \t// mode & 8|1: behave like require\n \t__webpack_require__.t = function(value, mode) {\n \t\tif(mode & 1) value = __webpack_require__(value);\n \t\tif(mode & 8) return value;\n \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n \t\tvar ns = Object.create(null);\n \t\t__webpack_require__.r(ns);\n \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n \t\treturn ns;\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"./\";\n\n \tvar jsonpArray = this[\"webpackJsonp@nyris/nyris-webapp\"] = this[\"webpackJsonp@nyris/nyris-webapp\"] || [];\n \tvar oldJsonpFunction = jsonpArray.push.bind(jsonpArray);\n \tjsonpArray.push = webpackJsonpCallback;\n \tjsonpArray = jsonpArray.slice();\n \tfor(var i = 0; i < jsonpArray.length; i++) webpackJsonpCallback(jsonpArray[i]);\n \tvar parentJsonpFunction = oldJsonpFunction;\n\n\n \t// run deferred modules from other chunks\n \tcheckDeferredModules();\n"],"sourceRoot":""}
package/package.json CHANGED
@@ -1,16 +1,13 @@
1
1
  {
2
2
  "name": "@nyris/nyris-webapp",
3
- "version": "0.3.5",
3
+ "version": "0.3.12",
4
4
  "homepage": "./",
5
5
  "dependencies": {
6
- "@babel/runtime": "^7.17.2",
7
6
  "@material-ui/core": "^4.3.3",
8
- "@material-ui/data-grid": "^4.0.0-alpha.37",
9
7
  "@material-ui/icons": "^4.4.1",
10
8
  "@material-ui/lab": "^4.0.0-alpha.60",
11
- "@nyris/nyris-api": "^0.3.5",
12
- "@nyris/nyris-react-components": "^0.3.5",
13
- "@reduxjs/toolkit": "^1.6.1",
9
+ "@nyris/nyris-api": "^0.3.12",
10
+ "@nyris/nyris-react-components": "^0.2.6",
14
11
  "@types/blueimp-load-image": "^2.23.4",
15
12
  "@types/classnames": "^2.2.9",
16
13
  "@types/history": "^4.7.3",
@@ -19,37 +16,21 @@
19
16
  "@types/react": "16.9.2",
20
17
  "@types/react-dom": "16.9.0",
21
18
  "@types/react-redux": "^7.1.2",
22
- "@types/react-router-dom": "^5.1.8",
23
- "algoliasearch": "^4.12.2",
24
- "axios": "^0.26.1",
25
- "blueimp-load-image": "^2.24.0",
19
+ "blueimp-load-image": "^5.16.0",
26
20
  "classnames": "^2.2.6",
27
21
  "history": "^4.10.1",
28
- "js-cookie": "^3.0.1",
29
- "konva": "5.0.3",
30
- "lodash": "^4.17.21",
31
- "qs": "^6.10.3",
32
- "react": "^17.0.0",
22
+ "react": "^16.13.1",
33
23
  "react-dom": "^16.13.1",
34
24
  "react-dropzone": "^10.1.8",
35
- "react-hook-form": "^7.27.1",
36
- "react-instantsearch-dom": "^6.22.0",
37
- "react-instantsearch-hooks": "^6.22.0",
38
- "react-konva": "16.13.0-6",
39
25
  "react-move": "^6.0.0",
40
26
  "react-redux": "^7.1.1",
41
- "react-responsive-carousel": "^3.2.22",
42
- "react-router-dom": "^5.3.0",
43
27
  "react-scripts": "^3.4.1",
44
- "react-select": "^5.2.2",
45
- "react-table": "^7.7.0",
46
28
  "redux": "^4.0.4",
47
29
  "redux-observable": "^1.1.0",
48
- "redux-thunk": "^2.4.1",
49
30
  "rxjs": "^6.5.3",
50
31
  "source-map-explorer": "^2.0.1",
51
32
  "typeface-roboto": "0.0.75",
52
- "typescript": "^4.1.2"
33
+ "typescript": "3.6.2"
53
34
  },
54
35
  "scripts": {
55
36
  "analyze": "source-map-explorer 'build/static/js/*.js'",
@@ -77,12 +58,8 @@
77
58
  ]
78
59
  },
79
60
  "devDependencies": {
80
- "@types/js-cookie": "^3.0.1",
81
- "@types/lodash": "^4.14.178",
82
- "@types/react-instantsearch-dom": "^6.12.2",
83
61
  "mockserver": "^3.1.1",
84
62
  "react-styleguidist": "^11.0.5",
85
- "redux-devtools-extension": "^2.13.8",
86
- "sass": "^1.39.0"
63
+ "redux-devtools-extension": "^2.13.8"
87
64
  }
88
65
  }
package/src/App.css CHANGED
@@ -33,33 +33,77 @@
33
33
  }
34
34
 
35
35
  .predicted-categories {
36
- display: flex;
37
- flex-wrap: wrap;
38
- flex-direction: row;
39
- justify-content: center;
36
+ display: flex;
37
+ flex-wrap: wrap;
38
+ flex-direction: row;
39
+ justify-content: center;
40
40
  }
41
41
  .predicted-categories small {
42
- white-space: nowrap;
43
- padding-left: 0.4em;
44
- padding-right: 0.4em;
45
- font-size: 0.8em;
46
- border-radius: 5px;
47
- margin: 0.2em;
48
- background-color: #fff;
42
+ white-space: nowrap;
43
+ padding-left: 0.4em;
44
+ padding-right: 0.4em;
45
+ font-size: 0.8em;
46
+ border-radius: 5px;
47
+ margin: 0.2em;
48
+ background-color: #fff;
49
49
  }
50
-
51
- /* Css Common all page */
52
- .d-flex {
53
- display: flex !important;
50
+ .sidebar {
51
+ width: 240px;
52
+ color: white;
53
+ border: 1px solid rgba(246, 242, 242, 0.1);
54
+ margin: 0;
55
+ padding: 0;
56
+ width: 200px;
57
+ position: fixed;
58
+ height: 100%;
59
+ overflow: auto;
54
60
  }
55
- .justify-center {
61
+
62
+ .app {
63
+ font-family: sans-serif;
64
+ font-size: 18px;
65
+ display: flex;
66
+ align-items: left;
56
67
  justify-content: center;
68
+ flex-direction: column;
69
+ gap: 20px;
70
+ height: 100vh;
71
+ font-family: Cambria, Cochin, Georgia, Times, "Times New Roman", serif;
57
72
  }
58
- .flex-end {
59
- align-items: flex-end;
73
+ .filterlabel ,.topFilterlabel{
74
+ margin-top: 30px;
75
+ font-size: 25px;
76
+ margin-bottom: 10px;
77
+ color: white;
60
78
  }
61
- .flex-center {
62
- align-items: center;
79
+ .topFilterlabel {
80
+ border-bottom: 4px solid white;
81
+ }
82
+ .list-container {
83
+ display: flex;
84
+ flex-direction: column;
85
+ gap: 5px;
86
+ color: white;
87
+ font-size: 20px;
88
+ }
89
+ .checked-item,
90
+ .not-checked-item {
91
+ margin-left: 10px;
92
+ }
93
+ .checked-item {
94
+ text-decoration: line-through;
63
95
  }
96
+ .rowC {
97
+ display:flex; flex-direction:row;
98
+ }
99
+
100
+ .colC {
101
+ display: flex; flex-direction: row;
102
+ }
103
+ .MuiDrawer-paper {
104
+ width: drawerWidth;
105
+ box-sizing: 'border-box';
106
+ }
107
+
64
108
 
65
109
 
@@ -0,0 +1,49 @@
1
+ import React from 'react';
2
+ import ReactDOM from 'react-dom';
3
+ import App, { AppProps } from './App';
4
+ import AppMD from './AppMD';
5
+ import {defaultMdSettings, defaultSettings} from "./defaults";
6
+
7
+
8
+ const appProps: AppProps = {
9
+ search: {
10
+ results: [],
11
+ categoryPredictions: [],
12
+ filterOptions: [],
13
+ regions: [],
14
+ codes: [],
15
+ previewSelection: { x1: 0, x2: 1, y1: 0, y2: 1}
16
+ },
17
+ loading: false,
18
+ feedbackState: 'question',
19
+ handlers: {
20
+ onCameraClick: () => {},
21
+ onCaptureCanceled: () => {},
22
+ onCaptureComplete: () => {},
23
+ onCloseFeedback: () => {},
24
+ onExampleImageClick: () => {},
25
+ onFileDropped: () => {},
26
+ onImageClick: () => {},
27
+ onLinkClick: () => {},
28
+ onSelectFile: () => {},
29
+ onShowStart: () => {},
30
+ onSelectionChange: () => {},
31
+ onPositiveFeedback: () => {},
32
+ onNegativeFeedback: () => {},
33
+ },
34
+ showPart: 'start',
35
+ settings: { ...defaultSettings },
36
+ mdSettings: defaultMdSettings,
37
+ };
38
+
39
+ it('renders without crashing', () => {
40
+ const div = document.createElement('div');
41
+ ReactDOM.render(<App { ...appProps} />, div);
42
+ ReactDOM.unmountComponentAtNode(div);
43
+ });
44
+
45
+ it('renders material design version without crashing', () => {
46
+ const div = document.createElement('div');
47
+ ReactDOM.render(<AppMD { ...appProps} />, div);
48
+ ReactDOM.unmountComponentAtNode(div);
49
+ });
package/src/App.tsx CHANGED
@@ -1,18 +1,389 @@
1
- import "react-app-polyfill/ie11";
2
- import "react-app-polyfill/stable";
3
- import React from "react";
4
- import "typeface-roboto";
5
- import "index.css";
6
- import { useAppSelector } from "Store/Store";
7
- import LandingPageApp from "modules/LandingPage/index";
8
- import AppNewVersion from "modules/LandingPage/indexNewVersion";
9
-
10
- function App(): JSX.Element {
11
- const { settings } = useAppSelector((state) => state);
12
- const { themePage } = settings;
13
- let SelectedApp = themePage.searchSuite?.active ? AppNewVersion : LandingPageApp;
14
-
15
- return <SelectedApp />;
1
+ import React, { useEffect, useState } from "react";
2
+ import { useDispatch } from "react-redux";
3
+ import { Animate, NodeGroup } from "react-move";
4
+ import { useDropzone } from "react-dropzone";
5
+ import { Box, Snackbar } from "@material-ui/core";
6
+ import { Alert } from "@material-ui/lab";
7
+ import classNames from "classnames";
8
+ import { loadFilters } from "./actions/searchActions";
9
+ import Result from "./components/Result";
10
+ import Sidebar from "./components/Sidebar";
11
+ import Header from "./components/Header";
12
+ import Feedback from "./components/Feedback";
13
+ import CategoryFilter from "./components/CategoryFilter";
14
+ import Codes from "./components/Codes";
15
+ import PredictedCategories from "./components/PredictedCategories";
16
+ import ExampleImages from "./components/ExampleImages";
17
+ import {
18
+ makeFileHandler,
19
+ Capture,
20
+ Preview,
21
+ } from "@nyris/nyris-react-components";
22
+ import {
23
+ RectCoords,
24
+ cadExtensions,
25
+ CategoryPrediction,
26
+ Code,
27
+ Region,
28
+ Filter,
29
+ } from "@nyris/nyris-api";
30
+ import { AppSettings, CanvasWithId, MDSettings } from "./types";
31
+ import { NyrisAppPart, NyrisFeedbackState } from "./actions/nyrisAppActions";
32
+ import SelectedFiltersSummary from "./components/SelectedFiltersSummary";
33
+
34
+ export interface AppHandlers {
35
+ onExampleImageClick: (url: string) => void;
36
+ onImageClick: (position: number, url: string) => void;
37
+ onLinkClick: (position: number, url: string) => void;
38
+ onFileDropped: (file: File) => void;
39
+ onCaptureComplete: (image: HTMLCanvasElement) => void;
40
+ onCaptureCanceled: () => void;
41
+ onSelectFile: (f: File) => void;
42
+ onCameraClick: () => void;
43
+ onShowStart: () => void;
44
+ onSelectionChange: (r: RectCoords) => void;
45
+ onPositiveFeedback: () => void;
46
+ onNegativeFeedback: () => void;
47
+ onCloseFeedback: () => void;
48
+ }
49
+ export interface AppProps {
50
+ search: {
51
+ results: any[];
52
+ requestId?: string;
53
+ duration?: number;
54
+ categoryPredictions: CategoryPrediction[];
55
+ codes: Code[];
56
+ filterOptions: string[];
57
+ errorMessage?: string;
58
+ regions: Region[];
59
+ previewSelection: RectCoords;
60
+ toastErrorMessage?: string;
61
+ filters: Filter[];
62
+ selectedFilters: Map<string, string[]>;
63
+ };
64
+ previewImage?: CanvasWithId;
65
+ settings: AppSettings;
66
+ loading: boolean;
67
+ showPart: NyrisAppPart;
68
+ feedbackState: NyrisFeedbackState;
69
+ handlers: AppHandlers;
70
+ mdSettings: MDSettings;
16
71
  }
17
72
 
73
+ const App: React.FC<AppProps> = ({
74
+ search: {
75
+ results,
76
+ regions,
77
+ previewSelection,
78
+ requestId,
79
+ duration,
80
+ errorMessage,
81
+ filterOptions,
82
+ categoryPredictions,
83
+ codes,
84
+ toastErrorMessage,
85
+ filters,
86
+ selectedFilters,
87
+ },
88
+ showPart,
89
+ settings,
90
+ handlers,
91
+ loading,
92
+ previewImage,
93
+ feedbackState,
94
+ }) => {
95
+ const { getRootProps, getInputProps, isDragActive } = useDropzone({
96
+ onDrop: (fs: File[]) => handlers.onFileDropped(fs[0]),
97
+ });
98
+
99
+ const minPreviewHeight = 400;
100
+ const halfOfTheScreenHeight = Math.floor(window.innerHeight * 0.45);
101
+ const maxPreviewHeight = Math.max(minPreviewHeight, halfOfTheScreenHeight);
102
+ const [toastOpen, setToastOpen] = useState(false);
103
+ const dispatch = useDispatch();
104
+
105
+ const acceptTypes = ["image/*"]
106
+ .concat(settings.cadSearch ? cadExtensions : [])
107
+ .join(",");
108
+
109
+ useEffect(() => {
110
+ if (toastErrorMessage !== "") {
111
+ setToastOpen(true);
112
+ }
113
+ }, [toastErrorMessage]);
114
+
115
+ useEffect(() => {
116
+ dispatch(loadFilters());
117
+ }, [showPart, dispatch]);
118
+
119
+ return (
120
+ <React.Fragment>
121
+ <Header />
122
+ <div className="wrapperBody">
123
+ <Sidebar filters={filters} selectedFilters={selectedFilters} />
124
+
125
+ <div className="mainContent">
126
+ {showPart === "camera" && (
127
+ <Capture
128
+ onCaptureComplete={handlers.onCaptureComplete}
129
+ onCaptureCanceled={handlers.onCaptureCanceled}
130
+ useAppText="Use default camera app"
131
+ />
132
+ )}
133
+
134
+ <SelectedFiltersSummary />
135
+ <div
136
+ className={classNames("headSection", {
137
+ hidden: showPart === "results",
138
+ })}
139
+ id="headSection"
140
+ >
141
+ <div
142
+ {...getRootProps({
143
+ onClick: (e) => {
144
+ e.stopPropagation();
145
+ },
146
+ })}
147
+ className={classNames("wrapper", "dragAndDropActionArea", {
148
+ fileIsHover: isDragActive,
149
+ })}
150
+ >
151
+ <div className={classNames("contentWrap")}>
152
+ <Box
153
+ display="flex"
154
+ flexDirection="column"
155
+ justifyContent="center"
156
+ alignItems="center"
157
+ minHeight="100vh"
158
+ >
159
+ <section className="uploadImage">
160
+ <input
161
+ type="button"
162
+ name="file"
163
+ id="capture"
164
+ className="inputfile"
165
+ accept="image/*"
166
+ capture="environment"
167
+ onClick={handlers.onCameraClick}
168
+ />
169
+ <input
170
+ type="file"
171
+ name="file"
172
+ id="capture_file"
173
+ className="inputfile"
174
+ accept={acceptTypes}
175
+ capture="environment"
176
+ />
177
+ <input
178
+ {...getInputProps()}
179
+ type="file"
180
+ name="file"
181
+ id="select_file"
182
+ className="inputfile"
183
+ accept={acceptTypes}
184
+ onChange={makeFileHandler(handlers.onSelectFile)}
185
+ />
186
+ <div className="onDesktop">
187
+ Drop an image
188
+ <div className="smallText">or</div>
189
+ </div>
190
+ <div className="onMobile camIcon">
191
+ <img src="./images/ic_cam_large.svg" alt="Camera" />
192
+ </div>
193
+ <label
194
+ htmlFor="capture"
195
+ className="btn primary onMobile"
196
+ style={{ marginBottom: "2em", width: "12em" }}
197
+ >
198
+ <span className="onMobile">Take a picture</span>
199
+ </label>
200
+ <br />
201
+ <label
202
+ htmlFor="select_file"
203
+ className="btn primary"
204
+ style={{ width: "12em" }}
205
+ >
206
+ <span>Select a file</span>
207
+ </label>
208
+ <label
209
+ htmlFor="capture"
210
+ className="mobileUploadHandler onMobile"
211
+ />
212
+ </section>
213
+ <ExampleImages
214
+ images={settings.exampleImages}
215
+ onExampleImageClicked={handlers.onExampleImageClick}
216
+ />
217
+ </Box>
218
+ </div>
219
+ </div>
220
+
221
+ <div className="headerSeparatorTop" />
222
+ <div className="headerSeparatorBack" />
223
+ <div
224
+ className={classNames("tryDifferent", {
225
+ hidden: showPart !== "results",
226
+ })}
227
+ onClick={handlers.onShowStart}
228
+ >
229
+ <div className="icIcon"></div>
230
+ <div className="textDesc"> Try a different image</div>
231
+ <br style={{ clear: "both" }} />
232
+ </div>
233
+ </div>
234
+
235
+ <section
236
+ className={classNames(
237
+ { hideResults: showPart !== "results" },
238
+ "results",
239
+ { resultsActive: showPart === "results" },
240
+ results.length === 1 ? "singleProduct" : "multipleProducts"
241
+ )}
242
+ >
243
+ {errorMessage && (
244
+ <div className="errorMsg">
245
+ {errorMessage}
246
+ <div
247
+ style={{
248
+ textAlign: "center",
249
+ fontSize: "0ß.7em",
250
+ paddingTop: "0.8em",
251
+ }}
252
+ >
253
+ <span>
254
+ Make sure to include the request ID when reporting a
255
+ problem: {requestId}
256
+ </span>
257
+ </div>
258
+ </div>
259
+ )}
260
+ <Animate
261
+ show={loading}
262
+ start={{ opacity: 0.0 }}
263
+ enter={{ opacity: [1.0], timing: { duration: 300 } }}
264
+ leave={{ opacity: [0.0], timing: { duration: 300 } }}
265
+ >
266
+ {(s) => (
267
+ <div className="loadingOverlay" style={{ ...s }}>
268
+ <div className="loading" />
269
+ </div>
270
+ )}
271
+ </Animate>
272
+ {settings.preview && previewImage && (
273
+ <div className="preview">
274
+ <Preview
275
+ key={previewImage.id}
276
+ maxWidth={document.body.clientWidth}
277
+ maxHeight={maxPreviewHeight}
278
+ dotColor="#4C8F9F"
279
+ onSelectionChange={handlers.onSelectionChange}
280
+ regions={regions}
281
+ selection={previewSelection}
282
+ image={previewImage.canvas}
283
+ />
284
+ </div>
285
+ )}
286
+ <div className="predicted-categories">
287
+ <PredictedCategories cs={categoryPredictions} />
288
+ </div>
289
+ <div className="predicted-categories">
290
+ <Codes codes={codes} />
291
+ </div>
292
+ <CategoryFilter cats={filterOptions} />
293
+
294
+ <div className="wrapper">
295
+ <NodeGroup
296
+ data={results}
297
+ keyAccessor={(r) => r.sku}
298
+ start={(r, i) => ({ opacity: 0, translateX: -100 })}
299
+ enter={(r, i) => ({
300
+ opacity: [1],
301
+ translateX: [0],
302
+ timing: { delay: i * 100, duration: 300 },
303
+ })}
304
+ >
305
+ {(rs) => (
306
+ <>
307
+ {rs.map(({ key, data, state }) => (
308
+ <Result
309
+ key={key}
310
+ noImageUrl={settings.noImageUrl}
311
+ template={settings.resultTemplate}
312
+ onImageClick={handlers.onImageClick}
313
+ onLinkClick={handlers.onLinkClick}
314
+ result={data}
315
+ style={{
316
+ opacity: state.opacity,
317
+ transform: `translateX(${state.translateX}%)`,
318
+ }}
319
+ />
320
+ ))}
321
+ </>
322
+ )}
323
+ </NodeGroup>
324
+
325
+ {results.length === 0 && showPart === "results" && !loading && (
326
+ <div className="noResults">
327
+ We did not find anything{" "}
328
+ <span role="img" aria-label="sad face">
329
+ 😕
330
+ </span>
331
+ </div>
332
+ )}
333
+
334
+ <br style={{ clear: "both" }} />
335
+
336
+ {duration && showPart === "results" && (
337
+ <div
338
+ style={{
339
+ textAlign: "center",
340
+ fontSize: "0.7em",
341
+ paddingTop: "0.8em",
342
+ }}
343
+ >
344
+ Search took {duration.toFixed(2)} seconds
345
+ </div>
346
+ )}
347
+
348
+ {requestId && showPart === "results" && (
349
+ <div
350
+ style={{
351
+ textAlign: "center",
352
+ fontSize: "0.7em",
353
+ paddingTop: "0.8em",
354
+ }}
355
+ >
356
+ Request identifier {requestId}
357
+ </div>
358
+ )}
359
+ </div>
360
+ </section>
361
+
362
+ <Snackbar
363
+ open={toastOpen}
364
+ autoHideDuration={3000}
365
+ onClose={() => setToastOpen(false)}
366
+ >
367
+ <Alert onClose={() => setToastOpen(false)} severity="error">
368
+ {toastErrorMessage}
369
+ </Alert>
370
+ </Snackbar>
371
+ </div>
372
+ </div>
373
+ <section className="footnote">
374
+ <div className="wrapper">
375
+ © 2017 - 2019 <a href="https://nyris.io">nyris GmbH</a> - All rights
376
+ reserved - <a href="https://nyris.io/imprint/">Imprint</a>
377
+ </div>
378
+ </section>
379
+ <Feedback
380
+ feedbackState={feedbackState}
381
+ onPositiveFeedback={handlers.onPositiveFeedback}
382
+ onNegativeFeedback={handlers.onNegativeFeedback}
383
+ onClose={handlers.onCloseFeedback}
384
+ />
385
+ </React.Fragment>
386
+ );
387
+ };
388
+
18
389
  export default App;