@nyris/nyris-webapp 0.3.53 → 0.3.55
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 +8 -7
- package/build/images/fav2/android-chrome-192x192.png +0 -0
- package/build/images/fav2/android-chrome-512x512.png +0 -0
- package/build/images/fav2/apple-touch-icon.png +0 -0
- package/build/images/fav2/browserconfig.xml +9 -0
- package/build/images/fav2/favicon-16x16.png +0 -0
- package/build/images/fav2/favicon-32x32.png +0 -0
- package/build/images/fav2/favicon.ico +0 -0
- package/build/images/fav2/mstile-144x144.png +0 -0
- package/build/images/fav2/mstile-150x150.png +0 -0
- package/build/images/fav2/mstile-310x150.png +0 -0
- package/build/images/fav2/mstile-310x310.png +0 -0
- package/build/images/fav2/mstile-70x70.png +0 -0
- package/build/images/fav2/safari-pinned-tab.svg +67 -0
- package/build/images/fav2/site.webmanifest +19 -0
- package/build/index.html +1 -1
- package/build/js/settings.example.js +1 -2
- package/build/manifest.json +13 -18
- package/build/static/css/main.d7425370.css +2 -0
- package/build/static/css/main.d7425370.css.map +1 -0
- package/build/static/js/main.7b9e6c68.js +3 -0
- package/build/static/js/{main.ebb92e93.js.LICENSE.txt → main.7b9e6c68.js.LICENSE.txt} +1 -1
- package/build/static/js/main.7b9e6c68.js.map +1 -0
- package/build/static/media/path.b99a15de38340a04f80828bceeab9884.svg +3 -0
- package/package.json +3 -3
- package/public/images/fav2/android-chrome-192x192.png +0 -0
- package/public/images/fav2/android-chrome-512x512.png +0 -0
- package/public/images/fav2/apple-touch-icon.png +0 -0
- package/public/images/fav2/browserconfig.xml +9 -0
- package/public/images/fav2/favicon-16x16.png +0 -0
- package/public/images/fav2/favicon-32x32.png +0 -0
- package/public/images/fav2/favicon.ico +0 -0
- package/public/images/fav2/mstile-144x144.png +0 -0
- package/public/images/fav2/mstile-150x150.png +0 -0
- package/public/images/fav2/mstile-310x150.png +0 -0
- package/public/images/fav2/mstile-310x310.png +0 -0
- package/public/images/fav2/mstile-70x70.png +0 -0
- package/public/images/fav2/safari-pinned-tab.svg +67 -0
- package/public/images/fav2/site.webmanifest +19 -0
- package/public/index.html +8 -90
- package/public/js/settings.example.js +1 -2
- package/public/manifest.json +13 -18
- package/src/Store/Store.ts +0 -1
- package/src/Store/search/Search.ts +33 -74
- package/src/Store/search/search.initialState.ts +5 -4
- package/src/Store/search/types.ts +5 -4
- package/src/common/assets/icons/path.svg +3 -0
- package/src/components/AppMobile.tsx +0 -1
- package/src/components/DragDropFile.tsx +36 -28
- package/src/components/Experience-visual-search/ExperienceVisualSearch.scss +3 -4
- package/src/components/Experience-visual-search/ExperienceVisualSearch.tsx +14 -7
- package/src/components/Feedback.tsx +5 -5
- package/src/components/FooterMobile.tsx +4 -5
- package/src/components/GoBackButton.tsx +54 -0
- package/src/components/Header.tsx +27 -3
- package/src/components/HeaderMobile.tsx +29 -12
- package/src/components/ImagePreviewMobile.tsx +6 -3
- package/src/components/Inquiry/InquiryBanner.tsx +1 -1
- package/src/components/Layout.tsx +5 -14
- package/src/components/PanelResult/PostFilterAlgolia.tsx +3 -2
- package/src/components/ProductDetailView.tsx +338 -330
- package/src/components/ProductList/index.tsx +1 -1
- package/src/components/appMobile.scss +7 -0
- package/src/components/clear-refinements/clear-refinements.tsx +1 -1
- package/src/components/common.scss +18 -7
- package/src/components/current-refinements/current-refinements.tsx +10 -22
- package/src/components/drawer/cameraCustom.tsx +12 -1
- package/src/components/input/inputSearch.tsx +79 -21
- package/src/components/pre-filter/index.tsx +23 -7
- package/src/components/results/ItemResult.tsx +296 -281
- package/src/index.tsx +12 -14
- package/src/page/landingPage/AppMobile.tsx +3 -9
- package/src/page/landingPage/common.scss +164 -48
- package/src/page/result/index.tsx +116 -87
- package/src/translations.ts +3 -0
- package/src/types.ts +1 -0
- package/build/images/fav/android-icon-192x192.png +0 -0
- package/build/images/fav/apple-icon-114x114.png +0 -0
- package/build/images/fav/apple-icon-120x120.png +0 -0
- package/build/images/fav/apple-icon-144x144.png +0 -0
- package/build/images/fav/apple-icon-152x152.png +0 -0
- package/build/images/fav/apple-icon-180x180.png +0 -0
- package/build/images/fav/apple-icon-57x57.png +0 -0
- package/build/images/fav/apple-icon-60x60.png +0 -0
- package/build/images/fav/apple-icon-72x72.png +0 -0
- package/build/images/fav/apple-icon-76x76.png +0 -0
- package/build/images/fav/browserconfig.xml +0 -2
- package/build/images/fav/favicon-16x16.png +0 -0
- package/build/images/fav/favicon-32x32.png +0 -0
- package/build/images/fav/favicon-96x96.png +0 -0
- package/build/images/fav/manifest.json +0 -35
- package/build/static/css/main.8c0eb6c0.css +0 -2
- package/build/static/css/main.8c0eb6c0.css.map +0 -1
- package/build/static/js/main.ebb92e93.js +0 -3
- package/build/static/js/main.ebb92e93.js.map +0 -1
- package/public/images/fav/android-icon-192x192.png +0 -0
- package/public/images/fav/apple-icon-114x114.png +0 -0
- package/public/images/fav/apple-icon-120x120.png +0 -0
- package/public/images/fav/apple-icon-144x144.png +0 -0
- package/public/images/fav/apple-icon-152x152.png +0 -0
- package/public/images/fav/apple-icon-180x180.png +0 -0
- package/public/images/fav/apple-icon-57x57.png +0 -0
- package/public/images/fav/apple-icon-60x60.png +0 -0
- package/public/images/fav/apple-icon-72x72.png +0 -0
- package/public/images/fav/apple-icon-76x76.png +0 -0
- package/public/images/fav/browserconfig.xml +0 -2
- package/public/images/fav/favicon-16x16.png +0 -0
- package/public/images/fav/favicon-32x32.png +0 -0
- package/public/images/fav/favicon-96x96.png +0 -0
- package/public/images/fav/manifest.json +0 -35
|
@@ -10,6 +10,11 @@ import {
|
|
|
10
10
|
loadingActionResults,
|
|
11
11
|
setRegions,
|
|
12
12
|
setSelectedRegion,
|
|
13
|
+
setShowFeedback,
|
|
14
|
+
setFirstSearchResults,
|
|
15
|
+
setFirstSearchImage,
|
|
16
|
+
setFirstSearchPrefilters,
|
|
17
|
+
setFirstSearchThumbSearchInput
|
|
13
18
|
} from 'Store/search/Search';
|
|
14
19
|
import { useHistory } from 'react-router-dom';
|
|
15
20
|
import { ReactComponent as IconDownload } from 'common/assets/icons/IconUploadDownward.svg';
|
|
@@ -50,7 +55,7 @@ function DragDropFile(props: Props) {
|
|
|
50
55
|
const preFilterValues = [
|
|
51
56
|
{
|
|
52
57
|
key: settings.visualSearchFilterKey,
|
|
53
|
-
values: Object.keys(preFilter)
|
|
58
|
+
values: Object.keys(preFilter),
|
|
54
59
|
},
|
|
55
60
|
];
|
|
56
61
|
let region: RectCoords | undefined;
|
|
@@ -83,6 +88,12 @@ function DragDropFile(props: Props) {
|
|
|
83
88
|
dispatch(setSearchResults(payload));
|
|
84
89
|
onChangeLoading(false);
|
|
85
90
|
dispatch(updateStatusLoading(false));
|
|
91
|
+
dispatch(setShowFeedback(true));
|
|
92
|
+
// go back
|
|
93
|
+
dispatch(setFirstSearchResults(payload));
|
|
94
|
+
dispatch(setFirstSearchImage(image));
|
|
95
|
+
dispatch(setFirstSearchPrefilters(preFilter));
|
|
96
|
+
dispatch(setFirstSearchThumbSearchInput(URL.createObjectURL(fs[0])));
|
|
86
97
|
return;
|
|
87
98
|
});
|
|
88
99
|
}
|
|
@@ -105,35 +116,32 @@ function DragDropFile(props: Props) {
|
|
|
105
116
|
},
|
|
106
117
|
})}
|
|
107
118
|
>
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
{
|
|
112
|
-
|
|
113
|
-
e.stopPropagation();
|
|
114
|
-
},
|
|
119
|
+
<div
|
|
120
|
+
className={`box-content-drop ${isDragActive ? 'drag-active' : ''}`}
|
|
121
|
+
{...getRootProps({
|
|
122
|
+
onClick: e => {
|
|
123
|
+
e.stopPropagation();},
|
|
115
124
|
})}
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
</div>
|
|
120
|
-
<label htmlFor="select_file" className="" style={{ fontSize: 14 }}>
|
|
121
|
-
<span className="fw-700 text-f14" style={{ paddingRight: '4px' }}>
|
|
122
|
-
{t('Drag and drop')}
|
|
123
|
-
</span>
|
|
124
|
-
{t('an image here')}
|
|
125
|
-
</label>
|
|
126
|
-
<input
|
|
127
|
-
{...getInputProps()}
|
|
128
|
-
type="file"
|
|
129
|
-
name="file"
|
|
130
|
-
id="select_file"
|
|
131
|
-
className="inputFile"
|
|
132
|
-
placeholder="Choose photo"
|
|
133
|
-
style={{ display: 'block', cursor: 'pointer' }}
|
|
134
|
-
/>
|
|
125
|
+
>
|
|
126
|
+
<div style={{ marginBottom: 16 }}>
|
|
127
|
+
<IconDownload width={48} height={48} />
|
|
135
128
|
</div>
|
|
136
|
-
|
|
129
|
+
<label htmlFor="select_file" className="" style={{ fontSize: 14 }}>
|
|
130
|
+
<span className="fw-700 text-f14" style={{ paddingRight: '4px' }}>
|
|
131
|
+
{t('Drag and drop')}
|
|
132
|
+
</span>
|
|
133
|
+
{t('an image here')}
|
|
134
|
+
</label>
|
|
135
|
+
<input
|
|
136
|
+
{...getInputProps()}
|
|
137
|
+
type="file"
|
|
138
|
+
name="file"
|
|
139
|
+
id="select_file"
|
|
140
|
+
className="inputFile"
|
|
141
|
+
placeholder="Choose photo"
|
|
142
|
+
style={{ display: 'block', cursor: 'pointer' }}
|
|
143
|
+
/>
|
|
144
|
+
</div>
|
|
137
145
|
</div>
|
|
138
146
|
</div>
|
|
139
147
|
);
|
|
@@ -24,7 +24,7 @@ body.overflow-hidden {
|
|
|
24
24
|
margin-right: 8px;
|
|
25
25
|
overflow: hidden;
|
|
26
26
|
white-space: nowrap;
|
|
27
|
-
font-family: 'Source Sans 3';
|
|
27
|
+
font-family: 'Source Sans 3', sans-serif;
|
|
28
28
|
font-size: 14px;
|
|
29
29
|
font-weight: 600;
|
|
30
30
|
line-height: 16px;
|
|
@@ -63,7 +63,7 @@ body.overflow-hidden {
|
|
|
63
63
|
position: absolute;
|
|
64
64
|
}
|
|
65
65
|
&-title {
|
|
66
|
-
font-family: 'Source Sans 3'
|
|
66
|
+
font-family: 'Source Sans 3', sans-serif;;
|
|
67
67
|
font-size: 20px;
|
|
68
68
|
font-weight: 700;
|
|
69
69
|
line-height: 24px;
|
|
@@ -103,7 +103,6 @@ body.overflow-hidden {
|
|
|
103
103
|
position: absolute;
|
|
104
104
|
border-radius: 100%;
|
|
105
105
|
background-color: #F3F3F5;
|
|
106
|
-
display: block;
|
|
107
106
|
overflow: hidden;
|
|
108
107
|
z-index: 11;
|
|
109
108
|
width: 32px;
|
|
@@ -160,7 +159,7 @@ body.overflow-hidden {
|
|
|
160
159
|
margin-right: 8px;
|
|
161
160
|
overflow: hidden;
|
|
162
161
|
white-space: nowrap;
|
|
163
|
-
font-family: 'Source Sans 3'
|
|
162
|
+
font-family: 'Source Sans 3', sans-serif;;
|
|
164
163
|
font-size: 14px;
|
|
165
164
|
font-weight: 600;
|
|
166
165
|
line-height: 16px;
|
|
@@ -12,7 +12,11 @@ import {
|
|
|
12
12
|
setRequestImage,
|
|
13
13
|
setSearchResults,
|
|
14
14
|
setSelectedRegion,
|
|
15
|
-
updateStatusLoading
|
|
15
|
+
updateStatusLoading,
|
|
16
|
+
setFirstSearchResults,
|
|
17
|
+
setFirstSearchImage,
|
|
18
|
+
setFirstSearchPrefilters,
|
|
19
|
+
setFirstSearchThumbSearchInput
|
|
16
20
|
} from '../../Store/search/Search';
|
|
17
21
|
import { createImage, find, findRegions } from '../../services/image';
|
|
18
22
|
import { RectCoords } from '@nyris/nyris-api';
|
|
@@ -34,12 +38,10 @@ function ExperienceVisualSearch() {
|
|
|
34
38
|
(button.current as HTMLElement).classList.toggle('hover');
|
|
35
39
|
}
|
|
36
40
|
}, 3000);
|
|
37
|
-
} else {
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
(button.current as HTMLElement).classList.toggle('hover');
|
|
42
|
-
}
|
|
41
|
+
} else if (interval?.current) {
|
|
42
|
+
clearInterval(interval?.current);
|
|
43
|
+
if (button?.current && !(button.current as HTMLElement).classList.contains('hover')) {
|
|
44
|
+
(button.current as HTMLElement).classList.toggle('hover');
|
|
43
45
|
}
|
|
44
46
|
}
|
|
45
47
|
return () => {
|
|
@@ -91,6 +93,11 @@ function ExperienceVisualSearch() {
|
|
|
91
93
|
}).then((res: any) => {
|
|
92
94
|
dispatch(setSearchResults(res));
|
|
93
95
|
dispatch(updateStatusLoading(false));
|
|
96
|
+
// go back
|
|
97
|
+
dispatch(setFirstSearchResults(res));
|
|
98
|
+
dispatch(setFirstSearchImage(image));
|
|
99
|
+
dispatch(setFirstSearchPrefilters(search.preFilter));
|
|
100
|
+
dispatch(setFirstSearchThumbSearchInput(url));
|
|
94
101
|
return;
|
|
95
102
|
});
|
|
96
103
|
};
|
|
@@ -13,19 +13,19 @@ function Feedback({
|
|
|
13
13
|
return (
|
|
14
14
|
<div className="feedback-wrapper">
|
|
15
15
|
<p>Are these results useful?</p>
|
|
16
|
+
|
|
16
17
|
<div
|
|
17
18
|
className="feedback-icon-wrapper"
|
|
18
|
-
onClick={() => submitFeedback(
|
|
19
|
+
onClick={() => submitFeedback(true)}
|
|
19
20
|
>
|
|
20
|
-
<
|
|
21
|
+
<IconLike />
|
|
21
22
|
</div>
|
|
22
23
|
<div
|
|
23
24
|
className="feedback-icon-wrapper"
|
|
24
|
-
onClick={() => submitFeedback(
|
|
25
|
+
onClick={() => submitFeedback(false)}
|
|
25
26
|
>
|
|
26
|
-
<
|
|
27
|
+
<IconDislike />
|
|
27
28
|
</div>
|
|
28
|
-
|
|
29
29
|
<div className="feedback-icon-wrapper" onClick={() => onFeedbackClose()}>
|
|
30
30
|
<IconClose />
|
|
31
31
|
</div>
|
|
@@ -3,7 +3,7 @@ import React, { useState } from 'react';
|
|
|
3
3
|
import { ReactComponent as IconCameraMobile } from 'common/assets/icons/icon_camera_mobile.svg';
|
|
4
4
|
import CameraCustom from './drawer/cameraCustom';
|
|
5
5
|
import { ReactComponent as Home } from 'common/assets/icons/home.svg';
|
|
6
|
-
import {
|
|
6
|
+
import { useHistory } from 'react-router-dom';
|
|
7
7
|
import { useAppDispatch, useAppSelector } from 'Store/Store';
|
|
8
8
|
import { ReactComponent as IconInfo } from 'common/assets/icons/info-tooltip.svg';
|
|
9
9
|
import { ReactComponent as IconLogout } from 'common/assets/icons/logout.svg';
|
|
@@ -135,7 +135,7 @@ function FooterMobile(props: Props): JSX.Element {
|
|
|
135
135
|
justifyContent: 'space-between',
|
|
136
136
|
}}
|
|
137
137
|
>
|
|
138
|
-
<
|
|
138
|
+
<a
|
|
139
139
|
style={{
|
|
140
140
|
width: '48px',
|
|
141
141
|
height: '48px',
|
|
@@ -148,8 +148,7 @@ function FooterMobile(props: Props): JSX.Element {
|
|
|
148
148
|
? `#E0E0E0`
|
|
149
149
|
: '',
|
|
150
150
|
}}
|
|
151
|
-
|
|
152
|
-
to={'/'}
|
|
151
|
+
href="/"
|
|
153
152
|
className="nav-link p-0 menu-children rounded-0"
|
|
154
153
|
onClick={() => {
|
|
155
154
|
dispatch(reset(''));
|
|
@@ -164,7 +163,7 @@ function FooterMobile(props: Props): JSX.Element {
|
|
|
164
163
|
: '#AAABB5'
|
|
165
164
|
}
|
|
166
165
|
/>
|
|
167
|
-
</
|
|
166
|
+
</a>
|
|
168
167
|
{history.location?.pathname !== '/' && !imageCaptureHelpModal && (
|
|
169
168
|
<div className="box-icon-camera-mobile">
|
|
170
169
|
<Button
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import React, {useCallback} from 'react';
|
|
2
|
+
import { useTranslation } from 'react-i18next';
|
|
3
|
+
import { useMediaQuery } from 'react-responsive';
|
|
4
|
+
import { CurrentRefinementsProvided } from 'react-instantsearch-core';
|
|
5
|
+
import {
|
|
6
|
+
setImageSearchInput,
|
|
7
|
+
setPreFilter,
|
|
8
|
+
setRequestImage,
|
|
9
|
+
setSearchResults,
|
|
10
|
+
clearPostFilter
|
|
11
|
+
} from '../Store/search/Search';
|
|
12
|
+
import { connectCurrentRefinements } from 'react-instantsearch-dom';
|
|
13
|
+
import { ReactComponent as GoBackIcon } from 'common/assets/icons/path.svg';
|
|
14
|
+
import { useAppDispatch, useAppSelector } from '../Store/Store';
|
|
15
|
+
|
|
16
|
+
const GoBackButton = ({ items, refine }: CurrentRefinementsProvided) => {
|
|
17
|
+
const isMobile = useMediaQuery({ query: '(max-width: 776px)' });
|
|
18
|
+
const dispatch = useAppDispatch();
|
|
19
|
+
const stateGlobal = useAppSelector(state => state);
|
|
20
|
+
const { search } = stateGlobal;
|
|
21
|
+
const {
|
|
22
|
+
firstSearchResults,
|
|
23
|
+
firstSearchImage,
|
|
24
|
+
firstSearchPrefilters,
|
|
25
|
+
firstSearchThumbSearchInput,
|
|
26
|
+
} = search;
|
|
27
|
+
const clearPostFilters = useCallback(() => refine(items), [refine, items]);
|
|
28
|
+
const { t } = useTranslation();
|
|
29
|
+
|
|
30
|
+
const onGoBack = () => {
|
|
31
|
+
dispatch(setSearchResults(firstSearchResults));
|
|
32
|
+
dispatch(setRequestImage(firstSearchImage));
|
|
33
|
+
dispatch(setPreFilter(firstSearchPrefilters));
|
|
34
|
+
dispatch(clearPostFilter());
|
|
35
|
+
clearPostFilters();
|
|
36
|
+
if (!isMobile) {
|
|
37
|
+
dispatch(setImageSearchInput(firstSearchThumbSearchInput));
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
return (
|
|
42
|
+
<div
|
|
43
|
+
className={`go-back-button ${isMobile ? 'mobile-view' : ''}`}
|
|
44
|
+
onClick={() => onGoBack()}
|
|
45
|
+
>
|
|
46
|
+
<GoBackIcon width={16} height={16} />
|
|
47
|
+
{t('Back to request image')}
|
|
48
|
+
</div>
|
|
49
|
+
)
|
|
50
|
+
};
|
|
51
|
+
|
|
52
|
+
export const GoBack = connectCurrentRefinements<any>(
|
|
53
|
+
GoBackButton,
|
|
54
|
+
);
|
|
@@ -1,20 +1,33 @@
|
|
|
1
1
|
import { Menu, MenuProps, withStyles } from '@material-ui/core';
|
|
2
|
-
import React from 'react';
|
|
2
|
+
import React, {useEffect, useState} from 'react';
|
|
3
|
+
import { useHistory } from 'react-router-dom';
|
|
3
4
|
import './common.scss';
|
|
4
5
|
import { useAppDispatch, useAppSelector } from 'Store/Store';
|
|
5
6
|
import { reset, setPreFilter } from 'Store/search/Search';
|
|
6
7
|
import { useAuth0 } from '@auth0/auth0-react';
|
|
7
8
|
import { ReactComponent as AvatarIcon } from 'common/assets/icons/avatar.svg';
|
|
8
9
|
import MenuItem from '@material-ui/core/MenuItem';
|
|
10
|
+
import CustomSearchBox from "./input/inputSearch";
|
|
11
|
+
|
|
9
12
|
|
|
10
13
|
function Header(): JSX.Element {
|
|
11
14
|
const dispatch = useAppDispatch();
|
|
12
15
|
const { settings } = useAppSelector(state => state);
|
|
13
16
|
const { user, isAuthenticated, logout } = useAuth0();
|
|
14
17
|
const auth0 = settings.auth0;
|
|
15
|
-
|
|
18
|
+
const history = useHistory();
|
|
19
|
+
const [showSearchBar, setShowSearchBar] = useState(false);
|
|
16
20
|
const [anchorEl, setAnchorEl] = React.useState(null);
|
|
17
21
|
|
|
22
|
+
useEffect(() => {
|
|
23
|
+
if (history.location?.pathname === '/') {
|
|
24
|
+
setShowSearchBar(false);
|
|
25
|
+
} else {
|
|
26
|
+
setShowSearchBar(true);
|
|
27
|
+
}
|
|
28
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
29
|
+
}, [history.location]);
|
|
30
|
+
|
|
18
31
|
const handleClick = (event: any) => {
|
|
19
32
|
setAnchorEl(event.currentTarget);
|
|
20
33
|
};
|
|
@@ -60,7 +73,7 @@ function Header(): JSX.Element {
|
|
|
60
73
|
}))(MenuItem);
|
|
61
74
|
|
|
62
75
|
return (
|
|
63
|
-
<div className="box-content" style={{ display: 'flex' }}>
|
|
76
|
+
<div className="box-content" style={{ display: 'flex', position: 'relative' }}>
|
|
64
77
|
<a
|
|
65
78
|
href={window.location.origin}
|
|
66
79
|
style={{ lineHeight: 0, paddingLeft: '10px' }}
|
|
@@ -79,6 +92,17 @@ function Header(): JSX.Element {
|
|
|
79
92
|
}}
|
|
80
93
|
/>
|
|
81
94
|
</a>
|
|
95
|
+
<div
|
|
96
|
+
style={{
|
|
97
|
+
position: 'absolute',
|
|
98
|
+
left: '50%',
|
|
99
|
+
top: '50%',
|
|
100
|
+
transform: 'translate(-50%, -50%)',
|
|
101
|
+
display: showSearchBar ? 'block' : 'none'
|
|
102
|
+
}}
|
|
103
|
+
>
|
|
104
|
+
<CustomSearchBox />
|
|
105
|
+
</div>
|
|
82
106
|
|
|
83
107
|
{auth0.enabled && isAuthenticated && (
|
|
84
108
|
<div style={{ position: 'relative' }}>
|
|
@@ -20,6 +20,7 @@ import {
|
|
|
20
20
|
updateQueryText,
|
|
21
21
|
updateStatusLoading,
|
|
22
22
|
setSearchResults,
|
|
23
|
+
setShowFeedback,
|
|
23
24
|
} from 'Store/search/Search';
|
|
24
25
|
import { useAppDispatch, useAppSelector } from 'Store/Store';
|
|
25
26
|
import { AppState } from 'types';
|
|
@@ -124,7 +125,7 @@ function HeaderMobileComponent(props: Props): JSX.Element {
|
|
|
124
125
|
const preFilterValues = [
|
|
125
126
|
{
|
|
126
127
|
key: settings.visualSearchFilterKey,
|
|
127
|
-
values: Object.keys(preFilter)
|
|
128
|
+
values: Object.keys(preFilter),
|
|
128
129
|
},
|
|
129
130
|
];
|
|
130
131
|
if (value || requestImage) {
|
|
@@ -149,6 +150,7 @@ function HeaderMobileComponent(props: Props): JSX.Element {
|
|
|
149
150
|
};
|
|
150
151
|
dispatch(setSearchResults(payload));
|
|
151
152
|
dispatch(updateStatusLoading(false));
|
|
153
|
+
dispatch(setShowFeedback(true));
|
|
152
154
|
})
|
|
153
155
|
.catch((e: any) => {
|
|
154
156
|
console.log('error input search', e);
|
|
@@ -221,6 +223,17 @@ function HeaderMobileComponent(props: Props): JSX.Element {
|
|
|
221
223
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
222
224
|
}, [settings, results, props.allSearchResults?.hits]);
|
|
223
225
|
|
|
226
|
+
const showPreFilter = useMemo(() => {
|
|
227
|
+
if (settings.shouldUseUserMetadata && user) {
|
|
228
|
+
if (settings.preFilterOption && !user['/user_metadata'].value) {
|
|
229
|
+
return true;
|
|
230
|
+
}
|
|
231
|
+
return false;
|
|
232
|
+
}
|
|
233
|
+
|
|
234
|
+
return settings.preFilterOption;
|
|
235
|
+
}, [settings.preFilterOption, settings.shouldUseUserMetadata, user]);
|
|
236
|
+
|
|
224
237
|
return (
|
|
225
238
|
<div style={{ width: '100%', background: '#fff' }}>
|
|
226
239
|
{history.location?.pathname !== '/result' && (
|
|
@@ -283,20 +296,20 @@ function HeaderMobileComponent(props: Props): JSX.Element {
|
|
|
283
296
|
<div
|
|
284
297
|
className="pre-filter-icon"
|
|
285
298
|
onClick={() => {
|
|
286
|
-
if (
|
|
299
|
+
if (showPreFilter) {
|
|
287
300
|
onToggleFilterMobile(false);
|
|
288
301
|
dispatch(setPreFilterDropdown(!preFilterDropdown));
|
|
289
302
|
}
|
|
290
303
|
}}
|
|
291
|
-
style={{ cursor:
|
|
304
|
+
style={{ cursor: showPreFilter ? 'pointer' : '' }}
|
|
292
305
|
>
|
|
293
|
-
{
|
|
306
|
+
{showPreFilter && (
|
|
294
307
|
<div
|
|
295
308
|
className="icon-hover"
|
|
296
309
|
style={{
|
|
297
310
|
...(!isEmpty(preFilter)
|
|
298
311
|
? {
|
|
299
|
-
backgroundColor:
|
|
312
|
+
backgroundColor: settings.theme?.primaryColor,
|
|
300
313
|
}
|
|
301
314
|
: {
|
|
302
315
|
backgroundColor: `#2B2C46`,
|
|
@@ -306,10 +319,8 @@ function HeaderMobileComponent(props: Props): JSX.Element {
|
|
|
306
319
|
<IconFilter color="white" />
|
|
307
320
|
</div>
|
|
308
321
|
)}
|
|
309
|
-
{!
|
|
310
|
-
|
|
311
|
-
)}
|
|
312
|
-
{settings.preFilterOption && !isEmpty(preFilter) && (
|
|
322
|
+
{!showPreFilter && <IconSearch width={16} height={16} />}
|
|
323
|
+
{!isEmpty(preFilter) && showPreFilter && (
|
|
313
324
|
<div
|
|
314
325
|
style={{
|
|
315
326
|
position: 'absolute',
|
|
@@ -394,7 +405,11 @@ function HeaderMobileComponent(props: Props): JSX.Element {
|
|
|
394
405
|
style={{
|
|
395
406
|
display: 'flex',
|
|
396
407
|
background: `${
|
|
397
|
-
disablePostFilter
|
|
408
|
+
disablePostFilter
|
|
409
|
+
? '#F3F3F5'
|
|
410
|
+
: isPostFilterApplied
|
|
411
|
+
? settings.theme?.primaryColor
|
|
412
|
+
: '#2B2C46'
|
|
398
413
|
}`,
|
|
399
414
|
borderRadius: '40px',
|
|
400
415
|
width: '40px',
|
|
@@ -408,7 +423,7 @@ function HeaderMobileComponent(props: Props): JSX.Element {
|
|
|
408
423
|
/>
|
|
409
424
|
</div>
|
|
410
425
|
|
|
411
|
-
{isPostFilterApplied &&
|
|
426
|
+
{isPostFilterApplied && (
|
|
412
427
|
<div
|
|
413
428
|
style={{
|
|
414
429
|
position: 'absolute',
|
|
@@ -427,7 +442,9 @@ function HeaderMobileComponent(props: Props): JSX.Element {
|
|
|
427
442
|
style={{
|
|
428
443
|
width: '8px',
|
|
429
444
|
height: '8px',
|
|
430
|
-
background:
|
|
445
|
+
background: disablePostFilter
|
|
446
|
+
? '#E0E0E0'
|
|
447
|
+
: settings.theme?.primaryColor,
|
|
431
448
|
borderRadius: '100%',
|
|
432
449
|
}}
|
|
433
450
|
></div>
|
|
@@ -65,7 +65,7 @@ function ImagePreviewMobileComponent({
|
|
|
65
65
|
const preFilterValues = [
|
|
66
66
|
{
|
|
67
67
|
key: settings.visualSearchFilterKey,
|
|
68
|
-
values: Object.keys(preFilter)
|
|
68
|
+
values: Object.keys(preFilter),
|
|
69
69
|
},
|
|
70
70
|
];
|
|
71
71
|
if (searchQuery || requestImage) {
|
|
@@ -125,7 +125,9 @@ function ImagePreviewMobileComponent({
|
|
|
125
125
|
image={requestImage?.canvas}
|
|
126
126
|
selection={imageSelection || DEFAULT_REGION}
|
|
127
127
|
regions={filteredRegions}
|
|
128
|
-
minWidth={
|
|
128
|
+
minWidth={
|
|
129
|
+
Math.min(80 * (requestImage?.canvas?.width / requestImage?.canvas?.height), 200)
|
|
130
|
+
}
|
|
129
131
|
minHeight={80}
|
|
130
132
|
maxWidth={255}
|
|
131
133
|
maxHeight={255}
|
|
@@ -155,8 +157,9 @@ function ImagePreviewMobileComponent({
|
|
|
155
157
|
minWidth: '180px',
|
|
156
158
|
marginTop: 'auto',
|
|
157
159
|
position: 'absolute',
|
|
158
|
-
bottom:
|
|
160
|
+
bottom: -25,
|
|
159
161
|
borderRadius: '16px',
|
|
162
|
+
zIndex: 1000,
|
|
160
163
|
}}
|
|
161
164
|
>
|
|
162
165
|
<IconInfo color="white" />
|
|
@@ -4,8 +4,8 @@ import { useMediaQuery } from 'react-responsive';
|
|
|
4
4
|
import { useHistory } from 'react-router-dom';
|
|
5
5
|
import {
|
|
6
6
|
clearPostFilter,
|
|
7
|
-
onResetRequestImage,
|
|
8
|
-
|
|
7
|
+
onResetRequestImage,
|
|
8
|
+
setPreFilter,
|
|
9
9
|
} from 'Store/search/Search';
|
|
10
10
|
import { useAppDispatch, useAppSelector } from 'Store/Store';
|
|
11
11
|
import { AppState } from '../types';
|
|
@@ -14,7 +14,6 @@ import './common.scss';
|
|
|
14
14
|
import FooterMobile from './FooterMobile';
|
|
15
15
|
import HeaderMobile from './HeaderMobile';
|
|
16
16
|
import Header from './Header';
|
|
17
|
-
import { createSessionByApi } from 'services/session';
|
|
18
17
|
import { isUndefined } from 'lodash';
|
|
19
18
|
import AppMobile from './AppMobile';
|
|
20
19
|
import jQuery from 'jquery';
|
|
@@ -80,16 +79,6 @@ function Layout({ children }: ReactNode): JSX.Element {
|
|
|
80
79
|
const showApp = !auth0.enabled || (auth0.enabled && isAuthenticated);
|
|
81
80
|
i18n.changeLanguage(language);
|
|
82
81
|
|
|
83
|
-
useEffect(() => {
|
|
84
|
-
const createSession = async () => {
|
|
85
|
-
let payload = await createSessionByApi(settings);
|
|
86
|
-
dispatch(setUpdateSession(payload));
|
|
87
|
-
};
|
|
88
|
-
|
|
89
|
-
createSession().catch(console.log);
|
|
90
|
-
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
91
|
-
}, []);
|
|
92
|
-
|
|
93
82
|
useEffect(() => {
|
|
94
83
|
if (history.location?.pathname === '/') {
|
|
95
84
|
document.title = settings.appTitle || '';
|
|
@@ -100,7 +89,9 @@ function Layout({ children }: ReactNode): JSX.Element {
|
|
|
100
89
|
|
|
101
90
|
useEffect(() => {
|
|
102
91
|
if (settings.shouldUseUserMetadata && user) {
|
|
103
|
-
|
|
92
|
+
if (user['/user_metadata'].value) {
|
|
93
|
+
dispatch(setPreFilter({ [user['/user_metadata'].value]: true }));
|
|
94
|
+
}
|
|
104
95
|
}
|
|
105
96
|
}, [user, dispatch, settings.shouldUseUserMetadata]);
|
|
106
97
|
|
|
@@ -15,6 +15,7 @@ import { ExpandablePanelCustom } from './expandable-panel';
|
|
|
15
15
|
import { getPanelAttributes, getPanelId } from './refinements';
|
|
16
16
|
import { ReactComponent as CloseIcon } from 'common/assets/icons/close.svg';
|
|
17
17
|
import { useTranslation } from 'react-i18next';
|
|
18
|
+
import { orderBy } from 'lodash';
|
|
18
19
|
|
|
19
20
|
export type ExpandablePanelProps = CurrentRefinementsProvided & {
|
|
20
21
|
children: React.ReactNode;
|
|
@@ -113,7 +114,7 @@ export default function PostFilterPanelAlgolia({
|
|
|
113
114
|
...refinements.reduce(
|
|
114
115
|
(acc: any, current: any) => ({
|
|
115
116
|
...acc,
|
|
116
|
-
[getPanelId(current)]: Boolean(current.isExpanded),
|
|
117
|
+
[getPanelId(current)]: !isMobile ? true : Boolean(current.isExpanded),
|
|
117
118
|
}),
|
|
118
119
|
{},
|
|
119
120
|
),
|
|
@@ -145,7 +146,7 @@ export default function PostFilterPanelAlgolia({
|
|
|
145
146
|
noResults: 'No results',
|
|
146
147
|
placeholder: '',
|
|
147
148
|
}}
|
|
148
|
-
|
|
149
|
+
transformItems={(items: any) => orderBy(items, 'label', 'desc')}
|
|
149
150
|
/>
|
|
150
151
|
);
|
|
151
152
|
}),
|