@nyris/nyris-webapp 0.3.24 → 0.3.26

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 (58) hide show
  1. package/build/asset-manifest.json +12 -12
  2. package/build/index.html +1 -1
  3. package/build/{precache-manifest.982b135daeb2c083ccf4eeeddf132bf3.js → precache-manifest.657024161cae7b5c0d6719247ad2572a.js} +10 -10
  4. package/build/service-worker.js +1 -1
  5. package/build/static/css/main.0d30f026.chunk.css +2 -0
  6. package/build/static/css/main.0d30f026.chunk.css.map +1 -0
  7. package/build/static/js/2.ad8c5320.chunk.js +3 -0
  8. package/build/static/js/2.ad8c5320.chunk.js.map +1 -0
  9. package/build/static/js/main.3403bbf6.chunk.js +3 -0
  10. package/build/static/js/main.3403bbf6.chunk.js.map +1 -0
  11. package/package.json +5 -3
  12. package/src/App.tsx +19 -2
  13. package/src/Store/Store.ts +4 -4
  14. package/src/Store/{Auth.ts → auth/Auth.ts} +6 -17
  15. package/src/Store/auth/types.ts +11 -0
  16. package/src/{defaults.ts → Store/constants.ts} +1 -1
  17. package/src/Store/nyris/Nyris.ts +67 -0
  18. package/src/Store/nyris/types.ts +11 -0
  19. package/src/Store/{Search.ts → search/Search.ts} +4 -63
  20. package/src/Store/search/search.initialState.ts +28 -0
  21. package/src/Store/search/types.ts +34 -0
  22. package/src/components/DetailItem.tsx +20 -10
  23. package/src/components/DragDropFile.tsx +8 -3
  24. package/src/components/Feedback.tsx +11 -14
  25. package/src/components/Header.tsx +29 -30
  26. package/src/components/HeaderMobile.tsx +1 -1
  27. package/src/components/Layout.tsx +10 -10
  28. package/src/components/{LoadingScreen → ProductList}/index.tsx +3 -3
  29. package/src/components/appMobile.scss +2 -21
  30. package/src/components/carousel/ImagePreviewCarousel.tsx +2 -1
  31. package/src/components/common.scss +2 -0
  32. package/src/components/drawer/cameraCustom.tsx +1 -2
  33. package/src/components/input/inputSearch.tsx +6 -5
  34. package/src/components/pre-filter/{desktop/index.tsx → index.tsx} +3 -3
  35. package/src/components/results/ItemResult.tsx +33 -27
  36. package/src/constants.ts +12 -0
  37. package/src/hooks/useVisualSearch.tsx +2 -2
  38. package/src/i18n.ts +10 -0
  39. package/src/{modules/LandingPage → page/landingPage}/AppMD.tsx +1 -3
  40. package/src/{modules/LandingPage → page/landingPage}/AppMobile.tsx +3 -4
  41. package/src/{modules/LandingPage → page/landingPage}/common.scss +2 -8
  42. package/src/page/result/index.tsx +8 -10
  43. package/src/translations.ts +22 -0
  44. package/src/types.ts +5 -3
  45. package/build/static/css/main.1e43a778.chunk.css +0 -2
  46. package/build/static/css/main.1e43a778.chunk.css.map +0 -1
  47. package/build/static/js/2.fe9108d5.chunk.js +0 -3
  48. package/build/static/js/2.fe9108d5.chunk.js.map +0 -1
  49. package/build/static/js/main.83cb88a3.chunk.js +0 -3
  50. package/build/static/js/main.83cb88a3.chunk.js.map +0 -1
  51. package/src/Store/Nyris.ts +0 -77
  52. package/src/components/FooterNewVersion.tsx +0 -12
  53. package/src/components/HeaderNewVersion.tsx +0 -34
  54. package/src/modules/LandingPage/propsType.ts +0 -41
  55. package/src/page/result/MockData.ts +0 -50
  56. /package/build/static/js/{2.fe9108d5.chunk.js.LICENSE.txt → 2.ad8c5320.chunk.js.LICENSE.txt} +0 -0
  57. /package/build/static/js/{main.83cb88a3.chunk.js.LICENSE.txt → main.3403bbf6.chunk.js.LICENSE.txt} +0 -0
  58. /package/src/services/{filter.tsx → filter.ts} +0 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nyris/nyris-webapp",
3
- "version": "0.3.24",
3
+ "version": "0.3.26",
4
4
  "homepage": "./",
5
5
  "dependencies": {
6
6
  "@algolia/autocomplete-js": "^1.7.1",
@@ -12,8 +12,8 @@
12
12
  "@material-ui/data-grid": "^4.0.0-alpha.37",
13
13
  "@material-ui/icons": "^4.4.1",
14
14
  "@material-ui/lab": "^4.0.0-alpha.60",
15
- "@nyris/nyris-api": "^0.3.24",
16
- "@nyris/nyris-react-components": "^0.3.24",
15
+ "@nyris/nyris-api": "^0.3.26",
16
+ "@nyris/nyris-react-components": "^0.3.26",
17
17
  "@reduxjs/toolkit": "^1.6.1",
18
18
  "@splidejs/react-splide": "^0.7.12",
19
19
  "@types/blueimp-load-image": "^2.23.4",
@@ -31,6 +31,7 @@
31
31
  "classnames": "^2.2.6",
32
32
  "framer-motion": "^4.1.17",
33
33
  "history": "^4.10.1",
34
+ "i18next": "^22.4.14",
34
35
  "jotai": "^1.4.7",
35
36
  "jquery": "^3.6.0",
36
37
  "js-cookie": "^3.0.1",
@@ -42,6 +43,7 @@
42
43
  "react-dropzone": "^10.1.8",
43
44
  "react-hook-form": "^7.27.1",
44
45
  "react-hot-toast": "^2.4.0",
46
+ "react-i18next": "^12.2.0",
45
47
  "react-instantsearch-dom": "^6.15.0",
46
48
  "react-instantsearch-hooks": "^6.22.0",
47
49
  "react-konva": "16.13.0-6",
package/src/App.tsx CHANGED
@@ -5,10 +5,27 @@ import 'typeface-roboto';
5
5
  import 'index.css';
6
6
 
7
7
  import { useMediaQuery } from 'react-responsive';
8
- import AppMD from 'modules/LandingPage/AppMD';
9
- import AppMobile from 'modules/LandingPage/AppMobile';
8
+ import AppMD from 'page/landingPage/AppMD';
9
+ import AppMobile from 'page/landingPage/AppMobile';
10
+ import i18n from 'i18next';
11
+ import { initReactI18next } from 'react-i18next';
12
+ import { useAppSelector } from 'Store/Store';
13
+ import { translations } from 'translations';
14
+
15
+ i18n.use(initReactI18next).init({
16
+ resources: translations,
17
+ fallbackLng: 'en',
18
+ interpolation: {
19
+ escapeValue: false,
20
+ },
21
+ returnNull: false,
22
+ });
10
23
 
11
24
  function App(): JSX.Element {
25
+ const language = useAppSelector(state => state.settings.language);
26
+
27
+ i18n.changeLanguage(language);
28
+
12
29
  const isMobile = useMediaQuery({ query: '(max-width: 776px)' });
13
30
  let SelectedApp: any = isMobile ? AppMobile : AppMD;
14
31
 
@@ -1,12 +1,12 @@
1
1
  import { configureStore } from '@reduxjs/toolkit';
2
2
  import { TypedUseSelectorHook, useDispatch, useSelector } from 'react-redux';
3
3
  import { combineReducers } from 'redux';
4
- import Auth from 'Store/Auth';
4
+ import Auth from 'Store/auth/Auth';
5
5
  import { AppSettings } from 'types';
6
6
  import { getUrlParam } from 'utils';
7
- import Search from 'Store/Search';
8
- import Nyris from 'Store/Nyris';
9
- import { defaultSettings } from '../defaults';
7
+ import Search from 'Store/search/Search';
8
+ import Nyris from 'Store/nyris/Nyris';
9
+ import { defaultSettings } from './constants';
10
10
 
11
11
  declare var settings: AppSettings;
12
12
 
@@ -1,17 +1,6 @@
1
- import { createSlice, PayloadAction } from "@reduxjs/toolkit";
2
- import jscookie from "js-cookie";
3
-
4
- interface InitialStateTypes {
5
- accessToken?: string | Record<string, unknown> | null;
6
- name?: string | null;
7
- role?: string | null;
8
- }
9
-
10
- interface LoginResponse {
11
- access_token?: string | Record<string, unknown> | null;
12
- name?: string | null;
13
- role?: string | null;
14
- }
1
+ import { createSlice, PayloadAction } from '@reduxjs/toolkit';
2
+ import jscookie from 'js-cookie';
3
+ import { InitialStateTypes, LoginResponse } from './types';
15
4
 
16
5
  const initialState: InitialStateTypes = {
17
6
  accessToken: null,
@@ -20,7 +9,7 @@ const initialState: InitialStateTypes = {
20
9
  };
21
10
 
22
11
  export const authSlice = createSlice({
23
- name: "auth",
12
+ name: 'auth',
24
13
  initialState,
25
14
  reducers: {
26
15
  login: (state, data: PayloadAction<LoginResponse>) => {
@@ -31,11 +20,11 @@ export const authSlice = createSlice({
31
20
  // jscookie.set("token", payload?.access_token);
32
21
  // }
33
22
  },
34
- logout: (state) => {
23
+ logout: state => {
35
24
  state.accessToken = null;
36
25
  state.name = null;
37
26
  state.role = null;
38
- jscookie.remove("token");
27
+ jscookie.remove('token');
39
28
  },
40
29
  },
41
30
  });
@@ -0,0 +1,11 @@
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
+ }
@@ -1,4 +1,4 @@
1
- import { AppSettings } from './types';
1
+ import { AppSettings } from '../types';
2
2
 
3
3
  export const defaultSettings: AppSettings = {
4
4
  xOptions: false,
@@ -0,0 +1,67 @@
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;
@@ -0,0 +1,11 @@
1
+ export type NyrisAppPart = 'start' | 'camera' | 'results';
2
+ export type NyrisFeedbackState =
3
+ | 'hidden'
4
+ | 'question'
5
+ | 'positive'
6
+ | 'negative';
7
+
8
+ export interface NyrisAppState {
9
+ showPart: NyrisAppPart;
10
+ feedbackState: NyrisFeedbackState;
11
+ }
@@ -1,67 +1,7 @@
1
- import { Code, RectCoords, Region } from '@nyris/nyris-api';
1
+ import { RectCoords, Region } from '@nyris/nyris-api';
2
2
  import { createSlice, PayloadAction } from '@reduxjs/toolkit';
3
- import { CanvasWithId } from 'types';
4
- import { DEFAULT_REGION } from '../constants';
5
-
6
- interface CategoryPrediction {
7
- name: string;
8
- score: number;
9
- }
10
-
11
- export interface SearchState {
12
- results: any[];
13
- duration?: number;
14
- requestId?: string;
15
- sessionId?: string;
16
- regions: Region[];
17
- selectedRegion?: RectCoords;
18
- fetchingRegions: boolean;
19
- fetchingResults: boolean;
20
- filterOptions: string[];
21
- requestImage?: CanvasWithId | undefined;
22
- categoryPredictions: CategoryPrediction[];
23
- codes: Code[];
24
- errorMessage: string;
25
- valueTextSearch: any;
26
- resultSearchText: any[];
27
- filters: any[];
28
- configureFilter?: any;
29
- loadingSearchAlgolia: boolean;
30
- imageThumbSearchInput?: any;
31
- textSearchInputMobile?: string;
32
- isShowModalDetailItemMobile?: boolean;
33
- keyFilter?: string;
34
- preFilterDropdown?: boolean;
35
- setPreFilterDropdown?: any;
36
- }
37
-
38
- // TODO: init state
39
- const initialState: SearchState = {
40
- results: [],
41
- regions: [],
42
- selectedRegion: undefined,
43
- requestImage: undefined,
44
- fetchingResults: false,
45
- fetchingRegions: false,
46
- filterOptions: [],
47
- categoryPredictions: [],
48
- codes: [],
49
- errorMessage: '',
50
- valueTextSearch: {
51
- configure: { filters: '' },
52
- page: 1,
53
- refinementList: '',
54
- },
55
- resultSearchText: [],
56
- filters: [],
57
- configureFilter: {},
58
- loadingSearchAlgolia: false,
59
- imageThumbSearchInput: '',
60
- textSearchInputMobile: '',
61
- isShowModalDetailItemMobile: false,
62
- keyFilter: '',
63
- preFilterDropdown: false,
64
- };
3
+ import { DEFAULT_REGION } from '../../constants';
4
+ import { initialState } from './search.initialState';
65
5
 
66
6
  export const searchSlice = createSlice({
67
7
  name: 'search',
@@ -109,6 +49,7 @@ export const searchSlice = createSlice({
109
49
  canvas: data.payload,
110
50
  id: Math.random().toString(),
111
51
  },
52
+ regions: [],
112
53
  }),
113
54
 
114
55
  selectionChanged: (state, data: PayloadAction<RectCoords>) => {
@@ -0,0 +1,28 @@
1
+ import { SearchState } from './types';
2
+
3
+ export const initialState: SearchState = {
4
+ results: [],
5
+ regions: [],
6
+ selectedRegion: undefined,
7
+ requestImage: undefined,
8
+ fetchingResults: false,
9
+ fetchingRegions: false,
10
+ filterOptions: [],
11
+ categoryPredictions: [],
12
+ codes: [],
13
+ errorMessage: '',
14
+ valueTextSearch: {
15
+ configure: { filters: '' },
16
+ page: 1,
17
+ refinementList: '',
18
+ },
19
+ resultSearchText: [],
20
+ filters: [],
21
+ configureFilter: {},
22
+ loadingSearchAlgolia: false,
23
+ imageThumbSearchInput: '',
24
+ textSearchInputMobile: '',
25
+ isShowModalDetailItemMobile: false,
26
+ keyFilter: '',
27
+ preFilterDropdown: false,
28
+ };
@@ -0,0 +1,34 @@
1
+ import { Region, RectCoords, Code } from '@nyris/nyris-api';
2
+ import { CanvasWithId } from 'types';
3
+
4
+ export interface CategoryPrediction {
5
+ name: string;
6
+ score: number;
7
+ }
8
+
9
+ export interface SearchState {
10
+ results: any[];
11
+ duration?: number;
12
+ requestId?: string;
13
+ sessionId?: string;
14
+ regions: Region[];
15
+ selectedRegion?: RectCoords;
16
+ fetchingRegions: boolean;
17
+ fetchingResults: boolean;
18
+ filterOptions: string[];
19
+ requestImage?: CanvasWithId | undefined;
20
+ categoryPredictions: CategoryPrediction[];
21
+ codes: Code[];
22
+ errorMessage: string;
23
+ valueTextSearch: any;
24
+ resultSearchText: any[];
25
+ filters: any[];
26
+ configureFilter?: any;
27
+ loadingSearchAlgolia: boolean;
28
+ imageThumbSearchInput?: any;
29
+ textSearchInputMobile?: string;
30
+ isShowModalDetailItemMobile?: boolean;
31
+ keyFilter?: string;
32
+ preFilterDropdown?: boolean;
33
+ setPreFilterDropdown?: any;
34
+ }
@@ -14,6 +14,7 @@ import { useAppSelector } from 'Store/Store';
14
14
  import { prepareImageList } from '../helpers/CommonHelper';
15
15
  import KeyboardArrowUpIcon from '@material-ui/icons/KeyboardArrowUp';
16
16
  import NoImage from '../common/assets/images/unnamed.png';
17
+ import { useTranslation } from 'react-i18next';
17
18
 
18
19
  interface Props {
19
20
  numberResult?: number;
@@ -75,6 +76,7 @@ function DetailItem(props: Props) {
75
76
 
76
77
  setDataImageCarouSel(valueKey);
77
78
  };
79
+ const { t } = useTranslation();
78
80
 
79
81
  return (
80
82
  <Box
@@ -141,14 +143,14 @@ function DetailItem(props: Props) {
141
143
  <Grid container justifyContent="space-between">
142
144
  <Grid item xs={12}>
143
145
  <Typography className="text-f13 fw-500 max-line-1">
144
- SKU: {sku}
146
+ {settings.itemIdLabel || 'SKU'}: {sku}
145
147
  </Typography>
146
148
  {dataItem.keyword_1 && (
147
149
  <Typography
148
150
  className="text-f13 fw-500 max-line-1"
149
151
  style={{ marginTop: '8px' }}
150
152
  >
151
- Manufacturer Number: {dataItem.keyword_1}
153
+ {t('Manufacturer Number')}: {dataItem.keyword_1}
152
154
  </Typography>
153
155
  )}
154
156
  {settings.warehouseVariant && (
@@ -351,7 +353,13 @@ function DetailItem(props: Props) {
351
353
  alignItems="center"
352
354
  >
353
355
  <Grid item>
354
- <Box display={'flex'} alignItems={'center'}>
356
+ <Box
357
+ display={'flex'}
358
+ justifyContent={
359
+ settings.shareOption ? 'space-between' : 'space-around'
360
+ }
361
+ alignItems={'center'}
362
+ >
355
363
  <Button
356
364
  className="btn-item"
357
365
  onClick={() => {
@@ -384,13 +392,15 @@ function DetailItem(props: Props) {
384
392
  </Button>
385
393
  </Box>
386
394
  </Grid>
387
- <Grid item>
388
- <Box display={'flex'} alignItems={'center'}>
389
- <Button className="btn-item" onClick={() => false}>
390
- <IconShare width={30} height={30} color="gray" />
391
- </Button>
392
- </Box>
393
- </Grid>
395
+ {settings.shareOption && (
396
+ <Grid item>
397
+ <Box display={'flex'} alignItems={'center'}>
398
+ <Button className="btn-item" onClick={() => false}>
399
+ <IconShare width={30} height={30} color="gray" />
400
+ </Button>
401
+ </Box>
402
+ </Grid>
403
+ )}
394
404
  {/* <Grid item>
395
405
  <Box display={'flex'} alignItems={'center'}>
396
406
  <Button className="btn-item">
@@ -12,12 +12,13 @@ import {
12
12
  loadingActionResults,
13
13
  setRegions,
14
14
  setSelectedRegion,
15
- } from 'Store/Search';
16
- import { showFeedback } from 'Store/Nyris';
15
+ } from 'Store/search/Search';
16
+ import { showFeedback } from 'Store/nyris/Nyris';
17
17
  import { useHistory } from 'react-router-dom';
18
18
  import { useState } from 'react';
19
19
  import IconUpload from 'common/assets/images/Icon_Upload.svg';
20
20
  import { RectCoords } from '@nyris/nyris-api';
21
+ import { useTranslation } from 'react-i18next';
21
22
 
22
23
  interface Props {
23
24
  acceptTypes: any;
@@ -35,6 +36,7 @@ function DragDropFile(props: Props) {
35
36
  search: { keyFilter },
36
37
  } = searchState;
37
38
  const [isLoadingLoadFile, setLoadingLoadFile] = useState<any>(false);
39
+ const { t } = useTranslation();
38
40
  const { getRootProps, getInputProps, isDragActive } = useDropzone({
39
41
  onDrop: async (fs: File[]) => {
40
42
  history.push('/result');
@@ -147,7 +149,10 @@ function DragDropFile(props: Props) {
147
149
  className=""
148
150
  style={{ color: '#2B2C46', fontSize: 14 }}
149
151
  >
150
- <span className="fw-700">Choose an image</span> or drag it here
152
+ <span className="fw-700" style={{ paddingRight: '4px' }}>
153
+ {t('Choose an image')}
154
+ </span>
155
+ {t('or drag it here')}
151
156
  </label>
152
157
  <input
153
158
  {...getInputProps()}
@@ -1,12 +1,9 @@
1
- import { useAppDispatch, useAppSelector } from "Store/Store";
2
- import {
3
- feedbackNegative,
4
- feedbackSubmitPositive,
5
- NyrisFeedbackState,
6
- } from "Store/Nyris";
7
- import React from "react";
8
- import { Animate } from "react-move";
9
- import { feedbackSuccessEpic } from "services/Feedback";
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';
10
7
  interface FeedbackProps {
11
8
  feedbackState: NyrisFeedbackState;
12
9
  onClose?: () => void;
@@ -14,7 +11,7 @@ interface FeedbackProps {
14
11
 
15
12
  const Feedback: React.FC<FeedbackProps> = ({ feedbackState, onClose }) => {
16
13
  let inner: any = null;
17
- const state = useAppSelector((state) => state);
14
+ const state = useAppSelector(state => state);
18
15
  const dispatch = useAppDispatch();
19
16
  const onPositiveFeedback = (data: boolean) => {
20
17
  feedbackSuccessEpic(state, data);
@@ -26,7 +23,7 @@ const Feedback: React.FC<FeedbackProps> = ({ feedbackState, onClose }) => {
26
23
  };
27
24
 
28
25
  switch (feedbackState) {
29
- case "question":
26
+ case 'question':
30
27
  inner = (
31
28
  <div className="feedbackForm">
32
29
  <p>Did you find what you were looking for?</p>
@@ -45,14 +42,14 @@ const Feedback: React.FC<FeedbackProps> = ({ feedbackState, onClose }) => {
45
42
  </div>
46
43
  );
47
44
  break;
48
- case "positive":
45
+ case 'positive':
49
46
  inner = (
50
47
  <div className="feedbackMessage positive">
51
48
  Great, thank you for your feedback!
52
49
  </div>
53
50
  );
54
51
  break;
55
- case "negative":
52
+ case 'negative':
56
53
  inner = (
57
54
  <div className="feedbackMessage negative">
58
55
  We saved your request so we can track down the issue and improve the
@@ -71,7 +68,7 @@ const Feedback: React.FC<FeedbackProps> = ({ feedbackState, onClose }) => {
71
68
  }
72
69
  return (
73
70
  <Animate
74
- show={feedbackState !== "hidden"}
71
+ show={feedbackState !== 'hidden'}
75
72
  start={{ y: 100, opacity: 0 }}
76
73
  enter={{ y: [0], opacity: [1] }}
77
74
  leave={{ y: [100], opacity: [0] }}
@@ -1,35 +1,34 @@
1
- import React from "react";
1
+ import { Box } from '@material-ui/core';
2
+ import React from 'react';
3
+ import { NavLink } from 'react-router-dom';
4
+ import './common.scss';
5
+ import { useAppDispatch, useAppSelector } from 'Store/Store';
6
+ import { reset } from 'Store/search/Search';
2
7
 
3
- function HeaderComponent(): JSX.Element {
8
+ function Header(): JSX.Element {
9
+ const dispatch = useAppDispatch();
10
+ const { settings } = useAppSelector(state => state);
4
11
  return (
5
- <div className="navWrap">
6
- <div className="wrapper" style={{ padding: 0 }}>
7
- <section id="branding" />
8
- <div id="menu" className="menuWrap" role="navigation">
9
- <ul>
10
- <li>
11
- <a
12
- href="https://nyris.io/imprint/#privacy"
13
- target="_blank"
14
- rel="noopener noreferrer"
15
- >
16
- Privacy Policy
17
- </a>
18
- </li>
19
- <li>
20
- <a
21
- href="https://nyris.io/"
22
- target="_blank"
23
- rel="noopener noreferrer"
24
- >
25
- Visit our Website
26
- </a>
27
- </li>
28
- </ul>
29
- </div>
30
- </div>
31
- </div>
12
+ <Box className="box-content" display={'flex'}>
13
+ <NavLink
14
+ to="/"
15
+ style={{ lineHeight: 0, paddingLeft: '10px' }}
16
+ onClick={() => {
17
+ dispatch(reset(''));
18
+ }}
19
+ >
20
+ <img
21
+ src={settings.theme?.appBarLogoUrl}
22
+ alt="logo"
23
+ style={{
24
+ aspectRatio: 1,
25
+ width: settings.theme?.logoWidth,
26
+ height: settings.theme?.logoHeight,
27
+ }}
28
+ />
29
+ </NavLink>
30
+ </Box>
32
31
  );
33
32
  }
34
33
 
35
- export default HeaderComponent;
34
+ export default Header;
@@ -13,7 +13,7 @@ import {
13
13
  updateValueTextSearchMobile,
14
14
  setUpdateKeyFilterDesktop,
15
15
  setPreFilterDropdown,
16
- } from 'Store/Search';
16
+ } from 'Store/search/Search';
17
17
  import { useAppDispatch, useAppSelector } from 'Store/Store';
18
18
  import { AppState } from 'types';
19
19
  import CustomSearchBox from './input/inputSearch';
@@ -11,17 +11,16 @@ import {
11
11
  onResetRequestImage,
12
12
  setPreFilterDropdown,
13
13
  setUpdateSession,
14
- } from 'Store/Search';
14
+ } from 'Store/search/Search';
15
15
  import { useAppDispatch, useAppSelector } from 'Store/Store';
16
16
  import { AlgoliaSettings, AppState } from '../types';
17
17
  import './appMobile.scss';
18
18
  import './common.scss';
19
19
  import FooterMobile from './FooterMobile';
20
- import FooterNewVersion from './FooterNewVersion';
21
20
  import HeaderMobile from './HeaderMobile';
22
- import HeaderNewVersion from './HeaderNewVersion';
21
+ import Header from './Header';
23
22
  import ExpandablePanelComponent from './PanelResult';
24
- import FilterComponent from 'components/pre-filter/desktop';
23
+ import PreFilterComponent from 'components/pre-filter';
25
24
  import { createSessionByApi } from 'services/session';
26
25
 
27
26
  function Layout({ children }: ReactNode): JSX.Element {
@@ -62,8 +61,7 @@ function Layout({ children }: ReactNode): JSX.Element {
62
61
  FooterApp = FooterMobile;
63
62
  HeaderApp = HeaderMobile;
64
63
  } else {
65
- HeaderApp = HeaderNewVersion;
66
- FooterApp = FooterNewVersion;
64
+ HeaderApp = Header;
67
65
  }
68
66
 
69
67
  const conditionalQuery = useMemo(() => {
@@ -139,9 +137,11 @@ function Layout({ children }: ReactNode): JSX.Element {
139
137
  <div className={`box-body-${classNameBoxVersion}-wrap-main`}>
140
138
  {children}
141
139
  </div>
142
- <div className="footer-wrap-main">
143
- <FooterApp />
144
- </div>
140
+ {isMobile && (
141
+ <div className="footer-wrap-main">
142
+ <FooterApp />
143
+ </div>
144
+ )}
145
145
  </div>
146
146
  {isMobile && (
147
147
  <Box
@@ -166,7 +166,7 @@ function Layout({ children }: ReactNode): JSX.Element {
166
166
  className={'wrap-filter-destop'}
167
167
  >
168
168
  <div className={'bg-white box-filter-destop isMobile'}>
169
- <FilterComponent
169
+ <PreFilterComponent
170
170
  handleClose={() =>
171
171
  dispatch(setPreFilterDropdown(!preFilterDropdown))
172
172
  }