@nyris/nyris-webapp 0.3.3 → 0.3.6

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 (205) hide show
  1. package/build/asset-manifest.json +18 -32
  2. package/build/index.html +1 -1
  3. package/build/{precache-manifest.01ce682577e62add75aa397b2a944b75.js → precache-manifest.bffed513ca17d8ac16af1cc3aaa7d908.js} +13 -89
  4. package/build/service-worker.js +1 -1
  5. package/build/static/css/2.43a1c8b7.chunk.css +2 -0
  6. package/build/static/css/2.43a1c8b7.chunk.css.map +1 -0
  7. package/build/static/css/main.2a76dc8a.chunk.css +2 -0
  8. package/build/static/css/main.2a76dc8a.chunk.css.map +1 -0
  9. package/build/static/js/2.4e9a4ce1.chunk.js +3 -0
  10. package/build/static/js/2.4e9a4ce1.chunk.js.LICENSE.txt +79 -0
  11. package/build/static/js/2.4e9a4ce1.chunk.js.map +1 -0
  12. package/build/static/js/main.ec93aa4d.chunk.js +2 -0
  13. package/build/static/js/main.ec93aa4d.chunk.js.map +1 -0
  14. package/build/static/js/{runtime-main.b418ff16.js → runtime-main.f5553a9b.js} +1 -1
  15. package/build/static/js/{runtime-main.b418ff16.js.map → runtime-main.f5553a9b.js.map} +1 -1
  16. package/package.json +7 -30
  17. package/src/App.css +64 -20
  18. package/src/App.tsx +253 -19
  19. package/src/AppMD.tsx +320 -0
  20. package/src/Demo2.tsx +220 -0
  21. package/src/actions/nyrisAppActions.ts +76 -0
  22. package/src/actions/searchActions.ts +218 -0
  23. package/src/components/ExampleImages.tsx +17 -32
  24. package/src/components/Feedback.tsx +48 -87
  25. package/src/components/FiltersList.tsx +69 -0
  26. package/src/components/Header.tsx +17 -32
  27. package/src/components/Result.tsx +113 -186
  28. package/src/components/Sidebar.tsx +40 -0
  29. package/src/defaults.ts +3 -4
  30. package/src/{Store/epics → epics}/feedback.ts +0 -0
  31. package/src/epics/index.ts +154 -0
  32. package/src/epics/search.ts +203 -0
  33. package/src/{Store/epics → epics}/types.ts +1 -1
  34. package/src/{common/assets/fonts → fonts}/roboto-bold-webfont.woff +0 -0
  35. package/src/{common/assets/fonts → fonts}/roboto-bold-webfont.woff2 +0 -0
  36. package/src/{common/assets/fonts → fonts}/roboto-italic-webfont.woff +0 -0
  37. package/src/{common/assets/fonts → fonts}/roboto-italic-webfont.woff2 +0 -0
  38. package/src/{common/assets/fonts → fonts}/roboto-regular-webfont.woff +0 -0
  39. package/src/{common/assets/fonts → fonts}/roboto-regular-webfont.woff2 +0 -0
  40. package/src/{common/assets/fonts → fonts}/robotocondensed-bold-webfont.woff +0 -0
  41. package/src/{common/assets/fonts → fonts}/robotocondensed-bold-webfont.woff2 +0 -0
  42. package/src/{common/assets/fonts → fonts}/robotocondensed-bolditalic-webfont.woff +0 -0
  43. package/src/{common/assets/fonts → fonts}/robotocondensed-bolditalic-webfont.woff2 +0 -0
  44. package/src/{common/assets/images → images}/fav/android-icon-192x192.png +0 -0
  45. package/src/{common/assets/images → images}/fav/apple-icon-114x114.png +0 -0
  46. package/src/{common/assets/images → images}/fav/apple-icon-120x120.png +0 -0
  47. package/src/{common/assets/images → images}/fav/apple-icon-144x144.png +0 -0
  48. package/src/{common/assets/images → images}/fav/apple-icon-152x152.png +0 -0
  49. package/src/{common/assets/images → images}/fav/apple-icon-180x180.png +0 -0
  50. package/src/{common/assets/images → images}/fav/apple-icon-57x57.png +0 -0
  51. package/src/{common/assets/images → images}/fav/apple-icon-60x60.png +0 -0
  52. package/src/{common/assets/images → images}/fav/apple-icon-72x72.png +0 -0
  53. package/src/{common/assets/images → images}/fav/apple-icon-76x76.png +0 -0
  54. package/src/{common/assets/images → images}/fav/browserconfig.xml +0 -0
  55. package/src/{common/assets/images → images}/fav/favicon-16x16.png +0 -0
  56. package/src/{common/assets/images → images}/fav/favicon-32x32.png +0 -0
  57. package/src/{common/assets/images → images}/fav/favicon-96x96.png +0 -0
  58. package/src/{common/assets/images → images}/fav/manifest.json +0 -0
  59. package/src/{common/assets/images → images}/ic_cam.png +0 -0
  60. package/src/{common/assets/images → images}/ic_cam.svg +0 -0
  61. package/src/{common/assets/images → images}/ic_cam_large.png +0 -0
  62. package/src/{common/assets/images → images}/ic_cam_large.svg +0 -0
  63. package/src/{common/assets/images → images}/ic_cam_large_noimage.png +0 -0
  64. package/src/{common/assets/images → images}/ic_close_feedback.png +0 -0
  65. package/src/{common/assets/images → images}/ic_close_feedback.svg +0 -0
  66. package/src/{common/assets/images → images}/ic_shopNow.png +0 -0
  67. package/src/{common/assets/images → images}/ic_shopNow.svg +0 -0
  68. package/src/{common/assets/images → images}/ic_shopNowLight.png +0 -0
  69. package/src/{common/assets/images → images}/ic_shopNowLight.svg +0 -0
  70. package/src/{common/assets/images → images}/nyris_logo.png +0 -0
  71. package/src/{common/assets/images → images}/rewe.svg +0 -0
  72. package/src/{common/assets/images → images}/sectionTransBack.png +0 -0
  73. package/src/{common/assets/images → images}/sectionTransBack.svg +0 -0
  74. package/src/{common/assets/images → images}/sectionTransTop.png +0 -0
  75. package/src/{common/assets/images → images}/sectionTransTop.svg +0 -0
  76. package/src/index.css +416 -573
  77. package/src/index.tsx +190 -39
  78. package/src/types.ts +3 -43
  79. package/tsconfig.json +8 -3
  80. package/build/js/settings.example.js +0 -31
  81. package/build/js/test.js +0 -56
  82. package/build/static/css/2.8285176a.chunk.css +0 -2
  83. package/build/static/css/2.8285176a.chunk.css.map +0 -1
  84. package/build/static/css/main.6676fe1f.chunk.css +0 -2
  85. package/build/static/css/main.6676fe1f.chunk.css.map +0 -1
  86. package/build/static/js/2.d1562c08.chunk.js +0 -3
  87. package/build/static/js/2.d1562c08.chunk.js.LICENSE.txt +0 -133
  88. package/build/static/js/2.d1562c08.chunk.js.map +0 -1
  89. package/build/static/js/main.5c08aba4.chunk.js +0 -2
  90. package/build/static/js/main.5c08aba4.chunk.js.map +0 -1
  91. package/build/static/media/Fill.37094b44.svg +0 -3
  92. package/build/static/media/Montserrat-Bold.5a052e98.otf +0 -0
  93. package/build/static/media/Montserrat-Light.21789e89.otf +0 -0
  94. package/build/static/media/Montserrat-Medium.a53e0373.otf +0 -0
  95. package/build/static/media/Montserrat-Regular.71cdc681.otf +0 -0
  96. package/build/static/media/Montserrat-SemiBold.f613d915.otf +0 -0
  97. package/build/static/media/Rectangle.4dd8b747.png +0 -0
  98. package/build/static/media/admin.9529c7f6.svg +0 -3
  99. package/build/static/media/bg-support-page.6ac55268.svg +0 -9
  100. package/build/static/media/book_mark.8e294c0b.svg +0 -3
  101. package/build/static/media/icon_dislike.94607ca6.svg +0 -3
  102. package/build/static/media/icon_like.a4fb1b18.svg +0 -3
  103. package/build/static/media/icon_modal_image.3068d0ea.svg +0 -21
  104. package/build/static/media/icon_search_image.c2c728c0.svg +0 -3
  105. package/build/static/media/nyris_logo.22d8f250.svg +0 -3
  106. package/build/static/media/reload_icon.4b579a74.svg +0 -3
  107. package/build/static/media/save_search.bebaeebf.svg +0 -3
  108. package/build/static/media/support.289c3a3c.svg +0 -3
  109. package/build/static/media/translate_icon.f0492297.svg +0 -3
  110. package/public/js/settings.example.js +0 -31
  111. package/public/js/test.js +0 -56
  112. package/src/Router.tsx +0 -97
  113. package/src/Store/Auth.ts +0 -44
  114. package/src/Store/Nyris.ts +0 -77
  115. package/src/Store/Search.ts +0 -269
  116. package/src/Store/Store.ts +0 -46
  117. package/src/Store/common.d.ts +0 -10
  118. package/src/common/assets/fonts/Montserrat_OTF/Montserrat-Bold.otf +0 -0
  119. package/src/common/assets/fonts/Montserrat_OTF/Montserrat-Light.otf +0 -0
  120. package/src/common/assets/fonts/Montserrat_OTF/Montserrat-Medium.otf +0 -0
  121. package/src/common/assets/fonts/Montserrat_OTF/Montserrat-Regular.otf +0 -0
  122. package/src/common/assets/fonts/Montserrat_OTF/Montserrat-SemiBold.otf +0 -0
  123. package/src/common/assets/icons/Fill.png +0 -0
  124. package/src/common/assets/icons/Fill.svg +0 -3
  125. package/src/common/assets/icons/Icon_wechat.png +0 -0
  126. package/src/common/assets/icons/Icon_whatsapp.png +0 -0
  127. package/src/common/assets/icons/admin.png +0 -0
  128. package/src/common/assets/icons/admin.svg +0 -3
  129. package/src/common/assets/icons/book_mark.png +0 -0
  130. package/src/common/assets/icons/book_mark.svg +0 -3
  131. package/src/common/assets/icons/icon_barcode.png +0 -0
  132. package/src/common/assets/icons/icon_camera.png +0 -0
  133. package/src/common/assets/icons/icon_dislike.svg +0 -3
  134. package/src/common/assets/icons/icon_disslike.png +0 -0
  135. package/src/common/assets/icons/icon_email.png +0 -0
  136. package/src/common/assets/icons/icon_like.png +0 -0
  137. package/src/common/assets/icons/icon_like.svg +0 -3
  138. package/src/common/assets/icons/icon_modal_image.png +0 -0
  139. package/src/common/assets/icons/icon_modal_image.svg +0 -21
  140. package/src/common/assets/icons/icon_picture.png +0 -0
  141. package/src/common/assets/icons/icon_search_image.png +0 -0
  142. package/src/common/assets/icons/icon_search_image.svg +0 -3
  143. package/src/common/assets/icons/nyris_logo.svg +0 -3
  144. package/src/common/assets/icons/reload_icon.png +0 -0
  145. package/src/common/assets/icons/reload_icon.svg +0 -3
  146. package/src/common/assets/icons/save_search.png +0 -0
  147. package/src/common/assets/icons/save_search.svg +0 -3
  148. package/src/common/assets/icons/setting_search_icon.png +0 -0
  149. package/src/common/assets/icons/support.png +0 -0
  150. package/src/common/assets/icons/support.svg +0 -3
  151. package/src/common/assets/icons/translate_icon.png +0 -0
  152. package/src/common/assets/icons/translate_icon.svg +0 -3
  153. package/src/common/assets/icons/view_off.png +0 -0
  154. package/src/common/assets/images/Rectangle.png +0 -0
  155. package/src/common/assets/images/bg-support-page.svg +0 -9
  156. package/src/common/assets/images/image_test.png +0 -0
  157. package/src/components/CustomHits/index.tsx +0 -57
  158. package/src/components/DetailItem.tsx +0 -175
  159. package/src/components/DragDropFile.tsx +0 -188
  160. package/src/components/FilterComponent.tsx +0 -33
  161. package/src/components/Footer.tsx +0 -29
  162. package/src/components/FooterMD.tsx +0 -54
  163. package/src/components/FooterNewVersion.tsx +0 -12
  164. package/src/components/FooterResult.tsx +0 -47
  165. package/src/components/HeaderMd.tsx +0 -39
  166. package/src/components/HeaderNewVersion.tsx +0 -92
  167. package/src/components/Layout.tsx +0 -46
  168. package/src/components/LoadingScreen/index.tsx +0 -29
  169. package/src/components/Navigation.tsx +0 -34
  170. package/src/components/Panigation/Pagination.tsx +0 -140
  171. package/src/components/Panigation/cx.js +0 -3
  172. package/src/components/Panigation/isModifierClick.js +0 -10
  173. package/src/components/Saved/AllItem.tsx +0 -32
  174. package/src/components/Saved/Category.tsx +0 -16
  175. package/src/components/carousel/DefaultCarousel.tsx +0 -48
  176. package/src/components/common.d.ts +0 -9
  177. package/src/components/common.scss +0 -54
  178. package/src/components/default-select.tsx +0 -44
  179. package/src/components/hitItem/hits.tsx +0 -50
  180. package/src/components/hitItem/infinitiHits.tsx +0 -33
  181. package/src/components/input/inputSearch.tsx +0 -77
  182. package/src/components/modal/DefaultModal.tsx +0 -28
  183. package/src/components/preview/preview.tsx +0 -433
  184. package/src/components/results/ItemResult.tsx +0 -155
  185. package/src/components/search/ListSearch.tsx +0 -209
  186. package/src/modules/LandingPage/common.scss +0 -1304
  187. package/src/modules/LandingPage/indexApp.tsx +0 -492
  188. package/src/modules/LandingPage/indexAppMD.tsx +0 -501
  189. package/src/modules/LandingPage/indexNewVersion.tsx +0 -117
  190. package/src/page/Auth/login.tsx +0 -7
  191. package/src/page/Exception/404.tsx +0 -11
  192. package/src/page/History/index.tsx +0 -76
  193. package/src/page/Profile/index.tsx +0 -87
  194. package/src/page/Saved/MockData.ts +0 -223
  195. package/src/page/Saved/index.tsx +0 -166
  196. package/src/page/Support/index.tsx +0 -160
  197. package/src/page/result/MockData.ts +0 -36
  198. package/src/page/result/index.tsx +0 -473
  199. package/src/services/Feedback.ts +0 -65
  200. package/src/services/findByImage.ts +0 -24
  201. package/src/services/findRegionsCustom.ts +0 -212
  202. package/src/services/image.ts +0 -110
  203. package/src/services/nyris.ts +0 -123
  204. package/src/services/session.ts +0 -20
  205. package/src/services/types.ts +0 -96
@@ -1,92 +0,0 @@
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;
@@ -1,46 +0,0 @@
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;
@@ -1,29 +0,0 @@
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;
@@ -1,34 +0,0 @@
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;
@@ -1,140 +0,0 @@
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
- }
@@ -1,3 +0,0 @@
1
- export function cx(...classNames) {
2
- return classNames.filter(Boolean).join(' ');
3
- }
@@ -1,10 +0,0 @@
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
- }
@@ -1,32 +0,0 @@
1
- import { Grid } from "@material-ui/core";
2
- import ItemResult from "components/results/ItemResult";
3
- import React from "react";
4
-
5
- interface Props {
6
- dataItem: any[];
7
- isHover?: boolean
8
- }
9
-
10
- function AllItem(props: Props) {
11
- const { dataItem } = props;
12
-
13
- return (
14
- <Grid container spacing={2}>
15
- {dataItem &&
16
- dataItem.map((item: any, index: any) => {
17
- return (
18
- <Grid item sm={3} key={index}>
19
- <ItemResult
20
- dataItem={item}
21
- isHover={true}
22
- // handlerToggleModal={handlerToggleModal}
23
- // handlerToggleModalShare={() => setOpenModalShare(true)}
24
- />
25
- </Grid>
26
- );
27
- })}
28
- </Grid>
29
- );
30
- }
31
-
32
- export default AllItem;
@@ -1,16 +0,0 @@
1
- import { Grid } from "@material-ui/core";
2
- import React from "react";
3
-
4
- interface Props {
5
- nameCategory?: string;
6
- }
7
-
8
- function CategoryItemSaved(props: Props) {
9
- return (
10
- <Grid container>
11
- <Grid item xs={4}></Grid>
12
- </Grid>
13
- );
14
- }
15
-
16
- export default CategoryItemSaved;
@@ -1,48 +0,0 @@
1
- import { Box, Button } from "@material-ui/core";
2
- import React from "react";
3
- import { Carousel } from "react-responsive-carousel";
4
- import ChevronRightOutlinedIcon from "@material-ui/icons/ChevronRightOutlined";
5
- import ChevronLeftOutlinedIcon from "@material-ui/icons/ChevronLeftOutlined";
6
- interface Props {
7
- imgItem: any[];
8
- }
9
-
10
- function DefaultCarousel(props: Props) {
11
- const { imgItem } = props;
12
- console.log("imgItem", imgItem);
13
-
14
- return (
15
- <Carousel
16
- showThumbs={false}
17
- infiniteLoop={false}
18
- showStatus={false}
19
- className={imgItem.length > 1 ? "" : "hide-btn-arrow"}
20
- renderArrowNext={(onClickHandler, hasPrev, label) => (
21
- <Button onClick={onClickHandler} className="btn-carousel-right">
22
- <ChevronRightOutlinedIcon
23
- className="icon-ct"
24
- style={{ color: "#55566B" }}
25
- />
26
- </Button>
27
- )}
28
- renderArrowPrev={(onClickHandler, hasPrev, label) => (
29
- <Button onClick={onClickHandler} className="btn-carousel-left">
30
- <ChevronLeftOutlinedIcon
31
- className="icon-ct"
32
- style={{ color: "#55566B" }}
33
- />
34
- </Button>
35
- )}
36
- >
37
- {imgItem?.map((item: any, index: any) => {
38
- return (
39
- <Box key={index} style={{height: '100%'}}>
40
- <img style={{height: '100%'}} src={imgItem ? item?.url : ""} alt="image_product" />
41
- </Box>
42
- );
43
- })}
44
- </Carousel>
45
- );
46
- }
47
-
48
- export default DefaultCarousel;
@@ -1,9 +0,0 @@
1
- type ReactNode =
2
- | ReactChild
3
- | ReactFragment
4
- | ReactPortal
5
- | boolean
6
- | null
7
- | undefined;
8
-
9
- export { ReactNode };
@@ -1,54 +0,0 @@
1
- .layout-main-newVersion {
2
- height: 100vh;
3
- display: flex;
4
- flex-direction: column;
5
- justify-content: space-between;
6
- overflow: hidden;
7
- .box-header-newVersion-main {
8
- height: 32px;
9
- background: #2b2c46;
10
- .box-content {
11
- max-width: 1280px;
12
- margin: auto;
13
- height: 100%;
14
- justify-content: space-between;
15
- align-items: center;
16
- .nav-menu {
17
- width: auto;
18
- color: #fff;
19
- font-family: "Montserrat";
20
- font-weight: bold;
21
- height: 100%;
22
- a {
23
- display: flex;
24
- align-items: center;
25
- height: 100%;
26
- padding: 0 10px;
27
- &.active {
28
- background: #322bb0;
29
- }
30
- }
31
-
32
- span {
33
- color: #fff;
34
- font-size: 11px;
35
- display: flex;
36
- justify-content: center;
37
- align-items: center;
38
- img {
39
- margin-left: 12px;
40
- }
41
- }
42
- .item-nav {
43
- &:last-child {
44
- margin-right: 0px;
45
- }
46
- }
47
- }
48
- }
49
- }
50
- .box-body-newVersion-wrap-main {
51
- height: calc(100% - 32px);
52
- // overflow: auto;
53
- }
54
- }
@@ -1,44 +0,0 @@
1
- import { Box } from "@material-ui/core";
2
- import React, { useEffect, useState } from "react";
3
- import { connectMenu } from "react-instantsearch-dom";
4
-
5
- interface Props {
6
- dataField: any[];
7
- }
8
-
9
- function DefaultSelectCustom({ items, currentRefinement, refine }: any) {
10
- const [valueFilter, setValueFilter] = useState<string>();
11
-
12
- useEffect(() => {
13
- if (!valueFilter) {
14
- return;
15
- }
16
- refine(valueFilter);
17
- }, [valueFilter]);
18
-
19
- return (
20
- <Box className="w-100">
21
- <select
22
- className="w-100 btn-ct"
23
- value={currentRefinement || ""}
24
- onChange={(event: any) => {
25
- setValueFilter(event?.currentTarget.value);
26
- // refine(event.currentTarget.value);
27
- }}
28
- >
29
- <option value="">See all options</option>
30
- {items.map((item: any) => (
31
- <option
32
- key={item.label}
33
- value={item.isRefined ? currentRefinement : item.value}
34
- >
35
- {item.label}
36
- </option>
37
- ))}
38
- </select>
39
- </Box>
40
- );
41
- }
42
- const DefaultSelect = connectMenu(DefaultSelectCustom);
43
-
44
- export default DefaultSelect;
@@ -1,50 +0,0 @@
1
- import React from "react";
2
- import { Hit as AlgoliaHit } from "@algolia/client-search";
3
- import { useHits, UseHitsProps } from "react-instantsearch-hooks";
4
- import { useAppDispatch } from "Store/Store";
5
- import { useEffect } from "react";
6
- import { resultSearchText } from "Store/Search";
7
- import { useState } from "react";
8
- import { CircularProgress } from "@material-ui/core";
9
-
10
- export type HitsProps<THit> = React.ComponentProps<"div"> &
11
- UseHitsProps & {
12
- hitComponent: (props: { hit: THit }) => JSX.Element;
13
- };
14
-
15
- export function Hits<THit extends AlgoliaHit<Record<string, unknown>>>({
16
- hitComponent: Hit,
17
- ...props
18
- }: HitsProps<THit>) {
19
-
20
- const { hits } = useHits(props);
21
- const dispatch = useAppDispatch();
22
- const [isLoading, setLoading] = useState<boolean>(false);
23
-
24
- useEffect(() => {
25
- setLoading(true);
26
- setTimeout(() => {
27
- setLoading(false);
28
- }, 1000);
29
- }, []);
30
-
31
- useEffect(() => {
32
- if (hits?.length > 0) {
33
- dispatch(resultSearchText(hits));
34
- }
35
- }, []);
36
-
37
- return (
38
- <>
39
- {isLoading ? (
40
- <CircularProgress />
41
- ) : (
42
- <>
43
- {hits.map((hit: any, index: any) => (
44
- <Hit key={index} hit={hit as unknown as THit} />
45
- ))}
46
- </>
47
- )}
48
- </>
49
- );
50
- }
@@ -1,33 +0,0 @@
1
- import { Grid } from "@material-ui/core";
2
- import ItemResult from "components/results/ItemResult";
3
- import React from "react";
4
- import {
5
- useInfiniteHits,
6
- UseInfiniteHitsProps,
7
- } from "react-instantsearch-hooks";
8
-
9
- function InfiniteHits(props: any) {
10
- const { hits, isLastPage, showMore } = useInfiniteHits(props);
11
- console.log("props", useInfiniteHits(props));
12
-
13
- return (
14
- <>
15
- {hits.map((hit: any, index: any) => {
16
- return (
17
- <Grid item xs={3}>
18
- <ItemResult
19
- dataItem={hit?.hit}
20
- // handlerToggleModal={() => {
21
- // handlerToggleModal(hit?.hit);
22
- // }}
23
- // handlerToggleModalShare={() => setOpenModalShare(true)}
24
- // indexItem={hit.__position}
25
- />
26
- </Grid>
27
- );
28
- })}
29
- </>
30
- );
31
- }
32
-
33
- export default InfiniteHits;