@nyris/nyris-webapp 0.3.35 → 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.375ac411683570ee1df5aea6de03409d.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/DragDropFile.tsx +5 -4
- package/src/components/FooterMobile.tsx +8 -2
- 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/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 +108 -51
- package/src/components/results/ItemResult.tsx +1 -1
- 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 +41 -58
- 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.f5a1c730.chunk.css +0 -2
- package/build/static/css/main.f5a1c730.chunk.css.map +0 -1
- package/build/static/js/2.724f4cba.chunk.js +0 -3
- package/build/static/js/2.724f4cba.chunk.js.map +0 -1
- package/build/static/js/main.f579fa9f.chunk.js +0 -3
- package/build/static/js/main.f579fa9f.chunk.js.map +0 -1
- package/build/static/media/support3.4a17f96e.svg +0 -3
- /package/build/static/js/{2.724f4cba.chunk.js.LICENSE.txt → 2.ff44260e.chunk.js.LICENSE.txt} +0 -0
- /package/build/static/js/{main.f579fa9f.chunk.js.LICENSE.txt → main.0b3b11fc.chunk.js.LICENSE.txt} +0 -0
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
import { Box } from '@material-ui/core';
|
|
2
|
+
import { getCroppedCanvas } from 'helpers/getCroppedCanvas';
|
|
3
|
+
import React from 'react';
|
|
4
|
+
import { useMediaQuery } from 'react-responsive';
|
|
5
|
+
|
|
6
|
+
function RfqBanner({
|
|
7
|
+
requestImage,
|
|
8
|
+
rfqRef,
|
|
9
|
+
rfqStatus,
|
|
10
|
+
selectedRegion,
|
|
11
|
+
setIsRfqModalOpen,
|
|
12
|
+
}: {
|
|
13
|
+
rfqRef: any;
|
|
14
|
+
rfqStatus: any;
|
|
15
|
+
setIsRfqModalOpen: any;
|
|
16
|
+
requestImage: any;
|
|
17
|
+
selectedRegion: any;
|
|
18
|
+
}) {
|
|
19
|
+
const isMobile = useMediaQuery({ query: '(max-width: 776px)' });
|
|
20
|
+
|
|
21
|
+
return (
|
|
22
|
+
<Box
|
|
23
|
+
style={{
|
|
24
|
+
padding: '0px 16px 0px 16px',
|
|
25
|
+
backgroundColor: '#F6F3F1',
|
|
26
|
+
width: '100%',
|
|
27
|
+
marginBottom: !isMobile ? '32px' : '0px',
|
|
28
|
+
alignSelf: 'end',
|
|
29
|
+
height: '248px',
|
|
30
|
+
display: 'flex',
|
|
31
|
+
alignItems: 'center',
|
|
32
|
+
}}
|
|
33
|
+
className="rfq-box"
|
|
34
|
+
ref={rfqRef}
|
|
35
|
+
>
|
|
36
|
+
<Box
|
|
37
|
+
style={{
|
|
38
|
+
width: '100%',
|
|
39
|
+
display: 'flex',
|
|
40
|
+
columnGap: '16px',
|
|
41
|
+
alignItems: 'center',
|
|
42
|
+
justifyContent: 'space-around',
|
|
43
|
+
}}
|
|
44
|
+
>
|
|
45
|
+
<Box>
|
|
46
|
+
<Box
|
|
47
|
+
style={{
|
|
48
|
+
paddingBottom: '12px',
|
|
49
|
+
}}
|
|
50
|
+
>
|
|
51
|
+
<Box
|
|
52
|
+
style={{
|
|
53
|
+
fontSize: '14px',
|
|
54
|
+
color: rfqStatus === 'inactive' ? '#4B4B4A' : '#CACAD1',
|
|
55
|
+
fontWeight: 'bold',
|
|
56
|
+
}}
|
|
57
|
+
>
|
|
58
|
+
{isMobile
|
|
59
|
+
? 'No matches found?'
|
|
60
|
+
: 'No matches found for your request?'}
|
|
61
|
+
</Box>
|
|
62
|
+
<Box
|
|
63
|
+
style={{
|
|
64
|
+
fontSize: '12px',
|
|
65
|
+
maxWidth: '320x',
|
|
66
|
+
lineHeight: '14.1px',
|
|
67
|
+
color: rfqStatus === 'inactive' ? '#4B4B4A' : '#CACAD1',
|
|
68
|
+
fontWeight: 'normal',
|
|
69
|
+
}}
|
|
70
|
+
>
|
|
71
|
+
Get personalised help from our team of product experts.
|
|
72
|
+
</Box>
|
|
73
|
+
</Box>
|
|
74
|
+
<button
|
|
75
|
+
style={{
|
|
76
|
+
maxWidth: '200px',
|
|
77
|
+
background: rfqStatus === 'inactive' ? '#4B4B4A' : '#E9E9EC',
|
|
78
|
+
boxShadow:
|
|
79
|
+
rfqStatus === 'inactive'
|
|
80
|
+
? '0px 0px 4px 0px rgba(0, 0, 0, 0.25)'
|
|
81
|
+
: '',
|
|
82
|
+
borderRadius: '2px',
|
|
83
|
+
padding: '16px 16px 16px 16px',
|
|
84
|
+
display: 'flex',
|
|
85
|
+
alignItems: 'center',
|
|
86
|
+
color: rfqStatus === 'inactive' ? '#fff' : '#CACAD1',
|
|
87
|
+
fontSize: '14px',
|
|
88
|
+
height: '48px',
|
|
89
|
+
cursor: rfqStatus === 'inactive' ? 'pointer' : 'default',
|
|
90
|
+
border: 'none',
|
|
91
|
+
}}
|
|
92
|
+
disabled={rfqStatus !== 'inactive'}
|
|
93
|
+
onClick={() => {
|
|
94
|
+
setIsRfqModalOpen(true);
|
|
95
|
+
}}
|
|
96
|
+
>
|
|
97
|
+
Request a Quote
|
|
98
|
+
</button>
|
|
99
|
+
</Box>
|
|
100
|
+
<div>
|
|
101
|
+
<img
|
|
102
|
+
src={getCroppedCanvas(
|
|
103
|
+
requestImage?.canvas,
|
|
104
|
+
selectedRegion,
|
|
105
|
+
)?.toDataURL()}
|
|
106
|
+
alt="request_image"
|
|
107
|
+
style={{
|
|
108
|
+
mixBlendMode: rfqStatus !== 'inactive' ? 'overlay' : 'unset',
|
|
109
|
+
maxHeight: '181px',
|
|
110
|
+
maxWidth: '181px',
|
|
111
|
+
borderRadius: '2px',
|
|
112
|
+
}}
|
|
113
|
+
/>
|
|
114
|
+
</div>
|
|
115
|
+
</Box>
|
|
116
|
+
</Box>
|
|
117
|
+
);
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
export default RfqBanner;
|
|
@@ -0,0 +1,147 @@
|
|
|
1
|
+
import { Box, Button, Typography } from '@material-ui/core';
|
|
2
|
+
import { RectCoords } from '@nyris/nyris-api';
|
|
3
|
+
import { Preview } from '@nyris/nyris-react-components';
|
|
4
|
+
import React, { useState } from 'react';
|
|
5
|
+
import ExpandablePanelComponent from './PanelResult';
|
|
6
|
+
import { useTranslation } from 'react-i18next';
|
|
7
|
+
import { useAppSelector } from 'Store/Store';
|
|
8
|
+
import KeyboardArrowRightOutlinedIcon from '@material-ui/icons/KeyboardArrowRightOutlined';
|
|
9
|
+
import KeyboardArrowLeftOutlinedIcon from '@material-ui/icons/KeyboardArrowLeftOutlined';
|
|
10
|
+
import { DEFAULT_REGION } from '../constants';
|
|
11
|
+
import { ReactComponent as IconInfo } from 'common/assets/icons/info-tooltip.svg';
|
|
12
|
+
|
|
13
|
+
function SidePanel({
|
|
14
|
+
setImageSelection,
|
|
15
|
+
imageSelection,
|
|
16
|
+
debouncedOnImageSelectionChange,
|
|
17
|
+
filteredRegions,
|
|
18
|
+
showAdjustInfoBasedOnConfidence,
|
|
19
|
+
showAdjustInfo,
|
|
20
|
+
showPostFilter,
|
|
21
|
+
disjunctiveFacets,
|
|
22
|
+
}: {
|
|
23
|
+
setImageSelection: any;
|
|
24
|
+
imageSelection: any;
|
|
25
|
+
debouncedOnImageSelectionChange: any;
|
|
26
|
+
filteredRegions: any;
|
|
27
|
+
showAdjustInfoBasedOnConfidence: any;
|
|
28
|
+
showAdjustInfo: any;
|
|
29
|
+
showPostFilter: any;
|
|
30
|
+
allSearchResults: any;
|
|
31
|
+
disjunctiveFacets: any;
|
|
32
|
+
}) {
|
|
33
|
+
const { t } = useTranslation();
|
|
34
|
+
const [toggleColLeft, setToggleColLeft] = useState<boolean>(false);
|
|
35
|
+
const stateGlobal = useAppSelector((state: any) => state);
|
|
36
|
+
const { search, settings } = stateGlobal;
|
|
37
|
+
|
|
38
|
+
const { requestImage } = search;
|
|
39
|
+
|
|
40
|
+
return (
|
|
41
|
+
<Box
|
|
42
|
+
className={`wrap-main-col-left ${toggleColLeft ? 'toggle' : ''}`}
|
|
43
|
+
style={{
|
|
44
|
+
display: 'flex',
|
|
45
|
+
flexDirection: 'column',
|
|
46
|
+
justifyContent: 'space-between',
|
|
47
|
+
}}
|
|
48
|
+
>
|
|
49
|
+
<Box
|
|
50
|
+
className="box-toggle-coloumn"
|
|
51
|
+
style={{
|
|
52
|
+
right: requestImage || toggleColLeft ? '0px' : '16px',
|
|
53
|
+
}}
|
|
54
|
+
>
|
|
55
|
+
<Button
|
|
56
|
+
style={{
|
|
57
|
+
color: '#55566b',
|
|
58
|
+
height: '32px',
|
|
59
|
+
}}
|
|
60
|
+
onClick={() => {
|
|
61
|
+
setToggleColLeft(!toggleColLeft);
|
|
62
|
+
}}
|
|
63
|
+
>
|
|
64
|
+
{toggleColLeft ? (
|
|
65
|
+
<KeyboardArrowRightOutlinedIcon />
|
|
66
|
+
) : (
|
|
67
|
+
<KeyboardArrowLeftOutlinedIcon />
|
|
68
|
+
)}
|
|
69
|
+
</Button>
|
|
70
|
+
</Box>
|
|
71
|
+
<Box>
|
|
72
|
+
{settings.preview && requestImage && (
|
|
73
|
+
<Box className="col-left">
|
|
74
|
+
<Box className="box-preview">
|
|
75
|
+
<Box
|
|
76
|
+
className="preview-item"
|
|
77
|
+
style={{
|
|
78
|
+
backgroundColor: 'white',
|
|
79
|
+
paddingTop: '32px',
|
|
80
|
+
width: '100%',
|
|
81
|
+
}}
|
|
82
|
+
>
|
|
83
|
+
<div
|
|
84
|
+
style={{
|
|
85
|
+
backgroundColor: '#F3F3F5',
|
|
86
|
+
width: '100%',
|
|
87
|
+
paddingTop: '16px',
|
|
88
|
+
paddingBottom: '16px',
|
|
89
|
+
}}
|
|
90
|
+
>
|
|
91
|
+
<Preview
|
|
92
|
+
key={requestImage?.id}
|
|
93
|
+
onSelectionChange={(r: RectCoords) => {
|
|
94
|
+
setImageSelection(r);
|
|
95
|
+
debouncedOnImageSelectionChange(r);
|
|
96
|
+
}}
|
|
97
|
+
image={requestImage?.canvas}
|
|
98
|
+
selection={imageSelection || DEFAULT_REGION}
|
|
99
|
+
regions={filteredRegions}
|
|
100
|
+
maxWidth={288}
|
|
101
|
+
maxHeight={288}
|
|
102
|
+
dotColor={'#FBD914'}
|
|
103
|
+
minCropWidth={60}
|
|
104
|
+
minCropHeight={60}
|
|
105
|
+
rounded={true}
|
|
106
|
+
/>
|
|
107
|
+
</div>
|
|
108
|
+
</Box>
|
|
109
|
+
</Box>
|
|
110
|
+
{(showAdjustInfoBasedOnConfidence || showAdjustInfo) && (
|
|
111
|
+
<Box
|
|
112
|
+
className="box-title_col-left"
|
|
113
|
+
alignItems="center"
|
|
114
|
+
style={{
|
|
115
|
+
backgroundColor: '#3E36DC',
|
|
116
|
+
display: 'flex',
|
|
117
|
+
columnGap: '6px',
|
|
118
|
+
padding: '5px',
|
|
119
|
+
}}
|
|
120
|
+
>
|
|
121
|
+
<IconInfo color="white" />
|
|
122
|
+
<Typography
|
|
123
|
+
style={{
|
|
124
|
+
fontSize: 10,
|
|
125
|
+
color: '#fff',
|
|
126
|
+
}}
|
|
127
|
+
>
|
|
128
|
+
{showAdjustInfo
|
|
129
|
+
? t('Crop the image for better results')
|
|
130
|
+
: 'Crop the image for better results'}
|
|
131
|
+
</Typography>
|
|
132
|
+
</Box>
|
|
133
|
+
)}
|
|
134
|
+
</Box>
|
|
135
|
+
)}
|
|
136
|
+
|
|
137
|
+
{showPostFilter && (
|
|
138
|
+
<Box className="col-left__bottom">
|
|
139
|
+
<ExpandablePanelComponent disjunctiveFacets={disjunctiveFacets} />
|
|
140
|
+
</Box>
|
|
141
|
+
)}
|
|
142
|
+
</Box>
|
|
143
|
+
</Box>
|
|
144
|
+
);
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
export default SidePanel;
|
|
@@ -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;
|
|
@@ -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>
|