@nyris/nyris-webapp 0.3.42 → 0.3.43
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 +16 -12
- package/build/index.html +1 -1
- package/build/{precache-manifest.009e864ff0764cf3cf8a9b290c334099.js → precache-manifest.fdacc61375beca4170228eb2951d87b0.js} +26 -10
- package/build/service-worker.js +1 -1
- package/build/static/css/main.1b40c5ff.chunk.css +2 -0
- package/build/static/css/main.1b40c5ff.chunk.css.map +1 -0
- package/build/static/js/2.82ef1cd4.chunk.js +3 -0
- package/build/static/js/2.82ef1cd4.chunk.js.map +1 -0
- package/build/static/js/main.7cdac2fb.chunk.js +3 -0
- package/build/static/js/main.7cdac2fb.chunk.js.map +1 -0
- package/build/static/media/avatar.4c5346ed.svg +3 -0
- package/build/static/media/logout.07b9ef7f.svg +3 -0
- package/build/static/media/powered_by_nyris.e6766baf.svg +3 -0
- package/build/static/media/powered_by_nyris_colored.08d00bae.svg +9 -0
- package/package.json +3 -3
- package/src/Router.tsx +1 -0
- package/src/Store/Store.ts +2 -4
- package/src/Store/constants.ts +6 -0
- package/src/Store/search/Search.ts +10 -3
- package/src/Store/search/types.ts +1 -0
- package/src/common/assets/icons/avatar.svg +3 -0
- package/src/common/assets/icons/logout.svg +3 -0
- package/src/common/assets/images/powered_by_nyris.svg +3 -0
- package/src/common/assets/images/powered_by_nyris_colored.svg +9 -0
- package/src/components/AppMobile.tsx +1 -0
- package/src/components/AuthenticatedRoute.tsx +4 -1
- package/src/components/DragDropFile.tsx +3 -4
- package/src/components/FooterMobile.tsx +137 -24
- package/src/components/Header.tsx +120 -1
- package/src/components/HeaderMobile.tsx +230 -163
- package/src/components/ImagePreviewMobile.tsx +57 -8
- package/src/components/Layout.tsx +10 -53
- package/src/components/NoAccess.tsx +66 -0
- package/src/components/PoweredByNyris.tsx +49 -0
- package/src/components/ProductDetailView.tsx +16 -10
- package/src/components/ProductList/index.tsx +16 -93
- package/src/components/ProductList/useProductList.ts +114 -0
- package/src/components/Provider/InstantSearchProvider.tsx +66 -0
- package/src/components/appMobile.scss +2 -2
- package/src/components/common.scss +8 -1
- package/src/components/drawer/cameraCustom.tsx +3 -3
- package/src/components/input/inputSearch.tsx +86 -17
- package/src/components/pre-filter/index.tsx +58 -7
- package/src/components/results/ItemResult.tsx +6 -1
- package/src/index.tsx +1 -1
- package/src/page/landingPage/common.scss +4 -1
- package/src/page/result/index.tsx +154 -131
- package/src/services/Feedback.ts +1 -1
- package/src/services/image.ts +8 -5
- package/src/types.ts +13 -12
- package/build/static/css/main.86d40309.chunk.css +0 -2
- package/build/static/css/main.86d40309.chunk.css.map +0 -1
- package/build/static/js/2.1757789c.chunk.js +0 -3
- package/build/static/js/2.1757789c.chunk.js.map +0 -1
- package/build/static/js/main.1d184393.chunk.js +0 -3
- package/build/static/js/main.1d184393.chunk.js.map +0 -1
- package/src/Store/auth/Auth.ts +0 -33
- package/src/Store/auth/types.ts +0 -11
- package/src/Store/nyris/Nyris.ts +0 -67
- package/src/Store/nyris/types.ts +0 -11
- package/src/components/Feedback.tsx +0 -91
- /package/build/static/js/{2.1757789c.chunk.js.LICENSE.txt → 2.82ef1cd4.chunk.js.LICENSE.txt} +0 -0
- /package/build/static/js/{main.1d184393.chunk.js.LICENSE.txt → main.7cdac2fb.chunk.js.LICENSE.txt} +0 -0
- /package/src/components/{AuthProvider.tsx → Provider/AuthProvider.tsx} +0 -0
package/src/Store/auth/Auth.ts
DELETED
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
import { createSlice, PayloadAction } from '@reduxjs/toolkit';
|
|
2
|
-
import jscookie from 'js-cookie';
|
|
3
|
-
import { InitialStateTypes, LoginResponse } from './types';
|
|
4
|
-
|
|
5
|
-
const initialState: InitialStateTypes = {
|
|
6
|
-
accessToken: null,
|
|
7
|
-
name: null,
|
|
8
|
-
role: null,
|
|
9
|
-
};
|
|
10
|
-
|
|
11
|
-
export const authSlice = createSlice({
|
|
12
|
-
name: 'auth',
|
|
13
|
-
initialState,
|
|
14
|
-
reducers: {
|
|
15
|
-
login: (state, data: PayloadAction<LoginResponse>) => {
|
|
16
|
-
// state.accessToken = payload.access_token;
|
|
17
|
-
// state.name = payload.name;
|
|
18
|
-
// state.role = payload.role;
|
|
19
|
-
// if (payload.access_token) {
|
|
20
|
-
// jscookie.set("token", payload?.access_token);
|
|
21
|
-
// }
|
|
22
|
-
},
|
|
23
|
-
logout: state => {
|
|
24
|
-
state.accessToken = null;
|
|
25
|
-
state.name = null;
|
|
26
|
-
state.role = null;
|
|
27
|
-
jscookie.remove('token');
|
|
28
|
-
},
|
|
29
|
-
},
|
|
30
|
-
});
|
|
31
|
-
|
|
32
|
-
export const { login, logout } = authSlice.actions;
|
|
33
|
-
export default authSlice.reducer;
|
package/src/Store/auth/types.ts
DELETED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
export interface InitialStateTypes {
|
|
2
|
-
accessToken?: string | Record<string, unknown> | null;
|
|
3
|
-
name?: string | null;
|
|
4
|
-
role?: string | null;
|
|
5
|
-
}
|
|
6
|
-
|
|
7
|
-
export interface LoginResponse {
|
|
8
|
-
access_token?: string | Record<string, unknown> | null;
|
|
9
|
-
name?: string | null;
|
|
10
|
-
role?: string | null;
|
|
11
|
-
}
|
package/src/Store/nyris/Nyris.ts
DELETED
|
@@ -1,67 +0,0 @@
|
|
|
1
|
-
import { createSlice } from '@reduxjs/toolkit';
|
|
2
|
-
import { NyrisAppState, NyrisFeedbackState } from './types';
|
|
3
|
-
|
|
4
|
-
const initialState: NyrisAppState | NyrisFeedbackState = {
|
|
5
|
-
showPart: 'start',
|
|
6
|
-
feedbackState: 'hidden',
|
|
7
|
-
};
|
|
8
|
-
|
|
9
|
-
export const nyrisSlice = createSlice({
|
|
10
|
-
name: 'nyris',
|
|
11
|
-
initialState,
|
|
12
|
-
reducers: {
|
|
13
|
-
showStart: state => {
|
|
14
|
-
return {
|
|
15
|
-
...state,
|
|
16
|
-
showPart: 'start',
|
|
17
|
-
};
|
|
18
|
-
},
|
|
19
|
-
showCamera: state => {
|
|
20
|
-
return {
|
|
21
|
-
...state,
|
|
22
|
-
showPart: 'camera',
|
|
23
|
-
};
|
|
24
|
-
},
|
|
25
|
-
showResults: state => {
|
|
26
|
-
return {
|
|
27
|
-
...state,
|
|
28
|
-
showPart: 'results',
|
|
29
|
-
};
|
|
30
|
-
},
|
|
31
|
-
showFeedback: state => {
|
|
32
|
-
return {
|
|
33
|
-
...state,
|
|
34
|
-
feedbackState: 'question',
|
|
35
|
-
};
|
|
36
|
-
},
|
|
37
|
-
hideFeedback: state => {
|
|
38
|
-
return {
|
|
39
|
-
...state,
|
|
40
|
-
feedbackState: 'hidden',
|
|
41
|
-
};
|
|
42
|
-
},
|
|
43
|
-
feedbackSubmitPositive: state => {
|
|
44
|
-
return {
|
|
45
|
-
...state,
|
|
46
|
-
feedbackState: 'positive',
|
|
47
|
-
};
|
|
48
|
-
},
|
|
49
|
-
feedbackNegative: state => {
|
|
50
|
-
return {
|
|
51
|
-
...state,
|
|
52
|
-
feedbackState: 'negative',
|
|
53
|
-
};
|
|
54
|
-
},
|
|
55
|
-
},
|
|
56
|
-
});
|
|
57
|
-
|
|
58
|
-
export const {
|
|
59
|
-
showStart,
|
|
60
|
-
showCamera,
|
|
61
|
-
showResults,
|
|
62
|
-
showFeedback,
|
|
63
|
-
hideFeedback,
|
|
64
|
-
feedbackSubmitPositive,
|
|
65
|
-
feedbackNegative,
|
|
66
|
-
} = nyrisSlice.actions;
|
|
67
|
-
export default nyrisSlice.reducer;
|
package/src/Store/nyris/types.ts
DELETED
|
@@ -1,91 +0,0 @@
|
|
|
1
|
-
import { useAppDispatch, useAppSelector } from 'Store/Store';
|
|
2
|
-
import { feedbackNegative, feedbackSubmitPositive } from 'Store/nyris/Nyris';
|
|
3
|
-
import { NyrisFeedbackState } from 'Store/nyris/types';
|
|
4
|
-
import React from 'react';
|
|
5
|
-
import { Animate } from 'react-move';
|
|
6
|
-
import { feedbackSuccessEpic } from 'services/Feedback';
|
|
7
|
-
interface FeedbackProps {
|
|
8
|
-
feedbackState: NyrisFeedbackState;
|
|
9
|
-
onClose?: () => void;
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
const Feedback: React.FC<FeedbackProps> = ({ feedbackState, onClose }) => {
|
|
13
|
-
let inner: any = null;
|
|
14
|
-
const state = useAppSelector(state => state);
|
|
15
|
-
const dispatch = useAppDispatch();
|
|
16
|
-
const onPositiveFeedback = (data: boolean) => {
|
|
17
|
-
feedbackSuccessEpic(state, data);
|
|
18
|
-
if (data) {
|
|
19
|
-
dispatch(feedbackSubmitPositive());
|
|
20
|
-
} else {
|
|
21
|
-
dispatch(feedbackNegative());
|
|
22
|
-
}
|
|
23
|
-
};
|
|
24
|
-
|
|
25
|
-
switch (feedbackState) {
|
|
26
|
-
case 'question':
|
|
27
|
-
inner = (
|
|
28
|
-
<div className="feedbackForm">
|
|
29
|
-
<p>Did you find what you were looking for?</p>
|
|
30
|
-
<div
|
|
31
|
-
className="btn primary positiveFeedback"
|
|
32
|
-
onClick={() => onPositiveFeedback(true)}
|
|
33
|
-
>
|
|
34
|
-
Yes
|
|
35
|
-
</div>
|
|
36
|
-
<div
|
|
37
|
-
className="btn secondary negativeFeedback"
|
|
38
|
-
onClick={() => onPositiveFeedback(false)}
|
|
39
|
-
>
|
|
40
|
-
No
|
|
41
|
-
</div>
|
|
42
|
-
</div>
|
|
43
|
-
);
|
|
44
|
-
break;
|
|
45
|
-
case 'positive':
|
|
46
|
-
inner = (
|
|
47
|
-
<div className="feedbackMessage positive">
|
|
48
|
-
Great, thank you for your feedback!
|
|
49
|
-
</div>
|
|
50
|
-
);
|
|
51
|
-
break;
|
|
52
|
-
case 'negative':
|
|
53
|
-
inner = (
|
|
54
|
-
<div className="feedbackMessage negative">
|
|
55
|
-
We saved your request so we can track down the issue and improve the
|
|
56
|
-
search experience. Your Feedback helps us to make our service better
|
|
57
|
-
for everyone, thank you!
|
|
58
|
-
<br />
|
|
59
|
-
<div className="btn dismiss" onClick={onClose}>
|
|
60
|
-
Dismiss
|
|
61
|
-
</div>
|
|
62
|
-
</div>
|
|
63
|
-
);
|
|
64
|
-
break;
|
|
65
|
-
default:
|
|
66
|
-
inner = null;
|
|
67
|
-
break;
|
|
68
|
-
}
|
|
69
|
-
return (
|
|
70
|
-
<Animate
|
|
71
|
-
show={feedbackState !== 'hidden'}
|
|
72
|
-
start={{ y: 100, opacity: 0 }}
|
|
73
|
-
enter={{ y: [0], opacity: [1] }}
|
|
74
|
-
leave={{ y: [100], opacity: [0] }}
|
|
75
|
-
>
|
|
76
|
-
{({ y, opacity }) => (
|
|
77
|
-
<section
|
|
78
|
-
className="feedback"
|
|
79
|
-
style={{ transform: `translateY(${y}%)`, opacity }}
|
|
80
|
-
>
|
|
81
|
-
<div className="wrapper">{inner}</div>
|
|
82
|
-
<div className="closeFeedbackContainer">
|
|
83
|
-
<div className="closeFeedback" onClick={onClose} />
|
|
84
|
-
</div>
|
|
85
|
-
</section>
|
|
86
|
-
)}
|
|
87
|
-
</Animate>
|
|
88
|
-
);
|
|
89
|
-
};
|
|
90
|
-
|
|
91
|
-
export default Feedback;
|
/package/build/static/js/{2.1757789c.chunk.js.LICENSE.txt → 2.82ef1cd4.chunk.js.LICENSE.txt}
RENAMED
|
File without changes
|
/package/build/static/js/{main.1d184393.chunk.js.LICENSE.txt → main.7cdac2fb.chunk.js.LICENSE.txt}
RENAMED
|
File without changes
|
|
File without changes
|