@nyris/nyris-webapp 0.2.5 → 0.3.2

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 (199) hide show
  1. package/build/asset-manifest.json +32 -18
  2. package/build/index.html +1 -1
  3. package/build/js/test.js +62 -0
  4. package/build/{precache-manifest.497998bf0df450969bab5608621be10a.js → precache-manifest.8f85a4fff2063a7498a608ec69549bb1.js} +89 -13
  5. package/build/service-worker.js +1 -1
  6. package/build/static/css/2.8285176a.chunk.css +2 -0
  7. package/build/static/css/2.8285176a.chunk.css.map +1 -0
  8. package/build/static/css/main.6676fe1f.chunk.css +2 -0
  9. package/build/static/css/main.6676fe1f.chunk.css.map +1 -0
  10. package/build/static/js/2.efc0ab83.chunk.js +3 -0
  11. package/build/static/js/2.efc0ab83.chunk.js.LICENSE.txt +133 -0
  12. package/build/static/js/2.efc0ab83.chunk.js.map +1 -0
  13. package/build/static/js/main.3bfed050.chunk.js +2 -0
  14. package/build/static/js/main.3bfed050.chunk.js.map +1 -0
  15. package/build/static/js/{runtime-main.f5553a9b.js → runtime-main.b418ff16.js} +1 -1
  16. package/build/static/js/{runtime-main.f5553a9b.js.map → runtime-main.b418ff16.js.map} +1 -1
  17. package/build/static/media/Fill.37094b44.svg +3 -0
  18. package/build/static/media/Montserrat-Bold.5a052e98.otf +0 -0
  19. package/build/static/media/Montserrat-Light.21789e89.otf +0 -0
  20. package/build/static/media/Montserrat-Medium.a53e0373.otf +0 -0
  21. package/build/static/media/Montserrat-Regular.71cdc681.otf +0 -0
  22. package/build/static/media/Montserrat-SemiBold.f613d915.otf +0 -0
  23. package/build/static/media/Rectangle.4dd8b747.png +0 -0
  24. package/build/static/media/admin.9529c7f6.svg +3 -0
  25. package/build/static/media/bg-support-page.6ac55268.svg +9 -0
  26. package/build/static/media/book_mark.8e294c0b.svg +3 -0
  27. package/build/static/media/icon_dislike.94607ca6.svg +3 -0
  28. package/build/static/media/icon_like.a4fb1b18.svg +3 -0
  29. package/build/static/media/icon_modal_image.3068d0ea.svg +21 -0
  30. package/build/static/media/icon_search_image.c2c728c0.svg +3 -0
  31. package/build/static/media/nyris_logo.22d8f250.svg +3 -0
  32. package/build/static/media/reload_icon.4b579a74.svg +3 -0
  33. package/build/static/media/save_search.bebaeebf.svg +3 -0
  34. package/build/static/media/support.289c3a3c.svg +3 -0
  35. package/build/static/media/translate_icon.f0492297.svg +3 -0
  36. package/package.json +30 -6
  37. package/public/js/test.js +62 -0
  38. package/src/App.css +27 -11
  39. package/src/App.tsx +19 -235
  40. package/src/Router.tsx +97 -0
  41. package/src/Store/Auth.ts +44 -0
  42. package/src/Store/Nyris.ts +77 -0
  43. package/src/Store/Search.ts +269 -0
  44. package/src/Store/Store.ts +46 -0
  45. package/src/Store/common.d.ts +10 -0
  46. package/src/{epics → Store/epics}/feedback.ts +0 -0
  47. package/src/{epics → Store/epics}/types.ts +1 -1
  48. package/src/common/assets/fonts/Montserrat_OTF/Montserrat-Bold.otf +0 -0
  49. package/src/common/assets/fonts/Montserrat_OTF/Montserrat-Light.otf +0 -0
  50. package/src/common/assets/fonts/Montserrat_OTF/Montserrat-Medium.otf +0 -0
  51. package/src/common/assets/fonts/Montserrat_OTF/Montserrat-Regular.otf +0 -0
  52. package/src/common/assets/fonts/Montserrat_OTF/Montserrat-SemiBold.otf +0 -0
  53. package/src/{fonts → common/assets/fonts}/roboto-bold-webfont.woff +0 -0
  54. package/src/{fonts → common/assets/fonts}/roboto-bold-webfont.woff2 +0 -0
  55. package/src/{fonts → common/assets/fonts}/roboto-italic-webfont.woff +0 -0
  56. package/src/{fonts → common/assets/fonts}/roboto-italic-webfont.woff2 +0 -0
  57. package/src/{fonts → common/assets/fonts}/roboto-regular-webfont.woff +0 -0
  58. package/src/{fonts → common/assets/fonts}/roboto-regular-webfont.woff2 +0 -0
  59. package/src/{fonts → common/assets/fonts}/robotocondensed-bold-webfont.woff +0 -0
  60. package/src/{fonts → common/assets/fonts}/robotocondensed-bold-webfont.woff2 +0 -0
  61. package/src/{fonts → common/assets/fonts}/robotocondensed-bolditalic-webfont.woff +0 -0
  62. package/src/{fonts → common/assets/fonts}/robotocondensed-bolditalic-webfont.woff2 +0 -0
  63. package/src/common/assets/icons/Fill.png +0 -0
  64. package/src/common/assets/icons/Fill.svg +3 -0
  65. package/src/common/assets/icons/Icon_wechat.png +0 -0
  66. package/src/common/assets/icons/Icon_whatsapp.png +0 -0
  67. package/src/common/assets/icons/admin.png +0 -0
  68. package/src/common/assets/icons/admin.svg +3 -0
  69. package/src/common/assets/icons/book_mark.png +0 -0
  70. package/src/common/assets/icons/book_mark.svg +3 -0
  71. package/src/common/assets/icons/icon_barcode.png +0 -0
  72. package/src/common/assets/icons/icon_camera.png +0 -0
  73. package/src/common/assets/icons/icon_dislike.svg +3 -0
  74. package/src/common/assets/icons/icon_disslike.png +0 -0
  75. package/src/common/assets/icons/icon_email.png +0 -0
  76. package/src/common/assets/icons/icon_like.png +0 -0
  77. package/src/common/assets/icons/icon_like.svg +3 -0
  78. package/src/common/assets/icons/icon_modal_image.png +0 -0
  79. package/src/common/assets/icons/icon_modal_image.svg +21 -0
  80. package/src/common/assets/icons/icon_picture.png +0 -0
  81. package/src/common/assets/icons/icon_search_image.png +0 -0
  82. package/src/common/assets/icons/icon_search_image.svg +3 -0
  83. package/src/common/assets/icons/nyris_logo.svg +3 -0
  84. package/src/common/assets/icons/reload_icon.png +0 -0
  85. package/src/common/assets/icons/reload_icon.svg +3 -0
  86. package/src/common/assets/icons/save_search.png +0 -0
  87. package/src/common/assets/icons/save_search.svg +3 -0
  88. package/src/common/assets/icons/setting_search_icon.png +0 -0
  89. package/src/common/assets/icons/support.png +0 -0
  90. package/src/common/assets/icons/support.svg +3 -0
  91. package/src/common/assets/icons/translate_icon.png +0 -0
  92. package/src/common/assets/icons/translate_icon.svg +3 -0
  93. package/src/common/assets/icons/view_off.png +0 -0
  94. package/src/common/assets/images/Rectangle.png +0 -0
  95. package/src/common/assets/images/bg-support-page.svg +9 -0
  96. package/src/{images → common/assets/images}/fav/android-icon-192x192.png +0 -0
  97. package/src/{images → common/assets/images}/fav/apple-icon-114x114.png +0 -0
  98. package/src/{images → common/assets/images}/fav/apple-icon-120x120.png +0 -0
  99. package/src/{images → common/assets/images}/fav/apple-icon-144x144.png +0 -0
  100. package/src/{images → common/assets/images}/fav/apple-icon-152x152.png +0 -0
  101. package/src/{images → common/assets/images}/fav/apple-icon-180x180.png +0 -0
  102. package/src/{images → common/assets/images}/fav/apple-icon-57x57.png +0 -0
  103. package/src/{images → common/assets/images}/fav/apple-icon-60x60.png +0 -0
  104. package/src/{images → common/assets/images}/fav/apple-icon-72x72.png +0 -0
  105. package/src/{images → common/assets/images}/fav/apple-icon-76x76.png +0 -0
  106. package/src/{images → common/assets/images}/fav/browserconfig.xml +0 -0
  107. package/src/{images → common/assets/images}/fav/favicon-16x16.png +0 -0
  108. package/src/{images → common/assets/images}/fav/favicon-32x32.png +0 -0
  109. package/src/{images → common/assets/images}/fav/favicon-96x96.png +0 -0
  110. package/src/{images → common/assets/images}/fav/manifest.json +0 -0
  111. package/src/{images → common/assets/images}/ic_cam.png +0 -0
  112. package/src/{images → common/assets/images}/ic_cam.svg +0 -0
  113. package/src/{images → common/assets/images}/ic_cam_large.png +0 -0
  114. package/src/{images → common/assets/images}/ic_cam_large.svg +0 -0
  115. package/src/{images → common/assets/images}/ic_cam_large_noimage.png +0 -0
  116. package/src/{images → common/assets/images}/ic_close_feedback.png +0 -0
  117. package/src/{images → common/assets/images}/ic_close_feedback.svg +0 -0
  118. package/src/{images → common/assets/images}/ic_shopNow.png +0 -0
  119. package/src/{images → common/assets/images}/ic_shopNow.svg +0 -0
  120. package/src/{images → common/assets/images}/ic_shopNowLight.png +0 -0
  121. package/src/{images → common/assets/images}/ic_shopNowLight.svg +0 -0
  122. package/src/common/assets/images/image_test.png +0 -0
  123. package/src/{images → common/assets/images}/nyris_logo.png +0 -0
  124. package/src/{images → common/assets/images}/rewe.svg +0 -0
  125. package/src/{images → common/assets/images}/sectionTransBack.png +0 -0
  126. package/src/{images → common/assets/images}/sectionTransBack.svg +0 -0
  127. package/src/{images → common/assets/images}/sectionTransTop.png +0 -0
  128. package/src/{images → common/assets/images}/sectionTransTop.svg +0 -0
  129. package/src/components/DetailItem.tsx +175 -0
  130. package/src/components/DragDropFile.tsx +188 -0
  131. package/src/components/ExampleImages.tsx +32 -17
  132. package/src/components/Feedback.tsx +87 -48
  133. package/src/components/FilterComponent.tsx +33 -0
  134. package/src/components/Footer.tsx +29 -0
  135. package/src/components/FooterMD.tsx +54 -0
  136. package/src/components/FooterNewVersion.tsx +12 -0
  137. package/src/components/FooterResult.tsx +47 -0
  138. package/src/components/Header.tsx +35 -0
  139. package/src/components/HeaderMd.tsx +39 -0
  140. package/src/components/HeaderNewVersion.tsx +92 -0
  141. package/src/components/Layout.tsx +46 -0
  142. package/src/components/LoadingScreen/index.tsx +29 -0
  143. package/src/components/Navigation.tsx +34 -0
  144. package/src/components/Panigation/Pagination.tsx +140 -0
  145. package/src/components/Panigation/cx.js +3 -0
  146. package/src/components/Panigation/isModifierClick.js +10 -0
  147. package/src/components/Result.tsx +186 -113
  148. package/src/components/Saved/AllItem.tsx +32 -0
  149. package/src/components/Saved/Category.tsx +16 -0
  150. package/src/components/carousel/DefaultCarousel.tsx +48 -0
  151. package/src/components/common.d.ts +9 -0
  152. package/src/components/common.scss +54 -0
  153. package/src/components/default-select.tsx +44 -0
  154. package/src/components/hitItem/hits.tsx +50 -0
  155. package/src/components/hitItem/infinitiHits.tsx +33 -0
  156. package/src/components/input/inputSearch.tsx +77 -0
  157. package/src/components/modal/DefaultModal.tsx +28 -0
  158. package/src/components/preview/preview.tsx +433 -0
  159. package/src/components/results/ItemResult.tsx +155 -0
  160. package/src/components/search/ListSearch.tsx +209 -0
  161. package/src/defaults.ts +4 -3
  162. package/src/index.css +577 -306
  163. package/src/index.tsx +39 -187
  164. package/src/modules/LandingPage/common.scss +1304 -0
  165. package/src/modules/LandingPage/indexApp.tsx +474 -0
  166. package/src/modules/LandingPage/indexAppMD.tsx +494 -0
  167. package/src/modules/LandingPage/indexNewVersion.tsx +117 -0
  168. package/src/page/Auth/login.tsx +7 -0
  169. package/src/page/Exception/404.tsx +11 -0
  170. package/src/page/History/index.tsx +76 -0
  171. package/src/page/Profile/index.tsx +87 -0
  172. package/src/page/Saved/MockData.ts +223 -0
  173. package/src/page/Saved/index.tsx +166 -0
  174. package/src/page/Support/index.tsx +160 -0
  175. package/src/page/result/MockData.ts +36 -0
  176. package/src/page/result/index.tsx +473 -0
  177. package/src/services/Feedback.ts +65 -0
  178. package/src/services/findByImage.ts +24 -0
  179. package/src/services/findRegionsCustom.ts +212 -0
  180. package/src/services/image.ts +110 -0
  181. package/src/services/nyris.ts +123 -0
  182. package/src/services/session.ts +20 -0
  183. package/src/services/types.ts +96 -0
  184. package/src/types.ts +43 -3
  185. package/tsconfig.json +3 -8
  186. package/build/static/css/2.43a1c8b7.chunk.css +0 -2
  187. package/build/static/css/2.43a1c8b7.chunk.css.map +0 -1
  188. package/build/static/css/main.f6ed5f12.chunk.css +0 -2
  189. package/build/static/css/main.f6ed5f12.chunk.css.map +0 -1
  190. package/build/static/js/2.a591d52a.chunk.js +0 -3
  191. package/build/static/js/2.a591d52a.chunk.js.LICENSE.txt +0 -79
  192. package/build/static/js/2.a591d52a.chunk.js.map +0 -1
  193. package/build/static/js/main.28bb3581.chunk.js +0 -2
  194. package/build/static/js/main.28bb3581.chunk.js.map +0 -1
  195. package/src/AppMD.tsx +0 -320
  196. package/src/actions/nyrisAppActions.ts +0 -76
  197. package/src/actions/searchActions.ts +0 -143
  198. package/src/epics/index.ts +0 -149
  199. package/src/epics/search.ts +0 -114
@@ -0,0 +1,33 @@
1
+ import { Box, Button, Grid } from "@material-ui/core";
2
+ import DefaultSelect from "components/default-select";
3
+ import React from "react";
4
+
5
+ interface Props {}
6
+
7
+ function FilterComponent(props: Props) {
8
+ const {} = props;
9
+
10
+ return (
11
+ <Box className="box-main-filter">
12
+ <Grid container>
13
+ <Grid item className="item">
14
+ <DefaultSelect attribute="brand" />
15
+ </Grid>
16
+ <Grid item className="item">
17
+ <DefaultSelect attribute="keyword_0" />
18
+ </Grid>
19
+
20
+ <Grid item className="item-seven text-center">
21
+ <Button
22
+ className="text-btn-small bg-pink text-red"
23
+ style={{ borderRadius: 12 }}
24
+ >
25
+ Clear x
26
+ </Button>
27
+ </Grid>
28
+ </Grid>
29
+ </Box>
30
+ );
31
+ }
32
+
33
+ export default FilterComponent;
@@ -0,0 +1,29 @@
1
+ import React from "react";
2
+ import { useAppDispatch, useAppSelector } from "Store/Store";
3
+ import Feedback from "components/Feedback";
4
+ import { hideFeedback } from "Store/Nyris";
5
+
6
+ function FooterComponent(): JSX.Element {
7
+ const dispatch = useAppDispatch();
8
+ const searchState = useAppSelector((state) => state);
9
+ const { nyris } = searchState;
10
+ const { feedbackState } = nyris;
11
+ return (
12
+ <>
13
+ <section className="footnote">
14
+ <div className="wrapper">
15
+ © 2017 - 2019 <a href="https://nyris.io">nyris GmbH</a> - All rights
16
+ reserved - <a href="https://nyris.io/imprint/">Imprint</a>
17
+ </div>
18
+ </section>
19
+ <Feedback
20
+ feedbackState={feedbackState}
21
+ onClose={() => {
22
+ return dispatch(hideFeedback(""));
23
+ }}
24
+ />
25
+ </>
26
+ );
27
+ }
28
+
29
+ export default FooterComponent;
@@ -0,0 +1,54 @@
1
+ import React from "react";
2
+ import { makeStyles, Typography, Link } from "@material-ui/core";
3
+ import { useAppSelector } from "Store/Store";
4
+
5
+ const useStyles = makeStyles((theme) => ({
6
+ footer: {
7
+ backgroundColor: theme.palette.background.paper,
8
+ padding: theme.spacing(6),
9
+ },
10
+ }));
11
+
12
+ function Copyright() {
13
+ return (
14
+ <Typography variant="body2" color="textSecondary" align="center">
15
+ {"Powered by "}
16
+ <Link
17
+ color="inherit"
18
+ href="https://nyris.io/"
19
+ component="a"
20
+ target="_blank"
21
+ >
22
+ nyris.io
23
+ </Link>
24
+ </Typography>
25
+ );
26
+ }
27
+
28
+ function FooterMD(): JSX.Element {
29
+ const searchState = useAppSelector((state) => state);
30
+ const { search, nyris } = searchState;
31
+ const { showPart } = nyris;
32
+ const { requestId } = search;
33
+ const classes = useStyles();
34
+ return (
35
+ <footer className={classes.footer}>
36
+ <Typography variant="subtitle1" align="center" color="textSecondary">
37
+ {requestId && showPart === "results" && (
38
+ <div
39
+ style={{
40
+ textAlign: "center",
41
+ fontSize: "0.7em",
42
+ paddingTop: "0.8em",
43
+ }}
44
+ >
45
+ Request identifier {requestId}
46
+ </div>
47
+ )}
48
+ </Typography>
49
+ <Copyright />
50
+ </footer>
51
+ );
52
+ }
53
+
54
+ export default FooterMD;
@@ -0,0 +1,12 @@
1
+ import { Box } from '@material-ui/core'
2
+ import React from 'react'
3
+
4
+ interface Props {}
5
+
6
+ function FooterNewVersion(props: Props): JSX.Element {
7
+ return (
8
+ <Box></Box>
9
+ )
10
+ }
11
+
12
+ export default FooterNewVersion
@@ -0,0 +1,47 @@
1
+ import { Box, Grid, Typography } from "@material-ui/core";
2
+ import React from "react";
3
+ import { Link } from "react-router-dom";
4
+ import TitleOutlinedIcon from "@material-ui/icons/TitleOutlined";
5
+
6
+ interface Props {
7
+ search: any;
8
+ }
9
+
10
+ function FooterResult(props: Props) {
11
+ const {search} = props;
12
+
13
+ return (
14
+ <Grid
15
+ container
16
+ justifyContent="space-between"
17
+ alignItems="center"
18
+ style={{ height: "100%" }}
19
+ >
20
+ <Grid
21
+ item
22
+ className="item-notify"
23
+ style={{ borderRight: "1px solid #E9E9EC", minWidth: 69 }}
24
+ >
25
+ <Typography className="text-f8 text-center">
26
+ {search.results.length} results
27
+ </Typography>
28
+ </Grid>
29
+ <Grid item className="item-notify">
30
+ <Typography className="text-f8 text-center">
31
+ Didn’t find what you were looking for? Share your search with our{" "}
32
+ <Link to={"#"}>product experts</Link>.
33
+ </Typography>
34
+ </Grid>
35
+ <Grid item className="item-notify" style={{ minWidth: 32 }}>
36
+ <Typography className="text-f8">
37
+ <Box>
38
+ <TitleOutlinedIcon style={{ color: "#55566B", fontSize: 8 }} />
39
+ <TitleOutlinedIcon style={{ color: "#55566B", fontSize: 10 }} />
40
+ </Box>
41
+ </Typography>
42
+ </Grid>
43
+ </Grid>
44
+ );
45
+ }
46
+
47
+ export default FooterResult;
@@ -0,0 +1,35 @@
1
+ import React from "react";
2
+
3
+ function HeaderComponent(): JSX.Element {
4
+ 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>
32
+ );
33
+ }
34
+
35
+ export default HeaderComponent;
@@ -0,0 +1,39 @@
1
+ import React from "react";
2
+ import { Container, Toolbar, Typography, AppBar } from "@material-ui/core";
3
+ import { defaultMdSettings } from "defaults";
4
+ import { useAppSelector } from "Store/Store";
5
+ interface Props {
6
+ settings: any;
7
+ }
8
+
9
+ function HeaderMdComponent(): JSX.Element {
10
+ const { settings } = useAppSelector((state: any) => state);
11
+ const { themePage } = settings;
12
+ const mdSettings: any = themePage.materialDesign.active
13
+ ? themePage.materialDesign.materialDesign
14
+ : defaultMdSettings;
15
+ return (
16
+ <AppBar
17
+ position={"relative"}
18
+ style={{ backgroundColor: mdSettings.appBarCustomBackgroundColor }}
19
+ >
20
+ <Container
21
+ maxWidth="md"
22
+ style={{ flexDirection: "row", display: "flex" }}
23
+ >
24
+ <img
25
+ src={mdSettings.appBarLogoUrl}
26
+ style={{ height: "2em", minHeight: "64px", display: "flex" }}
27
+ alt="Logo"
28
+ />
29
+ <Toolbar component="span">
30
+ <Typography style={{ color: mdSettings.appBarCustomTextColor }}>
31
+ {mdSettings.appBarTitle}
32
+ </Typography>
33
+ </Toolbar>
34
+ </Container>
35
+ </AppBar>
36
+ );
37
+ }
38
+
39
+ export default HeaderMdComponent;
@@ -0,0 +1,92 @@
1
+ import { Box, Grid } from "@material-ui/core";
2
+ import React from "react";
3
+ import { NavLink } from "react-router-dom";
4
+ import "./common.scss";
5
+ import IconReLoad from "common/assets/icons/reload_icon.svg";
6
+ import IconSave from "common/assets/icons/save_search.svg";
7
+ import IconSupport from "common/assets/icons/support.svg";
8
+ import IconAdmin from "common/assets/icons/admin.svg";
9
+ import LogoNyris from "common/assets/icons/nyris_logo.svg";
10
+ function HeaderNewVersion(): JSX.Element {
11
+ const handleCheckMatchLink = (match: any, location: any) => {
12
+ let active = false;
13
+ if (match?.url === location.pathname) {
14
+ active = true;
15
+ }
16
+
17
+ return active;
18
+ };
19
+
20
+ return (
21
+ <Box className="box-content" display={"flex"}>
22
+ <NavLink to="/" style={{ lineHeight: 0 }}>
23
+ {/* <section id="branding" style={{ height: 32 }} /> */}
24
+ <img width={74} height={19} src={`${LogoNyris}`} alt="nyris logo" />
25
+ </NavLink>
26
+ <Grid container className="nav-menu">
27
+ <Grid item className="item-nav">
28
+ <NavLink
29
+ activeClassName="active"
30
+ isActive={(match, location) =>
31
+ handleCheckMatchLink(match, location)
32
+ }
33
+ to={"/search-history"}
34
+ className="nav-link p-0 menu-children rounded-0"
35
+ >
36
+ <span className="d-none d-sm-block ms-4 px-2 py-1 border-bottom-1">
37
+ Search history
38
+ <img width={10} height={10} src={`${IconReLoad}`} alt=""/>
39
+ </span>
40
+ </NavLink>
41
+ </Grid>
42
+ <Grid item className="item-nav">
43
+ <NavLink
44
+ activeClassName="active"
45
+ isActive={(match, location) =>
46
+ handleCheckMatchLink(match, location)
47
+ }
48
+ to={"/saved"}
49
+ className="nav-link p-0 menu-children rounded-0"
50
+ >
51
+ <span className="d-none d-sm-block ms-4 px-2 py-1 border-bottom-1">
52
+ Saved
53
+ <img width={10} height={10} src={`${IconSave}`} alt=""/>
54
+ </span>
55
+ </NavLink>
56
+ </Grid>
57
+ <Grid item className="item-nav">
58
+ <NavLink
59
+ activeClassName="active"
60
+ isActive={(match, location) =>
61
+ handleCheckMatchLink(match, location)
62
+ }
63
+ to={"/support"}
64
+ className="nav-link p-0 menu-children rounded-0"
65
+ >
66
+ <span className="d-none d-sm-block ms-4 px-2 py-1 border-bottom-1">
67
+ Support
68
+ <img width={10} height={10} src={`${IconSupport}`} alt="" />
69
+ </span>
70
+ </NavLink>
71
+ </Grid>
72
+ <Grid item className="item-nav">
73
+ <NavLink
74
+ activeClassName="active"
75
+ isActive={(match, location) =>
76
+ handleCheckMatchLink(match, location)
77
+ }
78
+ to={"/account"}
79
+ className="nav-link p-0 menu-children rounded-0"
80
+ >
81
+ <span className="d-none d-sm-block ms-4 px-2 py-1 border-bottom-1">
82
+ My Account
83
+ <img width={10} height={10} src={`${IconAdmin}`} alt=""/>
84
+ </span>
85
+ </NavLink>
86
+ </Grid>
87
+ </Grid>
88
+ </Box>
89
+ );
90
+ }
91
+
92
+ export default HeaderNewVersion;
@@ -0,0 +1,46 @@
1
+ import React from "react";
2
+ import { ReactNode } from "components/common";
3
+ import "./common.scss";
4
+ import HeaderComponent from "./Header";
5
+ import FooterComponent from "./Footer";
6
+ import { useAppSelector } from "Store/Store";
7
+ import HeaderMdComponent from "./HeaderMd";
8
+ import FooterMD from "./FooterMD";
9
+ import HeaderNewVersion from "./HeaderNewVersion";
10
+ import FooterNewVersion from "./FooterNewVersion";
11
+ import {AppState} from "../types";
12
+ function Layout({ children }: ReactNode): JSX.Element {
13
+ const { settings } = useAppSelector<AppState>((state:any) => state);
14
+ const { themePage } = settings;
15
+
16
+ let HeaderApp: any;
17
+ let FooterApp: any;
18
+ let classNameBoxVersion: string = "newVersion";
19
+ if (themePage.default?.active) {
20
+ classNameBoxVersion = "default";
21
+ HeaderApp = HeaderComponent;
22
+ FooterApp = FooterComponent;
23
+ } else if (themePage.materialDesign?.active) {
24
+ classNameBoxVersion = "materialDesign";
25
+ HeaderApp = HeaderMdComponent;
26
+ FooterApp = FooterMD;
27
+ } else {
28
+ HeaderApp = HeaderNewVersion;
29
+ FooterApp = FooterNewVersion;
30
+ }
31
+ return (
32
+ <div className={`layout-main-${classNameBoxVersion}`}>
33
+ <div className={`box-header-${classNameBoxVersion}-main`}>
34
+ <HeaderApp />
35
+ </div>
36
+ <div className={`box-body-${classNameBoxVersion}-wrap-main`}>
37
+ {children}
38
+ </div>
39
+ <div className="footer-wrap-main">
40
+ <FooterApp />
41
+ </div>
42
+ </div>
43
+ );
44
+ }
45
+
46
+ export default Layout;
@@ -0,0 +1,29 @@
1
+ import React, { useState } from "react";
2
+ import { Box } from "@material-ui/core";
3
+ import { connectStateResults } from "react-instantsearch-dom";
4
+
5
+ function LoadingScreen({
6
+ searchState,
7
+ searchResults,
8
+ children,
9
+ isSearchStalled,
10
+ searchingForFacetValues,
11
+ searching,
12
+ }: any) {
13
+ const [isLoading] = useState<boolean>(false);
14
+
15
+ return (
16
+ <>
17
+ {isLoading && (
18
+ <Box className="box-wrap-loading">
19
+ <Box className="loadingSpinCT">
20
+ <Box className="box-content-spin"></Box>
21
+ </Box>
22
+ </Box>
23
+ )}
24
+ {children}
25
+ </>
26
+ );
27
+ }
28
+ const LoadingScreenCustom = connectStateResults(LoadingScreen);
29
+ export default LoadingScreenCustom;
@@ -0,0 +1,34 @@
1
+ import React from "react";
2
+ import { NavLink } from "react-router-dom";
3
+ // import * as H from "history";
4
+
5
+ function Navigation(): JSX.Element {
6
+ // const handleCheckMatchLink = (match: any, location: H.Location) => {
7
+ // if (match?.url === location?.pathname) {
8
+ // return true;
9
+ // }
10
+ // return false;
11
+ // };
12
+
13
+ return (
14
+ <ul className="d-flex align-center">
15
+ <li>
16
+ <NavLink
17
+ activeClassName="active"
18
+ // isActive={(match, location: H.Location) => {
19
+ // return handleCheckMatchLink(match, location);
20
+ // }}
21
+ isActive={() => false}
22
+ to={"/search-history"}
23
+ className="nav-link p-0 menu-children rounded-0"
24
+ >
25
+ <span className="d-none d-sm-block ms-4 px-2 py-1 border-bottom-1">
26
+ Search history
27
+ </span>
28
+ </NavLink>
29
+ </li>
30
+ </ul>
31
+ );
32
+ }
33
+
34
+ export default Navigation;
@@ -0,0 +1,140 @@
1
+ import React from 'react';
2
+ import { usePagination, UsePaginationProps } from 'react-instantsearch-hooks';
3
+ import { cx } from './cx';
4
+ import { isModifierClick } from './isModifierClick';
5
+
6
+ export type PaginationProps = React.ComponentProps<'div'> & UsePaginationProps;
7
+
8
+ export function PaginationComponent(props: PaginationProps) {
9
+ const {
10
+ refine,
11
+ createURL,
12
+ pages,
13
+ currentRefinement,
14
+ isFirstPage,
15
+ isLastPage,
16
+ nbPages,
17
+ canRefine,
18
+ } = usePagination(props);
19
+
20
+ return (
21
+ <div
22
+ className={cx(
23
+ 'ais-Pagination',
24
+ canRefine === false && 'ais-Pagination--noRefinement',
25
+ props.className
26
+ )}
27
+ >
28
+ <ul className="ais-Pagination-list">
29
+ <PaginationItem
30
+ aria-label="First"
31
+ value={0}
32
+ isDisabled={isFirstPage}
33
+ createURL={createURL}
34
+ refine={refine}
35
+ className={cx(
36
+ 'ais-Pagination-item',
37
+ 'ais-Pagination-item--firstPage'
38
+ )}
39
+ >
40
+ ‹‹
41
+ </PaginationItem>
42
+
43
+ <PaginationItem
44
+ aria-label="Previous"
45
+ value={currentRefinement - 1}
46
+ isDisabled={isFirstPage}
47
+ createURL={createURL}
48
+ refine={refine}
49
+ className={cx(
50
+ 'ais-Pagination-item',
51
+ 'ais-Pagination-item--previousPage'
52
+ )}
53
+ >
54
+
55
+ </PaginationItem>
56
+
57
+ {pages.map((page) => (
58
+ <PaginationItem
59
+ key={page}
60
+ aria-label={String(page)}
61
+ value={page}
62
+ isDisabled={false}
63
+ createURL={createURL}
64
+ refine={refine}
65
+ className={cx(
66
+ 'ais-Pagination-item',
67
+ page === currentRefinement && 'ais-Pagination-item--selected'
68
+ )}
69
+ >
70
+ {page + 1}
71
+ </PaginationItem>
72
+ ))}
73
+
74
+ <PaginationItem
75
+ aria-label="Next"
76
+ value={currentRefinement + 1}
77
+ isDisabled={isLastPage}
78
+ createURL={createURL}
79
+ refine={refine}
80
+ className={cx('ais-Pagination-item', 'ais-Pagination-item--nextPage')}
81
+ >
82
+
83
+ </PaginationItem>
84
+
85
+ <PaginationItem
86
+ aria-label="Last"
87
+ value={nbPages - 1}
88
+ isDisabled={isLastPage}
89
+ createURL={createURL}
90
+ refine={refine}
91
+ className={cx('ais-Pagination-item', 'ais-Pagination-item--lastPage')}
92
+ >
93
+ ››
94
+ </PaginationItem>
95
+ </ul>
96
+ </div>
97
+ );
98
+ }
99
+
100
+ type PaginationItemProps = React.ComponentProps<'a'> &
101
+ Pick<ReturnType<typeof usePagination>, 'refine' | 'createURL'> & {
102
+ isDisabled: boolean;
103
+ value: number;
104
+ };
105
+
106
+ function PaginationItem(props: PaginationItemProps) {
107
+ const { isDisabled, className, href, value, createURL, refine, ...rest } =
108
+ props;
109
+
110
+ if (isDisabled) {
111
+ return (
112
+ <li className={cx(className, 'ais-Pagination-item--disabled')}>
113
+ <span className="ais-Pagination-link" {...rest} />
114
+ </li>
115
+ );
116
+ }
117
+
118
+ return (
119
+ <li className={className}>
120
+ <a
121
+ className="ais-Pagination-link"
122
+ href={createURL(value)}
123
+ onClick={(event) => {
124
+ // We let the browser handle the native event when the click is modified
125
+ // (with a special mouse event or with a combination key) for accessibility
126
+ // purposes. For example, clicking the link while holding the Control
127
+ // key opens the next search state link in a new tab, but doesn't refine
128
+ // the search state in the current tab.
129
+ if (isModifierClick(event)) {
130
+ return;
131
+ }
132
+
133
+ event.preventDefault();
134
+ refine(value);
135
+ }}
136
+ {...rest}
137
+ />
138
+ </li>
139
+ );
140
+ }
@@ -0,0 +1,3 @@
1
+ export function cx(...classNames) {
2
+ return classNames.filter(Boolean).join(' ');
3
+ }
@@ -0,0 +1,10 @@
1
+ export function isModifierClick(event) {
2
+ const isMiddleClick = event.button === 1;
3
+ return Boolean(
4
+ isMiddleClick ||
5
+ event.altKey ||
6
+ event.ctrlKey ||
7
+ event.metaKey ||
8
+ event.shiftKey
9
+ );
10
+ }