@nyris/nyris-webapp 0.3.34 → 0.3.36
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.
- package/build/asset-manifest.json +13 -13
- package/build/index.html +1 -1
- package/build/{precache-manifest.b85c7807a93875355f9f0f6490e6dc8c.js → precache-manifest.a2657ad49c132fb9c82629d37be15547.js} +14 -14
- package/build/service-worker.js +1 -1
- package/build/static/css/main.41fb4769.chunk.css +2 -0
- package/build/static/css/main.41fb4769.chunk.css.map +1 -0
- package/build/static/js/2.ff44260e.chunk.js +3 -0
- package/build/static/js/2.ff44260e.chunk.js.map +1 -0
- package/build/static/js/main.0b3b11fc.chunk.js +3 -0
- package/build/static/js/main.0b3b11fc.chunk.js.map +1 -0
- package/build/static/media/error.48b946a9.svg +3 -0
- package/package.json +3 -3
- package/public/index.html +13 -0
- package/src/Store/search/Search.ts +4 -4
- package/src/Store/search/search.initialState.ts +1 -1
- package/src/Store/search/types.ts +1 -1
- package/src/common/assets/icons/arrow_left.svg +3 -0
- package/src/common/assets/icons/arrow_right.svg +3 -0
- package/src/common/assets/icons/error.svg +3 -0
- package/src/components/AppMobile.tsx +111 -0
- package/src/components/DetailItem.tsx +21 -18
- package/src/components/DragDropFile.tsx +5 -4
- package/src/components/FooterMobile.tsx +9 -3
- package/src/components/Header.tsx +2 -1
- package/src/components/HeaderMobile.tsx +5 -3
- package/src/components/ImageCaptureHelpModal.tsx +7 -1
- package/src/components/ImagePreviewMobile.tsx +87 -0
- package/src/components/Layout.tsx +32 -92
- package/src/components/ProductList/index.tsx +4 -1
- package/src/components/RfqBanner.tsx +120 -0
- package/src/components/SidePanel.tsx +147 -0
- package/src/components/appMobile.scss +147 -142
- package/src/components/carousel/ImagePreviewCarousel.tsx +1 -7
- package/src/components/drawer/cameraCustom.tsx +5 -4
- package/src/components/input/inputSearch.tsx +12 -7
- package/src/components/modal/DefaultModal.tsx +1 -1
- package/src/components/pre-filter/index.tsx +144 -83
- package/src/components/results/ItemResult.tsx +9 -20
- package/src/components/rfq/RfqModal.tsx +262 -0
- package/src/helpers/ToastHelper.ts +10 -0
- package/src/helpers/getCroppedCanvas.ts +26 -0
- package/src/hooks/useFilteredRegions.ts +37 -0
- package/src/index.css +0 -4
- package/src/page/landingPage/AppMD.tsx +0 -11
- package/src/page/landingPage/AppMobile.tsx +1 -0
- package/src/page/landingPage/common.scss +44 -60
- package/src/page/result/index.tsx +256 -309
- package/src/translations.ts +2 -2
- package/src/types.ts +1 -0
- package/src/utils.ts +0 -1
- package/build/static/css/main.f2aa67fc.chunk.css +0 -2
- package/build/static/css/main.f2aa67fc.chunk.css.map +0 -1
- package/build/static/js/2.d1f7e826.chunk.js +0 -3
- package/build/static/js/2.d1f7e826.chunk.js.map +0 -1
- package/build/static/js/main.e9aec8a9.chunk.js +0 -3
- package/build/static/js/main.e9aec8a9.chunk.js.map +0 -1
- package/build/static/media/support3.4a17f96e.svg +0 -3
- package/src/hooks/useVisualSearch.tsx +0 -77
- /package/build/static/js/{2.d1f7e826.chunk.js.LICENSE.txt → 2.ff44260e.chunk.js.LICENSE.txt} +0 -0
- /package/build/static/js/{main.e9aec8a9.chunk.js.LICENSE.txt → main.0b3b11fc.chunk.js.LICENSE.txt} +0 -0
|
@@ -169,7 +169,8 @@
|
|
|
169
169
|
|
|
170
170
|
.col-right-result-mobile {
|
|
171
171
|
overflow: initial;
|
|
172
|
-
|
|
172
|
+
display: flex;
|
|
173
|
+
flex-direction: column;
|
|
173
174
|
.col-left {
|
|
174
175
|
max-width: 100%;
|
|
175
176
|
}
|
|
@@ -281,86 +282,171 @@
|
|
|
281
282
|
}
|
|
282
283
|
}
|
|
283
284
|
}
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
285
|
+
|
|
286
|
+
}
|
|
287
|
+
}
|
|
288
|
+
|
|
289
|
+
@media screen and (max-width: 776px) {
|
|
290
|
+
|
|
291
|
+
.box-header-mobile-main {
|
|
292
|
+
// min-height: 60px;
|
|
293
|
+
z-index: 100;
|
|
294
|
+
background-color: #fff;
|
|
295
|
+
display: flex;
|
|
296
|
+
align-items: center;
|
|
297
|
+
justify-content: center;
|
|
298
|
+
width: 100%;
|
|
299
|
+
margin-top: 0px !important;
|
|
300
|
+
|
|
301
|
+
&.hide {
|
|
302
|
+
display: none;
|
|
303
|
+
}
|
|
304
|
+
|
|
305
|
+
.wrap-header-mobile {
|
|
306
|
+
|
|
307
|
+
background: #FFFFFF;
|
|
308
|
+
border-bottom: 1px solid #E9E9EC;
|
|
309
|
+
box-shadow: 0px 0px 16px rgba(170, 171, 181, 0.5);
|
|
310
|
+
border-radius: 32px;
|
|
311
|
+
|
|
289
312
|
width: 100%;
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
padding-right: 0px;
|
|
293
|
-
padding-bottom: 0px;
|
|
294
|
-
padding-left: 0px;
|
|
295
|
-
background-color: #fff;
|
|
296
|
-
z-index: 11;
|
|
313
|
+
position: relative;
|
|
314
|
+
height: 48px;;
|
|
297
315
|
|
|
298
|
-
.box-
|
|
299
|
-
z-index: 10;
|
|
300
|
-
box-shadow: 0px 0px 16px rgba(85, 86, 107, 0.2);
|
|
301
|
-
border-radius: 100%;
|
|
316
|
+
.box-suggest-search {
|
|
302
317
|
position: absolute;
|
|
318
|
+
bottom: -30px;
|
|
303
319
|
left: 0;
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
button {
|
|
312
|
-
border: 0px !important;
|
|
313
|
-
padding: 17px 14px;
|
|
314
|
-
width: 56px;
|
|
315
|
-
height: 56px;
|
|
320
|
+
width: 100%;
|
|
321
|
+
background-color: red;
|
|
322
|
+
padding: 0 50px;
|
|
323
|
+
|
|
324
|
+
&.open {
|
|
325
|
+
z-index: 100;
|
|
326
|
+
opacity: 1;
|
|
316
327
|
}
|
|
317
|
-
}
|
|
318
|
-
}
|
|
319
|
-
}
|
|
320
|
-
}
|
|
321
328
|
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
329
|
+
&.close {
|
|
330
|
+
z-index: -99;
|
|
331
|
+
opacity: 0;
|
|
332
|
+
}
|
|
333
|
+
}
|
|
326
334
|
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
left: 0;
|
|
330
|
-
width: 100%;
|
|
331
|
-
height: calc(100% - 47px);
|
|
332
|
-
background-color: #fff;
|
|
333
|
-
overflow: auto;
|
|
334
|
-
opacity: 1;
|
|
335
|
-
display: flex;
|
|
336
|
-
flex-direction: column;
|
|
337
|
-
justify-content: space-between;
|
|
335
|
+
.wrap-input-search {
|
|
336
|
+
width: 100%;
|
|
338
337
|
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
list-style-type: none;
|
|
338
|
+
.box-input-search {
|
|
339
|
+
background-color: #fff;
|
|
342
340
|
|
|
343
341
|
input {
|
|
344
|
-
|
|
342
|
+
background-color: #fff;
|
|
345
343
|
}
|
|
346
344
|
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
345
|
+
.btn-mobile-filter {
|
|
346
|
+
padding: 12px;
|
|
347
|
+
width: 40px;
|
|
348
|
+
height: 40px;
|
|
349
|
+
background-color: #f7f7f7;
|
|
350
|
+
border-radius: 100%;
|
|
351
351
|
}
|
|
352
352
|
}
|
|
353
353
|
}
|
|
354
|
+
}
|
|
355
|
+
|
|
356
|
+
.box-image-search-thumb-mobile {
|
|
357
|
+
// width: 40px;
|
|
358
|
+
height: 40px;
|
|
359
|
+
min-width: 76px;
|
|
360
|
+
margin-left: 10px;
|
|
361
|
+
position: relative;
|
|
362
|
+
display: flex;
|
|
363
|
+
border-radius: 4px;
|
|
364
|
+
max-width: 80px !important;
|
|
354
365
|
|
|
355
|
-
|
|
356
|
-
|
|
366
|
+
button {
|
|
367
|
+
display: flex;
|
|
368
|
+
justify-content: center;
|
|
369
|
+
align-items: center;
|
|
370
|
+
height: 100%;
|
|
371
|
+
min-width: 36px !important;
|
|
372
|
+
border: 0px;
|
|
373
|
+
}
|
|
374
|
+
|
|
375
|
+
img {
|
|
376
|
+
width: 100%;
|
|
377
|
+
height: 100%;
|
|
378
|
+
border-radius: 100%;
|
|
357
379
|
}
|
|
380
|
+
}
|
|
381
|
+
}
|
|
382
|
+
.box-icon-camera-mobile {
|
|
383
|
+
z-index: 10;
|
|
384
|
+
box-shadow: 0px 0px 16px rgba(85, 86, 107, 0.2);
|
|
385
|
+
border-radius: 100%;
|
|
386
|
+
position: absolute;
|
|
387
|
+
left: 0;
|
|
388
|
+
right: 0;
|
|
389
|
+
width: fit-content;
|
|
390
|
+
margin: auto;
|
|
391
|
+
top: -50%;
|
|
392
|
+
width: 56px;
|
|
393
|
+
height: 56px;
|
|
394
|
+
background-color: #FFFFFF;
|
|
395
|
+
button {
|
|
396
|
+
border: 0px !important;
|
|
397
|
+
padding: 17px 14px;
|
|
398
|
+
width: 56px;
|
|
399
|
+
height: 56px;
|
|
400
|
+
}
|
|
401
|
+
}
|
|
358
402
|
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
403
|
+
.box-filter {
|
|
404
|
+
bottom: 0;
|
|
405
|
+
left: 0;
|
|
406
|
+
width: 100%;
|
|
407
|
+
height: calc(100% - 47px);
|
|
408
|
+
background-color: #fff;
|
|
409
|
+
overflow: auto;
|
|
410
|
+
opacity: 1;
|
|
411
|
+
display: flex;
|
|
412
|
+
flex-direction: column;
|
|
413
|
+
justify-content: space-between;
|
|
414
|
+
|
|
415
|
+
ul {
|
|
416
|
+
li {
|
|
417
|
+
list-style-type: none;
|
|
418
|
+
|
|
419
|
+
input {
|
|
420
|
+
margin-right: 9px;
|
|
421
|
+
}
|
|
422
|
+
|
|
423
|
+
span {
|
|
424
|
+
color: #1e1f31;
|
|
425
|
+
font-size: 14px;
|
|
426
|
+
font-weight: 400;
|
|
427
|
+
}
|
|
362
428
|
}
|
|
363
429
|
}
|
|
430
|
+
|
|
431
|
+
&.open {
|
|
432
|
+
z-index: 1000;
|
|
433
|
+
}
|
|
434
|
+
|
|
435
|
+
&.close {
|
|
436
|
+
z-index: -100;
|
|
437
|
+
opacity: 0;
|
|
438
|
+
}
|
|
439
|
+
}
|
|
440
|
+
}
|
|
441
|
+
|
|
442
|
+
//TODO: Custom css modal filter
|
|
443
|
+
@media screen and (max-width: 776px) {
|
|
444
|
+
.wrap-mobile {
|
|
445
|
+
height: 100svh;
|
|
446
|
+
background-color: #F3F3F5;
|
|
447
|
+
display: flex;
|
|
448
|
+
flex-direction: column;
|
|
449
|
+
|
|
364
450
|
}
|
|
365
451
|
.box-filter-mobile {
|
|
366
452
|
.MuiBackdrop-root {
|
|
@@ -389,87 +475,6 @@
|
|
|
389
475
|
|
|
390
476
|
|
|
391
477
|
}
|
|
392
|
-
.aa-DetachedContainer {
|
|
393
|
-
bottom: auto;
|
|
394
|
-
}
|
|
395
|
-
.aa-DetachedOverlay {
|
|
396
|
-
position: absolute;
|
|
397
|
-
top: 0;
|
|
398
|
-
background-color: #fff;
|
|
399
|
-
width: 100%;
|
|
400
|
-
height: auto;
|
|
401
|
-
z-index: 999;
|
|
402
|
-
|
|
403
|
-
.aa-DetachedFormContainer {
|
|
404
|
-
display: flex;
|
|
405
|
-
padding: 0;
|
|
406
|
-
flex-direction: row-reverse;
|
|
407
|
-
height: 58px;
|
|
408
|
-
|
|
409
|
-
.aa-Form {
|
|
410
|
-
display: flex;
|
|
411
|
-
width: 100%;
|
|
412
|
-
|
|
413
|
-
.aa-InputWrapper {
|
|
414
|
-
width: 100%;
|
|
415
|
-
|
|
416
|
-
input {
|
|
417
|
-
width: 100%;
|
|
418
|
-
}
|
|
419
|
-
}
|
|
420
|
-
}
|
|
421
|
-
|
|
422
|
-
.aa-DetachedCancelButton {
|
|
423
|
-
font-weight: 500 !important;
|
|
424
|
-
font-size: 30px !important;
|
|
425
|
-
position: relative;
|
|
426
|
-
color: #55566b;
|
|
427
|
-
margin-bottom: 2px;
|
|
428
|
-
padding-left: 5px;
|
|
429
|
-
padding-right: 9px;
|
|
430
|
-
|
|
431
|
-
&::after {
|
|
432
|
-
content: '';
|
|
433
|
-
}
|
|
434
|
-
}
|
|
435
|
-
}
|
|
436
|
-
}
|
|
437
|
-
.aa-Form {
|
|
438
|
-
border: 0px !important;
|
|
439
|
-
|
|
440
|
-
&:focus-within {
|
|
441
|
-
box-shadow: none !important;
|
|
442
|
-
}
|
|
443
|
-
|
|
444
|
-
.aa-SubmitButton {
|
|
445
|
-
display: flex;
|
|
446
|
-
justify-content: center;
|
|
447
|
-
align-items: center;
|
|
448
|
-
width: 30px;
|
|
449
|
-
padding: 0px;
|
|
450
|
-
|
|
451
|
-
svg {
|
|
452
|
-
color: #000 !important;
|
|
453
|
-
}
|
|
454
|
-
}
|
|
455
|
-
}
|
|
456
|
-
|
|
457
|
-
.aa-Autocomplete {
|
|
458
|
-
width: 100%;
|
|
459
|
-
|
|
460
|
-
.aa-DetachedSearchButton {
|
|
461
|
-
border: 0px !important;
|
|
462
|
-
width: 100%;
|
|
463
|
-
padding: 0px !important;
|
|
464
|
-
}
|
|
465
|
-
|
|
466
|
-
.aa-DetachedSearchButtonIcon,
|
|
467
|
-
.aa-SubmitButton {
|
|
468
|
-
svg {
|
|
469
|
-
color: #000 !important;
|
|
470
|
-
}
|
|
471
|
-
}
|
|
472
|
-
}
|
|
473
478
|
|
|
474
479
|
#box-input-search {
|
|
475
480
|
position: relative;
|
|
@@ -12,7 +12,7 @@ interface Props {
|
|
|
12
12
|
}
|
|
13
13
|
|
|
14
14
|
export const ImagePreviewCarousel = (props: Props) => {
|
|
15
|
-
let { imgItem
|
|
15
|
+
let { imgItem } = props;
|
|
16
16
|
const isMobile = useMediaQuery({ query: '(max-width: 776px)' });
|
|
17
17
|
const mainRef: any = useRef(null);
|
|
18
18
|
const thumbsRef: any = useRef(null);
|
|
@@ -60,12 +60,6 @@ export const ImagePreviewCarousel = (props: Props) => {
|
|
|
60
60
|
style={{ objectFit: 'contain', minHeight: '400px' }}
|
|
61
61
|
alt="preview"
|
|
62
62
|
src={slide.url}
|
|
63
|
-
onClick={() => {
|
|
64
|
-
if (!thumbs) {
|
|
65
|
-
handlerCloseModal();
|
|
66
|
-
onSearchImage(slide.url);
|
|
67
|
-
}
|
|
68
|
-
}}
|
|
69
63
|
/>
|
|
70
64
|
</SplideSlide>
|
|
71
65
|
));
|
|
@@ -4,6 +4,7 @@ import CloseIcon from '@material-ui/icons/Close';
|
|
|
4
4
|
import PhotoLibraryIcon from '@material-ui/icons/PhotoLibrary';
|
|
5
5
|
import { RectCoords } from '@nyris/nyris-api';
|
|
6
6
|
import ReverseCamera from 'common/assets/icons/reverse_camera.svg';
|
|
7
|
+
import { isEmpty } from 'lodash';
|
|
7
8
|
import React, { useCallback, useRef, useState } from 'react';
|
|
8
9
|
import { useDropzone } from 'react-dropzone';
|
|
9
10
|
import { useHistory } from 'react-router-dom';
|
|
@@ -38,7 +39,7 @@ function CameraCustom(props: Props) {
|
|
|
38
39
|
const { search, settings } = stateGlobal;
|
|
39
40
|
const history = useHistory();
|
|
40
41
|
const dispatch = useAppDispatch();
|
|
41
|
-
const {
|
|
42
|
+
const { preFilter } = search;
|
|
42
43
|
|
|
43
44
|
const videoConstraints = {
|
|
44
45
|
width: 1080,
|
|
@@ -73,10 +74,10 @@ function CameraCustom(props: Props) {
|
|
|
73
74
|
dispatch(setSelectedRegion(region));
|
|
74
75
|
}
|
|
75
76
|
|
|
76
|
-
const
|
|
77
|
+
const preFilterValues = [
|
|
77
78
|
{
|
|
78
79
|
key: settings.visualSearchFilterKey,
|
|
79
|
-
values: [
|
|
80
|
+
values: Object.keys(preFilter) as string[],
|
|
80
81
|
},
|
|
81
82
|
];
|
|
82
83
|
let filters: any[] = [];
|
|
@@ -84,7 +85,7 @@ function CameraCustom(props: Props) {
|
|
|
84
85
|
findByImage({
|
|
85
86
|
image: imageConvert,
|
|
86
87
|
settings,
|
|
87
|
-
filters:
|
|
88
|
+
filters: !isEmpty(preFilter) ? preFilterValues : undefined,
|
|
88
89
|
region,
|
|
89
90
|
})
|
|
90
91
|
.then((res: any) => {
|
|
@@ -35,7 +35,7 @@ const SearchBox = (props: any) => {
|
|
|
35
35
|
// const containerRefInputMobile = useRef<HTMLDivElement>(null);
|
|
36
36
|
const stateGlobal = useAppSelector(state => state);
|
|
37
37
|
const { search, settings } = stateGlobal;
|
|
38
|
-
const { imageThumbSearchInput,
|
|
38
|
+
const { imageThumbSearchInput, preFilter } = search;
|
|
39
39
|
const focusInp: any = useRef<HTMLDivElement | null>(null);
|
|
40
40
|
const history = useHistory();
|
|
41
41
|
const [valueInput, setValueInput] = useState<string>('');
|
|
@@ -96,13 +96,14 @@ const SearchBox = (props: any) => {
|
|
|
96
96
|
let payload: any;
|
|
97
97
|
let filters: any[] = [];
|
|
98
98
|
let region: RectCoords | undefined;
|
|
99
|
+
|
|
99
100
|
dispatch(setImageSearchInput(URL.createObjectURL(fs[0])));
|
|
100
101
|
let image = await createImage(fs[0]);
|
|
101
102
|
dispatch(setRequestImage(image));
|
|
102
|
-
const
|
|
103
|
+
const preFilterValues = [
|
|
103
104
|
{
|
|
104
105
|
key: settings.visualSearchFilterKey,
|
|
105
|
-
values: [
|
|
106
|
+
values: Object.keys(preFilter) as string[],
|
|
106
107
|
},
|
|
107
108
|
];
|
|
108
109
|
|
|
@@ -116,7 +117,7 @@ const SearchBox = (props: any) => {
|
|
|
116
117
|
return findByImage({
|
|
117
118
|
image,
|
|
118
119
|
settings,
|
|
119
|
-
filters:
|
|
120
|
+
filters: !isEmpty(preFilter) ? preFilterValues : undefined,
|
|
120
121
|
region,
|
|
121
122
|
})
|
|
122
123
|
.then((res: any) => {
|
|
@@ -156,7 +157,11 @@ const SearchBox = (props: any) => {
|
|
|
156
157
|
<form noValidate action="" role="search">
|
|
157
158
|
<Box className="box-inp">
|
|
158
159
|
<Tooltip
|
|
159
|
-
title={
|
|
160
|
+
title={
|
|
161
|
+
!isEmpty(preFilter)
|
|
162
|
+
? Object.keys(preFilter).join(', ')
|
|
163
|
+
: 'Add pre-filter'
|
|
164
|
+
}
|
|
160
165
|
placement="top"
|
|
161
166
|
arrow={true}
|
|
162
167
|
disableHoverListener={!settings.preFilterOption}
|
|
@@ -176,7 +181,7 @@ const SearchBox = (props: any) => {
|
|
|
176
181
|
<div
|
|
177
182
|
className="icon-hover"
|
|
178
183
|
style={{
|
|
179
|
-
...(
|
|
184
|
+
...(!isEmpty(preFilter)
|
|
180
185
|
? {
|
|
181
186
|
backgroundColor: `${settings.theme?.secondaryColor}26`,
|
|
182
187
|
}
|
|
@@ -189,7 +194,7 @@ const SearchBox = (props: any) => {
|
|
|
189
194
|
{!settings.preFilterOption && (
|
|
190
195
|
<IconSearch width={16} height={16} />
|
|
191
196
|
)}
|
|
192
|
-
{
|
|
197
|
+
{!isEmpty(preFilter) && (
|
|
193
198
|
<div
|
|
194
199
|
style={{
|
|
195
200
|
position: 'absolute',
|
|
@@ -37,7 +37,7 @@ function DefaultModal(props: Props): JSX.Element {
|
|
|
37
37
|
>
|
|
38
38
|
<div
|
|
39
39
|
className={classNameComponentChild}
|
|
40
|
-
style={{ overflowY: '
|
|
40
|
+
style={{ overflowY: 'auto', maxHeight: '95vh', borderRadius: 12 }}
|
|
41
41
|
>
|
|
42
42
|
{children}
|
|
43
43
|
</div>
|