@nyris/nyris-webapp 0.3.41 → 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.
Files changed (72) hide show
  1. package/build/_redirects +1 -0
  2. package/build/asset-manifest.json +16 -12
  3. package/build/index.html +1 -1
  4. package/build/{precache-manifest.d9bae9c81b3a390a89a437be45e3a94b.js → precache-manifest.fdacc61375beca4170228eb2951d87b0.js} +27 -11
  5. package/build/service-worker.js +1 -1
  6. package/build/static/css/main.1b40c5ff.chunk.css +2 -0
  7. package/build/static/css/main.1b40c5ff.chunk.css.map +1 -0
  8. package/build/static/js/2.82ef1cd4.chunk.js +3 -0
  9. package/build/static/js/{2.1e5f374f.chunk.js.LICENSE.txt → 2.82ef1cd4.chunk.js.LICENSE.txt} +2 -0
  10. package/build/static/js/2.82ef1cd4.chunk.js.map +1 -0
  11. package/build/static/js/main.7cdac2fb.chunk.js +3 -0
  12. package/build/static/js/main.7cdac2fb.chunk.js.map +1 -0
  13. package/build/static/media/avatar.4c5346ed.svg +3 -0
  14. package/build/static/media/logout.07b9ef7f.svg +3 -0
  15. package/build/static/media/powered_by_nyris.e6766baf.svg +3 -0
  16. package/build/static/media/powered_by_nyris_colored.08d00bae.svg +9 -0
  17. package/package.json +4 -3
  18. package/public/_redirects +1 -0
  19. package/src/App.tsx +0 -17
  20. package/src/Router.tsx +13 -36
  21. package/src/Store/Store.ts +2 -4
  22. package/src/Store/constants.ts +7 -0
  23. package/src/Store/search/Search.ts +10 -3
  24. package/src/Store/search/types.ts +1 -0
  25. package/src/common/assets/icons/avatar.svg +3 -0
  26. package/src/common/assets/icons/logout.svg +3 -0
  27. package/src/common/assets/images/powered_by_nyris.svg +3 -0
  28. package/src/common/assets/images/powered_by_nyris_colored.svg +9 -0
  29. package/src/components/AppMobile.tsx +1 -0
  30. package/src/components/AuthenticatedRoute.tsx +38 -0
  31. package/src/components/CadenasWebViewer.tsx +5 -2
  32. package/src/components/DragDropFile.tsx +3 -4
  33. package/src/components/FooterMobile.tsx +137 -24
  34. package/src/components/Header.tsx +120 -1
  35. package/src/components/HeaderMobile.tsx +230 -163
  36. package/src/components/ImagePreviewMobile.tsx +57 -8
  37. package/src/components/Layout.tsx +16 -56
  38. package/src/components/NoAccess.tsx +66 -0
  39. package/src/components/PoweredByNyris.tsx +49 -0
  40. package/src/components/ProductDetailView.tsx +17 -7
  41. package/src/components/ProductList/index.tsx +16 -93
  42. package/src/components/ProductList/useProductList.ts +114 -0
  43. package/src/components/Provider/AuthProvider.tsx +25 -0
  44. package/src/components/Provider/InstantSearchProvider.tsx +66 -0
  45. package/src/components/appMobile.scss +2 -2
  46. package/src/components/carousel/ImagePreviewCarousel.tsx +6 -2
  47. package/src/components/common.scss +8 -1
  48. package/src/components/drawer/cameraCustom.tsx +3 -3
  49. package/src/components/input/inputSearch.tsx +86 -17
  50. package/src/components/pre-filter/index.tsx +58 -7
  51. package/src/components/results/ItemResult.tsx +6 -1
  52. package/src/components/rfq/RfqBanner.tsx +0 -1
  53. package/src/index.tsx +9 -6
  54. package/src/page/Login.tsx +21 -0
  55. package/src/page/Logout.tsx +23 -0
  56. package/src/page/landingPage/common.scss +4 -1
  57. package/src/page/result/index.tsx +154 -131
  58. package/src/services/Feedback.ts +1 -1
  59. package/src/services/image.ts +8 -5
  60. package/src/types.ts +35 -25
  61. package/build/static/css/main.86d40309.chunk.css +0 -2
  62. package/build/static/css/main.86d40309.chunk.css.map +0 -1
  63. package/build/static/js/2.1e5f374f.chunk.js +0 -3
  64. package/build/static/js/2.1e5f374f.chunk.js.map +0 -1
  65. package/build/static/js/main.909efae2.chunk.js +0 -3
  66. package/build/static/js/main.909efae2.chunk.js.map +0 -1
  67. package/src/Store/auth/Auth.ts +0 -33
  68. package/src/Store/auth/types.ts +0 -11
  69. package/src/Store/nyris/Nyris.ts +0 -67
  70. package/src/Store/nyris/types.ts +0 -11
  71. package/src/components/Feedback.tsx +0 -91
  72. /package/build/static/js/{main.909efae2.chunk.js.LICENSE.txt → main.7cdac2fb.chunk.js.LICENSE.txt} +0 -0
@@ -6,11 +6,17 @@ import { ReactComponent as Home } from 'common/assets/icons/home.svg';
6
6
  import { NavLink, 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
+ import { ReactComponent as IconLogout } from 'common/assets/icons/logout.svg';
10
+ import { ReactComponent as CloseIcon } from 'common/assets/icons/close.svg';
11
+ import { ReactComponent as PoweredByNyrisImage } from 'common/assets/images/powered_by_nyris.svg';
12
+
9
13
  import {
10
14
  reset,
11
15
  setImageCaptureHelpModal,
12
16
  setPreFilter,
13
17
  } from 'Store/search/Search';
18
+ import { useAuth0 } from '@auth0/auth0-react';
19
+ import DefaultModal from './modal/DefaultModal';
14
20
 
15
21
  interface Props {
16
22
  onLoadingMobile?: any;
@@ -24,8 +30,99 @@ function FooterMobile(props: Props): JSX.Element {
24
30
  } = useAppSelector(state => state);
25
31
  const dispatch = useAppDispatch();
26
32
 
33
+ const { settings } = useAppSelector(state => state);
34
+ const { user, isAuthenticated, logout } = useAuth0();
35
+ const auth0 = settings.auth0;
36
+
37
+ const [showLogoutModal, setShowLogoutModal] = useState(false);
38
+
27
39
  return (
28
40
  <>
41
+ <DefaultModal
42
+ openModal={showLogoutModal}
43
+ handleClose={() => {
44
+ setShowLogoutModal(false);
45
+ }}
46
+ >
47
+ <div
48
+ style={{
49
+ backgroundColor: 'white',
50
+ width: '360px',
51
+ padding: '24px',
52
+ }}
53
+ >
54
+ <div
55
+ style={{
56
+ display: 'flex',
57
+ justifyContent: 'flex-end',
58
+ }}
59
+ onClick={() => setShowLogoutModal(false)}
60
+ >
61
+ <CloseIcon
62
+ width={'16px'}
63
+ height={'16px'}
64
+ fontSize={'16px'}
65
+ color="black"
66
+ />
67
+ </div>
68
+ <p style={{ fontSize: '36px', fontWeight: 'bold', color: '#2B2C46' }}>
69
+ Logout
70
+ </p>
71
+ <p style={{ fontSize: '13px', color: '#2B2C46', paddingTop: '16px' }}>
72
+ Are you sure you want to log out? Your session will be securely
73
+ closed.
74
+ </p>
75
+ <p style={{ fontSize: '13px', color: '#2B2C46', paddingTop: '16px' }}>
76
+ Email
77
+ </p>
78
+ <div
79
+ style={{
80
+ backgroundColor: '#FAFAFA',
81
+ height: '32px',
82
+ paddingLeft: '16px',
83
+ paddingRight: '16px',
84
+ marginTop: '8px',
85
+ }}
86
+ >
87
+ {user?.email}
88
+ </div>
89
+ <div style={{ display: 'flex', width: '100%', marginTop: '16px' }}>
90
+ <div
91
+ style={{
92
+ width: '50%',
93
+ backgroundColor: '#2B2C46',
94
+ color: 'white',
95
+ padding: '16px',
96
+ }}
97
+ onClick={() => {
98
+ logout({
99
+ logoutParams: { returnTo: window.location.origin },
100
+ });
101
+ }}
102
+ >
103
+ Confirm log out
104
+ </div>
105
+ </div>
106
+ </div>
107
+ </DefaultModal>
108
+ {history.location?.pathname === '/' && settings.showPoweredByNyris && (
109
+ <div
110
+ style={{
111
+ backgroundColor: '#fff',
112
+ display: 'flex',
113
+ justifyContent: 'center',
114
+ padding: '16px 0px 16px 0px',
115
+ }}
116
+ >
117
+ <PoweredByNyrisImage
118
+ style={{ cursor: 'pointer' }}
119
+ onClick={() => {
120
+ window.open('https://www.nyris.io', '_blank');
121
+ }}
122
+ color="#AAABB5"
123
+ />
124
+ </div>
125
+ )}
29
126
  <Box
30
127
  className="box-footer-mobile"
31
128
  display={'flex'}
@@ -33,7 +130,7 @@ function FooterMobile(props: Props): JSX.Element {
33
130
  alignItems={'center'}
34
131
  height={'100%'}
35
132
  justifyContent={'space-between'}
36
- style={{ paddingLeft: '40px', paddingRight: '40px', height: '64px' }}
133
+ style={{ paddingLeft: '16px', paddingRight: '16px', height: '64px' }}
37
134
  >
38
135
  <NavLink
39
136
  style={{
@@ -76,29 +173,45 @@ function FooterMobile(props: Props): JSX.Element {
76
173
  </Button>
77
174
  </Box>
78
175
  )}
79
- {history.location?.pathname !== '/' && (
80
- <div
81
- style={{
82
- width: '48px',
83
- height: '48px',
84
- display: 'flex',
85
- alignItems: 'center',
86
- justifyContent: 'center',
87
- borderRadius: '100%',
88
- backgroundColor: imageCaptureHelpModal ? `#E0E0E0` : '',
89
- }}
90
- onClick={() => {
91
- dispatch(setImageCaptureHelpModal(!imageCaptureHelpModal));
92
- }}
93
- >
94
- <IconInfo
95
- fontSize={24}
96
- width={24}
97
- height={24}
98
- color={imageCaptureHelpModal ? '#2B2C46' : '#AAABB5'}
99
- />
100
- </div>
101
- )}
176
+ <div style={{ display: 'flex', gap: '24px' }}>
177
+ {history.location?.pathname !== '/' && (
178
+ <div
179
+ style={{
180
+ width: '48px',
181
+ height: '48px',
182
+ display: 'flex',
183
+ alignItems: 'center',
184
+ justifyContent: 'center',
185
+ borderRadius: '100%',
186
+ backgroundColor: imageCaptureHelpModal ? `#E0E0E0` : '',
187
+ }}
188
+ onClick={() => {
189
+ dispatch(setImageCaptureHelpModal(!imageCaptureHelpModal));
190
+ }}
191
+ >
192
+ <IconInfo
193
+ fontSize={24}
194
+ width={24}
195
+ height={24}
196
+ color={imageCaptureHelpModal ? '#2B2C46' : '#AAABB5'}
197
+ />
198
+ </div>
199
+ )}
200
+ {auth0.enabled && isAuthenticated && (
201
+ <div
202
+ style={{
203
+ display: 'flex',
204
+ alignItems: 'center',
205
+ justifyContent: 'center',
206
+ }}
207
+ onClick={() => {
208
+ setShowLogoutModal(true);
209
+ }}
210
+ >
211
+ <IconLogout fontSize={24} width={24} height={24} />
212
+ </div>
213
+ )}
214
+ </div>
102
215
  </Box>
103
216
  <Box className="box-screenshot-camera">
104
217
  <CameraCustom
@@ -1,13 +1,65 @@
1
- import { Box } from '@material-ui/core';
1
+ import { Box, Menu, MenuProps, withStyles } from '@material-ui/core';
2
2
  import React from 'react';
3
3
  import { NavLink } from 'react-router-dom';
4
4
  import './common.scss';
5
5
  import { useAppDispatch, useAppSelector } from 'Store/Store';
6
6
  import { reset, setPreFilter } from 'Store/search/Search';
7
+ import { useAuth0 } from '@auth0/auth0-react';
8
+ import { ReactComponent as AvatarIcon } from 'common/assets/icons/avatar.svg';
9
+ import MenuItem from '@material-ui/core/MenuItem';
7
10
 
8
11
  function Header(): JSX.Element {
9
12
  const dispatch = useAppDispatch();
10
13
  const { settings } = useAppSelector(state => state);
14
+ const { user, isAuthenticated, logout } = useAuth0();
15
+ const auth0 = settings.auth0;
16
+
17
+ const [anchorEl, setAnchorEl] = React.useState(null);
18
+
19
+ const handleClick = (event: any) => {
20
+ setAnchorEl(event.currentTarget);
21
+ };
22
+
23
+ const handleClose = () => {
24
+ setAnchorEl(null);
25
+ };
26
+
27
+ const StyledMenu = withStyles({
28
+ root: {},
29
+ paper: {
30
+ border: '0px',
31
+ boxShadow: '0px 0px 8px 0px rgba(0, 0, 0, 0.20)',
32
+ top: '58px !important',
33
+ borderRadius: '0px !important',
34
+ },
35
+ })((props: MenuProps) => (
36
+ <Menu
37
+ elevation={0}
38
+ getContentAnchorEl={null}
39
+ anchorOrigin={{
40
+ vertical: 'bottom',
41
+ horizontal: 'center',
42
+ }}
43
+ transformOrigin={{
44
+ vertical: 'top',
45
+ horizontal: 'center',
46
+ }}
47
+ {...props}
48
+ />
49
+ ));
50
+
51
+ const StyledMenuItem = withStyles(theme => ({
52
+ root: {
53
+ '&:focus': {
54
+ backgroundColor: theme.palette.primary.main,
55
+ '& .MuiListItemIcon-root, & .MuiListItemText-primary': {
56
+ color: theme.palette.common.white,
57
+ },
58
+ },
59
+ padding: '0px',
60
+ },
61
+ }))(MenuItem);
62
+
11
63
  return (
12
64
  <Box className="box-content" display={'flex'}>
13
65
  <NavLink
@@ -28,6 +80,73 @@ function Header(): JSX.Element {
28
80
  }}
29
81
  />
30
82
  </NavLink>
83
+
84
+ {auth0.enabled && isAuthenticated && (
85
+ <div style={{ position: 'relative' }}>
86
+ <div
87
+ style={{
88
+ display: 'flex',
89
+ columnGap: '16px',
90
+ alignItems: 'center',
91
+ paddingRight: '24px',
92
+ cursor: 'pointer',
93
+ }}
94
+ aria-controls="simple-menu"
95
+ aria-haspopup="true"
96
+ onClick={handleClick}
97
+ >
98
+ <p style={{ color: '#2B2C46' }}>{user?.email}</p>
99
+ <AvatarIcon />
100
+ </div>
101
+ <StyledMenu
102
+ id="simple-menu"
103
+ anchorEl={anchorEl}
104
+ keepMounted
105
+ open={Boolean(anchorEl)}
106
+ onClose={handleClose}
107
+ >
108
+ <StyledMenuItem>
109
+ <div
110
+ style={{
111
+ display: 'flex',
112
+ width: '152px',
113
+ paddingLeft: '8px',
114
+ paddingRight: '8px',
115
+ flexDirection: 'column',
116
+ alignItems: 'flex-start',
117
+ gap: '8px',
118
+ boxShadow: '0px 0px 8px 0px rgba(0, 0, 0, 0.20)',
119
+ // position: 'absolute',
120
+ // zIndex: 99,
121
+ // top: '50px',
122
+ backgroundColor: '#fff',
123
+ }}
124
+ >
125
+ <div
126
+ style={{
127
+ display: 'flex',
128
+ width: '75px',
129
+ height: '24px',
130
+ padding: '4px 8px',
131
+ alignItems: 'center',
132
+ backgroundColor: '#2B2C46',
133
+ color: '#fff',
134
+ fontSize: '10px',
135
+ cursor: 'pointer',
136
+ }}
137
+ onClick={() => {
138
+ logout({
139
+ logoutParams: { returnTo: window.location.origin },
140
+ });
141
+ }}
142
+ >
143
+ Sign out
144
+ </div>
145
+ </div>
146
+ </StyledMenuItem>
147
+ </StyledMenu>
148
+ </div>
149
+ )}
31
150
  </Box>
32
151
  );
33
152
  }