@nyris/nyris-webapp 0.3.22 → 0.3.24

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 (95) hide show
  1. package/README.md +1 -1
  2. package/build/asset-manifest.json +12 -18
  3. package/build/index.html +1 -1
  4. package/build/{precache-manifest.6f6124db008881782a26c64db1f10264.js → precache-manifest.982b135daeb2c083ccf4eeeddf132bf3.js} +11 -35
  5. package/build/service-worker.js +1 -1
  6. package/build/static/css/{main.c956b74c.chunk.css → main.1e43a778.chunk.css} +2 -2
  7. package/build/static/css/main.1e43a778.chunk.css.map +1 -0
  8. package/build/static/js/2.fe9108d5.chunk.js +3 -0
  9. package/build/static/js/{2.a2732c2b.chunk.js.LICENSE.txt → 2.fe9108d5.chunk.js.LICENSE.txt} +0 -15
  10. package/build/static/js/2.fe9108d5.chunk.js.map +1 -0
  11. package/build/static/js/main.83cb88a3.chunk.js +3 -0
  12. package/build/static/js/main.83cb88a3.chunk.js.map +1 -0
  13. package/package.json +3 -3
  14. package/src/App.tsx +6 -14
  15. package/src/Router.tsx +6 -41
  16. package/src/Store/Store.ts +14 -23
  17. package/src/components/DetailItem.tsx +33 -22
  18. package/src/components/FooterMobile.tsx +3 -51
  19. package/src/components/FooterResult.tsx +1 -1
  20. package/src/components/HeaderMobile.tsx +13 -20
  21. package/src/components/HeaderNewVersion.tsx +5 -83
  22. package/src/components/Layout.tsx +3 -19
  23. package/src/components/PanelResult/index.tsx +1 -1
  24. package/src/components/clear-refinements/clear-refinements.tsx +1 -1
  25. package/src/components/drawer/cameraCustom.tsx +6 -12
  26. package/src/components/input/inputSearch.tsx +3 -3
  27. package/src/components/pre-filter/desktop/index.tsx +2 -2
  28. package/src/components/results/ItemResult.tsx +8 -8
  29. package/src/defaults.ts +19 -35
  30. package/src/helpers/CommonHelper.ts +10 -6
  31. package/src/hooks/useVisualSearch.tsx +1 -1
  32. package/src/index.css +13 -0
  33. package/src/index.tsx +0 -20
  34. package/src/modules/LandingPage/AppMD.tsx +59 -386
  35. package/src/modules/LandingPage/AppMobile.tsx +1 -1
  36. package/src/modules/LandingPage/propsType.ts +35 -37
  37. package/src/page/result/index.tsx +2 -2
  38. package/src/services/Feedback.ts +48 -71
  39. package/src/services/filter.tsx +1 -1
  40. package/src/services/types.ts +30 -39
  41. package/src/types.ts +8 -63
  42. package/build/js/test.js +0 -84
  43. package/build/static/css/main.c956b74c.chunk.css.map +0 -1
  44. package/build/static/js/2.a2732c2b.chunk.js +0 -3
  45. package/build/static/js/2.a2732c2b.chunk.js.map +0 -1
  46. package/build/static/js/main.93b05e17.chunk.js +0 -3
  47. package/build/static/js/main.93b05e17.chunk.js.map +0 -1
  48. package/build/static/media/Rectangle.4dd8b747.png +0 -0
  49. package/build/static/media/icon_company.2b2a0a61.svg +0 -3
  50. package/build/static/media/icon_email.132d632b.svg +0 -3
  51. package/build/static/media/icon_phone.09335da9.svg +0 -3
  52. package/build/static/media/icon_textArea.f6d78b61.svg +0 -3
  53. package/build/static/media/icon_users.2013c76e.svg +0 -3
  54. package/public/js/test.js +0 -84
  55. package/src/App.css +0 -65
  56. package/src/components/AppContainer.tsx +0 -126
  57. package/src/components/CategoryFilter.tsx +0 -17
  58. package/src/components/Codes.tsx +0 -20
  59. package/src/components/CustomHits/index.tsx +0 -47
  60. package/src/components/Footer.tsx +0 -96
  61. package/src/components/FooterMD.tsx +0 -54
  62. package/src/components/HeaderMd.tsx +0 -38
  63. package/src/components/Navigation.tsx +0 -34
  64. package/src/components/PredictedCategories.tsx +0 -14
  65. package/src/components/Refine.tsx +0 -28
  66. package/src/components/RelevantSort.tsx +0 -12
  67. package/src/components/Result.tsx +0 -210
  68. package/src/components/Saved/AllItem.tsx +0 -32
  69. package/src/components/Saved/Category.tsx +0 -16
  70. package/src/components/auto-complete/basic.tsx +0 -153
  71. package/src/components/autocomplete/plugins/popular-searches/popular-searches.css +0 -3
  72. package/src/components/autocomplete/plugins/popular-searches/popular-searches.tsx +0 -75
  73. package/src/components/button/clear-fillter.tsx +0 -30
  74. package/src/components/camera/screenshot.tsx +0 -33
  75. package/src/components/count/count.tsx +0 -20
  76. package/src/components/hitItem/hits.tsx +0 -50
  77. package/src/components/hitItem/infinitiHits.tsx +0 -33
  78. package/src/components/icon/icon.tsx +0 -13
  79. package/src/components/icon_textArea.svg +0 -3
  80. package/src/components/refinement-list/index.tsx +0 -42
  81. package/src/components/results/pagination.tsx +0 -34
  82. package/src/components/search/ListSearch.tsx +0 -209
  83. package/src/modules/LandingPage/App.tsx +0 -318
  84. package/src/modules/LandingPage/index.tsx +0 -186
  85. package/src/modules/LandingPage/indexNewVersion.tsx +0 -72
  86. package/src/page/Auth/login.tsx +0 -7
  87. package/src/page/Exception/404.tsx +0 -11
  88. package/src/page/History/index.tsx +0 -76
  89. package/src/page/Profile/index.tsx +0 -140
  90. package/src/page/ResultMobile/index.tsx +0 -12
  91. package/src/page/Saved/MockData.ts +0 -223
  92. package/src/page/Saved/index.tsx +0 -166
  93. package/src/page/Support/MockData.ts +0 -45
  94. package/src/page/Support/index.tsx +0 -492
  95. /package/build/static/js/{main.93b05e17.chunk.js.LICENSE.txt → main.83cb88a3.chunk.js.LICENSE.txt} +0 -0
@@ -1,3 +0,0 @@
1
- <svg width="12" height="12" viewBox="0 0 12 12" fill="none" xmlns="http://www.w3.org/2000/svg">
2
- <path fill-rule="evenodd" clip-rule="evenodd" d="M11.1429 0H6C5.77274 0.000226919 5.55486 0.0906056 5.39416 0.251302C5.23346 0.411998 5.14308 0.629884 5.14286 0.857143V5.14286H0.857143C0.629884 5.14308 0.411998 5.23346 0.251302 5.39416C0.0906056 5.55486 0.000226919 5.77274 0 6V12H12V0.857143C11.9997 0.629894 11.9093 0.412028 11.7487 0.251339C11.588 0.0906505 11.3701 0.000260886 11.1429 0ZM3 11.1429V8.14286H4.71429V11.1429H3ZM11.1429 11.1429H5.57143V7.71429C5.57143 7.60062 5.52628 7.49161 5.4459 7.41124C5.36553 7.33087 5.25652 7.28571 5.14286 7.28571H2.57143C2.45776 7.28571 2.34876 7.33087 2.26838 7.41124C2.18801 7.49161 2.14286 7.60062 2.14286 7.71429V11.1429H0.857143V6H6V0.857143H11.1429V11.1429ZM7.71334 2.5719H6.8562V3.42904H7.71334V2.5719ZM9.43286 2.5719H10.29V3.42904H9.43286V2.5719ZM7.71334 5.14233H6.8562V5.99948H7.71334V5.14233ZM9.43286 5.14233H10.29V5.99948H9.43286V5.14233ZM7.71334 7.71643H6.8562V8.57357H7.71334V7.71643ZM9.43286 7.71643H10.29V8.57357H9.43286V7.71643Z" fill="#55566B"/>
3
- </svg>
@@ -1,3 +0,0 @@
1
- <svg width="12" height="9" viewBox="0 0 12 9" fill="none" xmlns="http://www.w3.org/2000/svg">
2
- <path d="M11.1429 0H0.857143C0.629814 0 0.411797 0.0903058 0.251051 0.251051C0.0903058 0.411797 0 0.629814 0 0.857143V7.71429C0 7.94161 0.0903058 8.15963 0.251051 8.32038C0.411797 8.48112 0.629814 8.57143 0.857143 8.57143H11.1429C11.3702 8.57143 11.5882 8.48112 11.7489 8.32038C11.9097 8.15963 12 7.94161 12 7.71429V0.857143C12 0.629814 11.9097 0.411797 11.7489 0.251051C11.5882 0.0903058 11.3702 0 11.1429 0ZM10.2 0.857143L6 3.76286L1.8 0.857143H10.2ZM0.857143 7.71429V1.24714L5.75571 4.63714C5.82746 4.68691 5.91269 4.71358 6 4.71358C6.08731 4.71358 6.17254 4.68691 6.24429 4.63714L11.1429 1.24714V7.71429H0.857143Z" fill="#55566B"/>
3
- </svg>
@@ -1,3 +0,0 @@
1
- <svg width="12" height="12" viewBox="0 0 12 12" fill="none" xmlns="http://www.w3.org/2000/svg">
2
- <path d="M10.6159 11.9956H10.5374C1.47155 11.4742 0.184328 3.82475 0.00439445 1.49022C-0.0101039 1.30871 0.0113559 1.12612 0.0675442 0.952916C0.123733 0.779712 0.213545 0.619297 0.331836 0.480862C0.450127 0.342428 0.594571 0.228695 0.756891 0.14618C0.919212 0.0636647 1.09622 0.0139895 1.27777 4.32575e-07H3.81991C4.00472 -0.000178469 4.18532 0.0551384 4.33832 0.158786C4.49132 0.262433 4.60968 0.409635 4.67806 0.581325L5.37934 2.30684C5.44686 2.47457 5.46362 2.65844 5.42753 2.83561C5.39144 3.01278 5.30409 3.17545 5.17634 3.3034L4.19362 4.29534C4.34713 5.16767 4.76488 5.9718 5.39036 6.59894C6.01585 7.22607 6.81887 7.64594 7.69079 7.80174L8.69197 6.8098C8.82184 6.68346 8.98603 6.59815 9.16407 6.56451C9.34211 6.53087 9.52612 6.55039 9.69313 6.62064L11.4325 7.31731C11.6016 7.38784 11.7459 7.50712 11.8469 7.65995C11.948 7.81278 12.0013 7.99223 12 8.17545V10.6115C12 10.9786 11.8542 11.3306 11.5946 11.5902C11.335 11.8498 10.983 11.9956 10.6159 11.9956ZM1.3885 0.922738C1.26614 0.922738 1.14879 0.971346 1.06226 1.05787C0.97574 1.14439 0.927132 1.26174 0.927132 1.38411V1.42102C1.13936 4.15232 2.5004 10.6115 10.5882 11.0728C10.6488 11.0766 10.7096 11.0683 10.767 11.0485C10.8244 11.0288 10.8773 10.9978 10.9228 10.9575C10.9682 10.9173 11.0052 10.8684 11.0317 10.8138C11.0583 10.7591 11.0737 10.6998 11.0772 10.6392V8.17545L9.33788 7.47878L8.01375 8.79368L7.7923 8.766C3.77839 8.26311 3.23397 4.2492 3.23397 4.20768L3.20629 3.98622L4.51658 2.6621L3.82453 0.922738H1.3885Z" fill="#55566B"/>
3
- </svg>
@@ -1,3 +0,0 @@
1
- <svg width="12" height="10" viewBox="0 0 12 10" fill="none" xmlns="http://www.w3.org/2000/svg">
2
- <path fill-rule="evenodd" clip-rule="evenodd" d="M2.14286 0H9.85714V0.857143H2.14286V0ZM9.85714 2.14286H2.14286V3H9.85714V2.14286ZM2.14286 4.28571H9.85714V5.14286H2.14286V4.28571ZM11.1429 9.42857H0.857143C0.629888 9.42833 0.412008 9.33795 0.251315 9.17726C0.0906207 9.01656 0.000238243 8.79868 0 8.57143V6.42857H0.857143V8.57143H11.1429V6.42857H12V8.57143C11.9998 8.79868 11.9094 9.01656 11.7487 9.17726C11.588 9.33795 11.3701 9.42833 11.1429 9.42857ZM9.85714 6.42857H2.14286V7.28571H9.85714V6.42857Z" fill="#55566B"/>
3
- </svg>
@@ -1,3 +0,0 @@
1
- <svg width="12" height="12" viewBox="0 0 12 12" fill="none" xmlns="http://www.w3.org/2000/svg">
2
- <path fill-rule="evenodd" clip-rule="evenodd" d="M2.66658 1.01118C3.65328 0.351894 4.81331 0 6 0C7.59075 0.00179224 9.11583 0.634509 10.2407 1.75934C11.3655 2.88417 11.9982 4.40925 12 6C12 7.18669 11.6481 8.34672 10.9888 9.33342C10.3295 10.3201 9.39246 11.0891 8.2961 11.5433C7.19975 11.9974 5.99335 12.1162 4.82946 11.8847C3.66557 11.6532 2.59648 11.0818 1.75736 10.2426C0.918247 9.40352 0.346802 8.33443 0.115291 7.17054C-0.11622 6.00665 0.0025997 4.80026 0.456725 3.7039C0.910851 2.60754 1.67989 1.67047 2.66658 1.01118ZM3.42857 9.85714V10.4471C4.20893 10.9027 5.09635 11.1429 6 11.1429C6.90365 11.1429 7.79107 10.9027 8.57143 10.4471V9.85714C8.57106 9.51626 8.43548 9.18945 8.19444 8.94842C7.9534 8.70738 7.62659 8.5718 7.28572 8.57143H4.71429C4.37341 8.5718 4.0466 8.70738 3.80556 8.94842C3.56453 9.18945 3.42895 9.51626 3.42857 9.85714ZM8.78755 8.33195C9.18778 8.72684 9.41684 9.26316 9.42536 9.82534C10.2025 9.13138 10.7506 8.21772 10.997 7.20534C11.2434 6.19297 11.1765 5.12963 10.8051 4.15614C10.4337 3.18265 9.77541 2.34491 8.91734 1.75387C8.05928 1.16283 7.04193 0.846354 6 0.846354C4.95808 0.846354 3.94073 1.16283 3.08266 1.75387C2.2246 2.34491 1.56629 3.18265 1.19492 4.15614C0.823545 5.12963 0.756619 6.19297 1.003 7.20534C1.24939 8.21772 1.79746 9.13138 2.57464 9.82534C2.58316 9.26316 2.81222 8.72684 3.21246 8.33195C3.61269 7.93707 4.15204 7.71524 4.71429 7.71428H7.28572C7.84796 7.71524 8.38732 7.93707 8.78755 8.33195ZM4.80928 2.9323C5.16167 2.69684 5.57597 2.57117 5.99979 2.57117C6.56811 2.57117 7.11316 2.79693 7.51502 3.1988C7.91688 3.60066 8.14265 4.1457 8.14265 4.71402C8.14265 5.13784 8.01697 5.55214 7.78151 5.90453C7.54605 6.25692 7.21138 6.53158 6.81983 6.69376C6.42827 6.85595 5.99741 6.89839 5.58174 6.81571C5.16607 6.73302 4.78425 6.52894 4.48456 6.22925C4.18488 5.92957 3.98079 5.54775 3.89811 5.13207C3.81543 4.7164 3.85786 4.28554 4.02005 3.89399C4.18224 3.50243 4.45689 3.16776 4.80928 2.9323ZM5.28549 5.78306C5.49692 5.92433 5.7455 5.99974 5.99979 5.99974C6.34067 5.99935 6.66747 5.86377 6.9085 5.62273C7.14954 5.3817 7.28512 5.0549 7.28551 4.71402C7.28551 4.45973 7.2101 4.21115 7.06882 3.99972C6.92755 3.78828 6.72675 3.62349 6.49181 3.52618C6.25688 3.42887 5.99836 3.4034 5.74896 3.45301C5.49956 3.50262 5.27046 3.62508 5.09065 3.80489C4.91084 3.9847 4.78839 4.21379 4.73878 4.46319C4.68917 4.7126 4.71463 4.97111 4.81195 5.20604C4.90926 5.44098 5.07405 5.64178 5.28549 5.78306Z" fill="#55566B"/>
3
- </svg>
package/public/js/test.js DELETED
@@ -1,84 +0,0 @@
1
- var settings = {
2
- apiKey: 'ZKbb76cwHmBUoXR4uqwD5PqaJK3wobdZ',
3
- // apiKeyDMGMori: 'nlLoWoR4GqT1BVbdkYiVsp85oMokpzMS',
4
- maxWidth: 300,
5
- maxHeight: 300,
6
- jpegQuality: 0.9,
7
- regions: true,
8
- preview: true,
9
- useRecommendations: false,
10
- xOptions:
11
- 'default +estimated-category similarity.threshold=0.05 similarity.threshold.discard=0.05 exact.threshold.perfect=200 similarity.threshold.perfect=2 scoring.indicative-min-hits=1 scoring.promo-min-hits=20 scoring.interpolation-cutoff=0 +barcode +barcode-detection',
12
- baseUrl: 'https://api.i.nyris.io',
13
- resultTemplate: 'default',
14
- responseFormat: 'application/offers.complete+json',
15
- exampleImages: [
16
- 'https://storage.googleapis.com/nyris/share/examples_search/example_1.jpg',
17
- 'https://storage.googleapis.com/nyris/share/examples_search/example_2.jpg',
18
- 'https://storage.googleapis.com/nyris/share/examples_search/example_3.jpg',
19
- 'https://storage.googleapis.com/nyris/share/examples_search/example_4.jpg',
20
- ],
21
- deactivated: false,
22
- cadSearch: false,
23
- themePage: {
24
- default: {
25
- active: false,
26
- },
27
- materialDesign: {
28
- active: false,
29
- appBarLogoUrl: 'https://nyris.io/wp-content/themes/nyris/img/logo.svg',
30
- appBarTitle: '',
31
- appBarCustomBackgroundColor: 'black',
32
- appBarCustomTextColor: 'white',
33
-
34
- primaryColor: '#e31b5d',
35
- secondaryColor: '#ccc',
36
- resultFirstRowProperty: 'title',
37
- resultSecondRowProperty: 'price',
38
- resultLinkText: 'show',
39
- resultLinkIcon: 'eye',
40
- },
41
- searchSuite: {
42
- active: true,
43
- moreInfoText: 'more info',
44
- },
45
- },
46
- imageMatchingUrl: 'https://api.nyris.io/find/v1',
47
- imageMatchingUrlBySku: 'https://api.nyris.io/recommend/v1',
48
- imageMatchingSubmitManualUrl: 'https://api.nyris.io/find/v1/manual',
49
- regionProposalUrl: 'https://api.nyris.io/find/v1/regions',
50
- feedbackUrl: 'https://api.nyris.io/feedback/v1',
51
- algolia: {
52
- apiKey: '6d20d5463452614ea94aae323d8d038e',
53
- appId: 'HBDJYUK5G4',
54
- indexName: 'dmg-mori',
55
- },
56
- refinements: [
57
- {
58
- type: 'list',
59
- header: 'Brands',
60
- attribute: 'brand',
61
- },
62
- {
63
- type: 'list',
64
- header: 'Norm',
65
- attribute: 'keyword_0',
66
- options: {
67
- searchable: true,
68
- },
69
- },
70
- {
71
- type: 'list',
72
- header: 'Category',
73
- attribute: 'custom_category',
74
- },
75
- ],
76
- autocompleteSearchConfig: {
77
- placeholders: ['brand', 'keyword_0', 'custom_category'],
78
- debouncing: 800,
79
- detachedMediaQuery: '(max-width: 776px)',
80
- },
81
- visualSearchFilterKey: 'machineType',
82
- };
83
- settings['customSearchRequest'] = null;
84
- settings['responseHook'] = null;
package/src/App.css DELETED
@@ -1,65 +0,0 @@
1
- .App {
2
- text-align: center;
3
- }
4
-
5
- .App-logo {
6
- animation: App-logo-spin infinite 20s linear;
7
- height: 40vmin;
8
- pointer-events: none;
9
- }
10
-
11
- .App-header {
12
- background-color: #282c34;
13
- min-height: 100svh;
14
- display: flex;
15
- flex-direction: column;
16
- align-items: center;
17
- justify-content: center;
18
- font-size: calc(10px + 2vmin);
19
- color: white;
20
- }
21
-
22
- .App-link {
23
- color: #61dafb;
24
- }
25
-
26
- @keyframes App-logo-spin {
27
- from {
28
- transform: rotate(0deg);
29
- }
30
- to {
31
- transform: rotate(360deg);
32
- }
33
- }
34
-
35
- .predicted-categories {
36
- display: flex;
37
- flex-wrap: wrap;
38
- flex-direction: row;
39
- justify-content: center;
40
- }
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;
49
- }
50
-
51
- /* Css Common all page */
52
- .d-flex {
53
- display: flex !important;
54
- }
55
- .justify-center {
56
- justify-content: center;
57
- }
58
- .flex-end {
59
- align-items: flex-end;
60
- }
61
- .flex-center {
62
- align-items: center;
63
- }
64
-
65
-
@@ -1,126 +0,0 @@
1
- import { Box } from '@material-ui/core';
2
- import React, { useState } from 'react';
3
- import { memo } from 'react';
4
- import { connectStateResults } from 'react-instantsearch-dom';
5
- import { useMediaQuery } from 'react-responsive';
6
- import { useHistory } from 'react-router-dom';
7
- import { setPreFilterDropdown } from 'Store/Search';
8
- import { useAppDispatch, useAppSelector } from 'Store/Store';
9
- import { AlgoliaSettings, AppState } from 'types';
10
- import FooterComponent from './Footer';
11
- import FooterMD from './FooterMD';
12
- import FooterMobile from './FooterMobile';
13
- import FooterNewVersion from './FooterNewVersion';
14
- import HeaderComponent from './Header';
15
- import HeaderMdComponent from './HeaderMd';
16
- import HeaderMobile from './HeaderMobile';
17
- import HeaderNewVersion from './HeaderNewVersion';
18
- import ExpandablePanelComponent from './PanelResult';
19
- import FilterComponent from './pre-filter/desktop';
20
-
21
- function AppContainerComponent({
22
- isSearchStalled,
23
- children,
24
- }: any): JSX.Element {
25
- const dispatch = useAppDispatch();
26
- const { settings, search } = useAppSelector<AppState>((state: any) => state);
27
- const { fetchingResults, loadingSearchAlgolia, preFilterDropdown } = search;
28
- const { themePage } = settings;
29
- const isMobile = useMediaQuery({ query: '(max-width: 776px)' });
30
- const [isOpenFilter, setOpenFilter] = useState<boolean>(false);
31
- const history = useHistory();
32
- let isShowHeaderMobile =
33
- (isMobile && history.location?.pathname === '/result') ||
34
- history.location?.pathname === '/';
35
-
36
- let HeaderApp: any;
37
- let FooterApp: any;
38
- let classNameBoxVersion: string = 'newVersion';
39
- if (isMobile) {
40
- classNameBoxVersion = 'mobile';
41
- FooterApp = FooterMobile;
42
- HeaderApp = HeaderMobile;
43
- } else {
44
- if (themePage.default?.active) {
45
- classNameBoxVersion = 'default';
46
-
47
- HeaderApp = HeaderComponent;
48
- FooterApp = FooterComponent;
49
- } else if (themePage.materialDesign?.active) {
50
- classNameBoxVersion = 'materialDesign';
51
- HeaderApp = HeaderMdComponent;
52
- FooterApp = FooterMD;
53
- } else {
54
- HeaderApp = HeaderNewVersion;
55
- FooterApp = FooterNewVersion;
56
- }
57
- }
58
-
59
- return (
60
- <>
61
- {(loadingSearchAlgolia || fetchingResults || isSearchStalled) && (
62
- <Box className="box-wrap-loading" style={{ zIndex: 99999999 }}>
63
- <Box className="loadingSpinCT" style={{ top: 0, bottom: 0 }}>
64
- <Box className="box-content-spin"></Box>
65
- </Box>
66
- </Box>
67
- )}
68
- <div className={`layout-main-${classNameBoxVersion}`}>
69
- <div
70
- className={
71
- !isMobile
72
- ? `box-header-${classNameBoxVersion}-main`
73
- : isShowHeaderMobile
74
- ? `box-header-${classNameBoxVersion}-main`
75
- : ''
76
- }
77
- style={{
78
- ...(classNameBoxVersion === 'newVersion'
79
- ? { background: settings.themePage.searchSuite?.headerColor }
80
- : {}),
81
- }}
82
- >
83
- <HeaderApp
84
- onToggleFilterMobile={() => {
85
- setOpenFilter(!isOpenFilter);
86
- }}
87
- />
88
- </div>
89
-
90
- <div className={`box-body-${classNameBoxVersion}-wrap-main`}>
91
- {children}
92
- </div>
93
- <div className="footer-wrap-main">
94
- <FooterApp />
95
- </div>
96
- </div>
97
- {isMobile && (
98
- <Box
99
- className={`box-fillter ${isOpenFilter ? 'open' : 'close'} `}
100
- position={'absolute'}
101
- >
102
- <ExpandablePanelComponent
103
- onToogleApplyFillter={() => {
104
- setOpenFilter(!isOpenFilter);
105
- }}
106
- />
107
- </Box>
108
- )}
109
- {isMobile && preFilterDropdown && (
110
- <Box className={`box-fillter open`} position={'absolute'}>
111
- <div className={'wrap-filter-destop'}>
112
- <div className={'bg-white box-filter-destop isMobile'}>
113
- <FilterComponent
114
- handleClose={() =>
115
- dispatch(setPreFilterDropdown(!preFilterDropdown))
116
- }
117
- />
118
- </div>
119
- </div>
120
- </Box>
121
- )}
122
- </>
123
- );
124
- }
125
- const AppContainer = connectStateResults(memo(AppContainerComponent));
126
- export default AppContainer;
@@ -1,17 +0,0 @@
1
- import React from 'react';
2
-
3
-
4
- const CategoryFilter = ({cats}: {cats: string[]}) => {
5
- if (cats.length === 0) {
6
- return null;
7
- }
8
- return (
9
- <div id="catlist" style={{'textAlign': 'center'}}>
10
- {
11
- cats.map((s) => <a key={s} href="#top">{s}</a>) // TODO fix link
12
- }
13
- </div>
14
- );
15
- };
16
-
17
- export default CategoryFilter;
@@ -1,20 +0,0 @@
1
- import React from 'react';
2
- import {Code} from '@nyris/nyris-api';
3
-
4
- interface Props {
5
- codes: Code[]
6
- }
7
- const Codes = ({codes}: Props) =>
8
- <>
9
- <div className="codes" style={{textAlign: 'center'}}>
10
- {codes.length > 0 && <span style={{fontSize: '0.8em'}}>Codes<br/> </span> }
11
- {codes.map((c, i) =>
12
- <small key={i} title={c.type}>
13
- {c.value}
14
- </small>)}
15
- </div>
16
- </>
17
- ;
18
-
19
-
20
- export default Codes;
@@ -1,47 +0,0 @@
1
- import React from 'react';
2
- import PropTypes from 'prop-types';
3
- import { connectHits } from 'react-instantsearch-dom';
4
- import ItemResult from 'components/results/ItemResult';
5
-
6
- function Hits({
7
- hits,
8
- setDataResultToAlgolia,
9
- getUrlToCanvasFile,
10
- sendFeedBackAction,
11
- }: any): JSX.Element {
12
- const handleSearch = () => {
13
- setDataResultToAlgolia(hits);
14
- };
15
-
16
- return (
17
- <>
18
- {handleSearch}
19
- {hits.map((hit: any, index: any) => {
20
- return (
21
- <ItemResult
22
- key={index}
23
- dataItem={hit}
24
- indexItem={hit?.__position}
25
- isHover={false}
26
- onSearchImage={(url: any) => {
27
- getUrlToCanvasFile(url);
28
- // setLoading(true);
29
- }}
30
- handlerFeedback={(value: string) => {
31
- sendFeedBackAction(value);
32
- }}
33
- />
34
- );
35
- })}
36
- </>
37
- );
38
- }
39
-
40
- Hits.propTypes = {
41
- hits: PropTypes.arrayOf(PropTypes.object),
42
- objectIDs: PropTypes.arrayOf(PropTypes.string),
43
- setObjectIDs: PropTypes.func,
44
- };
45
-
46
- const CustomHits = connectHits(Hits);
47
- export default CustomHits;
@@ -1,96 +0,0 @@
1
- import React from 'react';
2
- import {
3
- Box,
4
- Button,
5
- Grid,
6
- MenuItem,
7
- Select,
8
- Typography,
9
- } from '@material-ui/core';
10
- import { connectPagination } from 'react-instantsearch-dom';
11
- import ArrowLeftOutlinedIcon from '@material-ui/icons/ArrowLeftOutlined';
12
- import ArrowRightOutlinedIcon from '@material-ui/icons/ArrowRightOutlined';
13
-
14
- function Pagination({ currentRefinement, nbPages, refine, children }: any) {
15
- return (
16
- <Grid
17
- container
18
- justifyContent="space-between"
19
- alignItems="center"
20
- style={{ height: '100%' }}
21
- >
22
- {children}
23
-
24
- {/*hidden_as_required <Grid item className="item-notify">
25
- <Typography className="text-f12 text-center">
26
- <span className="fw-600" style={{ color: '#2B2C46' }}>
27
- Didn’t find what you were looking for?
28
- </span>
29
- <span style={{ color: '#2B2C46' }}>Share your search with our</span>
30
- <Link
31
- to={'/support'}
32
- style={{ color: settings.themePage.searchSuite?.secondaryColor }}
33
- >
34
- product experts
35
- </Link>
36
- .
37
- </Typography>
38
- </Grid> */}
39
- <Grid item className="item-notify-right" style={{ minWidth: 32 }}>
40
- <Box display={'flex'} justifyContent={'center'} alignItems={'center'}>
41
- <Box
42
- display={'flex'}
43
- alignItems={'center'}
44
- style={{ borderRight: '1px solid #e9e9ec', paddingRight: 20 }}
45
- >
46
- <Select
47
- labelId="demo-simple-select-label"
48
- value={currentRefinement}
49
- onChange={(event: any) => refine(event.target.value)}
50
- className="select-choose-page"
51
- >
52
- {new Array(nbPages).fill(null).map((_, index) => {
53
- const page = index + 1;
54
- return <MenuItem value={page}>{page}</MenuItem>;
55
- })}
56
- </Select>
57
- <Box>
58
- <Typography className="text-f12" style={{ color: '#2B2C46' }}>
59
- of {nbPages} pages
60
- </Typography>
61
- </Box>
62
- </Box>
63
- <Box>
64
- <Button
65
- className="btn-prev"
66
- style={{ borderRight: '1px solid #e9e9ec' }}
67
- onClick={() => {
68
- if (1 === currentRefinement) {
69
- return;
70
- }
71
- refine(currentRefinement - 1);
72
- }}
73
- >
74
- <ArrowLeftOutlinedIcon />
75
- </Button>
76
-
77
- <Button
78
- className="btn-next"
79
- onClick={() => {
80
- if (currentRefinement === nbPages) {
81
- return;
82
- }
83
- refine(currentRefinement + 1);
84
- }}
85
- >
86
- <ArrowRightOutlinedIcon />
87
- </Button>
88
- </Box>
89
- </Box>
90
- </Grid>
91
- </Grid>
92
- );
93
- }
94
- const FooterResult = connectPagination(Pagination);
95
-
96
- export default FooterResult;
@@ -1,54 +0,0 @@
1
- import React from "react";
2
- import { makeStyles, Typography, Link } from "@material-ui/core";
3
- import { useAppSelector } from "Store/Store";
4
-
5
- const useStyles = makeStyles((theme) => ({
6
- footer: {
7
- backgroundColor: theme.palette.background.paper,
8
- padding: theme.spacing(6),
9
- },
10
- }));
11
-
12
- function Copyright() {
13
- return (
14
- <Typography variant="body2" color="textSecondary" align="center">
15
- {"Powered by "}
16
- <Link
17
- color="inherit"
18
- href="https://nyris.io/"
19
- component="a"
20
- target="_blank"
21
- >
22
- nyris.io
23
- </Link>
24
- </Typography>
25
- );
26
- }
27
-
28
- function FooterMD(): JSX.Element {
29
- const searchState = useAppSelector((state) => state);
30
- const { search, nyris } = searchState;
31
- const { showPart } = nyris;
32
- const { requestId } = search;
33
- const classes = useStyles();
34
- return (
35
- <footer className={classes.footer}>
36
- <Typography variant="subtitle1" align="center" color="textSecondary">
37
- {requestId && showPart === "results" && (
38
- <div
39
- style={{
40
- textAlign: "center",
41
- fontSize: "0.7em",
42
- paddingTop: "0.8em",
43
- }}
44
- >
45
- Request identifier {requestId}
46
- </div>
47
- )}
48
- </Typography>
49
- <Copyright />
50
- </footer>
51
- );
52
- }
53
-
54
- export default FooterMD;
@@ -1,38 +0,0 @@
1
- import React from "react";
2
- import { Container, Toolbar, Typography, AppBar } from "@material-ui/core";
3
- import { useAppSelector } from "Store/Store";
4
- import {MDSettings} from "../types";
5
- interface Props {
6
- settings: any;
7
- }
8
-
9
- function HeaderMdComponent(): JSX.Element {
10
- const { settings } = useAppSelector((state) => state);
11
- const { themePage } = settings;
12
- const mdSettings = themePage.materialDesign as MDSettings;
13
-
14
- return (
15
- <AppBar
16
- position={"relative"}
17
- style={{ backgroundColor: mdSettings.appBarCustomBackgroundColor }}
18
- >
19
- <Container
20
- maxWidth="md"
21
- style={{ flexDirection: "row", display: "flex" }}
22
- >
23
- <img
24
- src={mdSettings.appBarLogoUrl}
25
- style={{ height: "2em", minHeight: "64px", display: "flex" }}
26
- alt="Logo"
27
- />
28
- <Toolbar component="span">
29
- <Typography style={{ color: mdSettings.appBarCustomTextColor }}>
30
- {mdSettings.appBarTitle}
31
- </Typography>
32
- </Toolbar>
33
- </Container>
34
- </AppBar>
35
- );
36
- }
37
-
38
- export default HeaderMdComponent;
@@ -1,34 +0,0 @@
1
- import React from "react";
2
- import { NavLink } from "react-router-dom";
3
- // import * as H from "history";
4
-
5
- function Navigation(): JSX.Element {
6
- // const handleCheckMatchLink = (match: any, location: H.Location) => {
7
- // if (match?.url === location?.pathname) {
8
- // return true;
9
- // }
10
- // return false;
11
- // };
12
-
13
- return (
14
- <ul className="d-flex align-center">
15
- <li>
16
- <NavLink
17
- activeClassName="active"
18
- // isActive={(match, location: H.Location) => {
19
- // return handleCheckMatchLink(match, location);
20
- // }}
21
- isActive={() => false}
22
- to={"/search-history"}
23
- className="nav-link p-0 menu-children rounded-0"
24
- >
25
- <span className="d-none d-sm-block ms-4 px-2 py-1 border-bottom-1">
26
- Search history
27
- </span>
28
- </NavLink>
29
- </li>
30
- </ul>
31
- );
32
- }
33
-
34
- export default Navigation;
@@ -1,14 +0,0 @@
1
- import React from 'react';
2
-
3
- const PredictedCategories = ({cs}: {cs: {name: string, score: number}[]}) =>
4
- <>
5
- {cs.map((c) =>
6
- <small key={c.name}>
7
- {c.name === "" ? "No category" : c.name.split(" > ").slice(-1)[0]}:
8
- {(c.score * 100).toFixed(0)}%
9
- </small>)}
10
- </>
11
- ;
12
-
13
-
14
- export default PredictedCategories;
@@ -1,28 +0,0 @@
1
- import { useQuery } from 'hooks/useQuery';
2
- import { isEmpty } from 'lodash';
3
- import React, { memo, useEffect } from 'react';
4
- import { connectSearchBox } from 'react-instantsearch-dom';
5
- import { useAppDispatch, useAppSelector } from 'Store/Store';
6
-
7
- const RefineComponent = (props: any) => {
8
- const { refine } = props;
9
- const stateGlobal = useAppSelector(state => state);
10
- const { search } = stateGlobal;
11
- const { textSearchInputMobile } = search;
12
- const dispatch = useAppDispatch();
13
- const query = useQuery();
14
-
15
- useEffect(() => {
16
- const searchQuery = query.get('query') || '';
17
- refine(searchQuery);
18
- // not an ideal solution: fixes text search not working from landing page
19
- setTimeout(() => {
20
- refine(searchQuery);
21
- }, 100);
22
- }, [query, dispatch]);
23
-
24
- return <></>;
25
- };
26
-
27
- const Refine = connectSearchBox<any>(memo(RefineComponent));
28
- export default Refine;