@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.
- package/build/asset-manifest.json +32 -18
- package/build/index.html +1 -1
- package/build/js/test.js +62 -0
- package/build/{precache-manifest.497998bf0df450969bab5608621be10a.js → precache-manifest.8f85a4fff2063a7498a608ec69549bb1.js} +89 -13
- package/build/service-worker.js +1 -1
- package/build/static/css/2.8285176a.chunk.css +2 -0
- package/build/static/css/2.8285176a.chunk.css.map +1 -0
- package/build/static/css/main.6676fe1f.chunk.css +2 -0
- package/build/static/css/main.6676fe1f.chunk.css.map +1 -0
- package/build/static/js/2.efc0ab83.chunk.js +3 -0
- package/build/static/js/2.efc0ab83.chunk.js.LICENSE.txt +133 -0
- package/build/static/js/2.efc0ab83.chunk.js.map +1 -0
- package/build/static/js/main.3bfed050.chunk.js +2 -0
- package/build/static/js/main.3bfed050.chunk.js.map +1 -0
- package/build/static/js/{runtime-main.f5553a9b.js → runtime-main.b418ff16.js} +1 -1
- package/build/static/js/{runtime-main.f5553a9b.js.map → runtime-main.b418ff16.js.map} +1 -1
- package/build/static/media/Fill.37094b44.svg +3 -0
- package/build/static/media/Montserrat-Bold.5a052e98.otf +0 -0
- package/build/static/media/Montserrat-Light.21789e89.otf +0 -0
- package/build/static/media/Montserrat-Medium.a53e0373.otf +0 -0
- package/build/static/media/Montserrat-Regular.71cdc681.otf +0 -0
- package/build/static/media/Montserrat-SemiBold.f613d915.otf +0 -0
- package/build/static/media/Rectangle.4dd8b747.png +0 -0
- package/build/static/media/admin.9529c7f6.svg +3 -0
- package/build/static/media/bg-support-page.6ac55268.svg +9 -0
- package/build/static/media/book_mark.8e294c0b.svg +3 -0
- package/build/static/media/icon_dislike.94607ca6.svg +3 -0
- package/build/static/media/icon_like.a4fb1b18.svg +3 -0
- package/build/static/media/icon_modal_image.3068d0ea.svg +21 -0
- package/build/static/media/icon_search_image.c2c728c0.svg +3 -0
- package/build/static/media/nyris_logo.22d8f250.svg +3 -0
- package/build/static/media/reload_icon.4b579a74.svg +3 -0
- package/build/static/media/save_search.bebaeebf.svg +3 -0
- package/build/static/media/support.289c3a3c.svg +3 -0
- package/build/static/media/translate_icon.f0492297.svg +3 -0
- package/package.json +30 -6
- package/public/js/test.js +62 -0
- package/src/App.css +27 -11
- package/src/App.tsx +19 -235
- package/src/Router.tsx +97 -0
- package/src/Store/Auth.ts +44 -0
- package/src/Store/Nyris.ts +77 -0
- package/src/Store/Search.ts +269 -0
- package/src/Store/Store.ts +46 -0
- package/src/Store/common.d.ts +10 -0
- package/src/{epics → Store/epics}/feedback.ts +0 -0
- package/src/{epics → Store/epics}/types.ts +1 -1
- package/src/common/assets/fonts/Montserrat_OTF/Montserrat-Bold.otf +0 -0
- package/src/common/assets/fonts/Montserrat_OTF/Montserrat-Light.otf +0 -0
- package/src/common/assets/fonts/Montserrat_OTF/Montserrat-Medium.otf +0 -0
- package/src/common/assets/fonts/Montserrat_OTF/Montserrat-Regular.otf +0 -0
- package/src/common/assets/fonts/Montserrat_OTF/Montserrat-SemiBold.otf +0 -0
- package/src/{fonts → common/assets/fonts}/roboto-bold-webfont.woff +0 -0
- package/src/{fonts → common/assets/fonts}/roboto-bold-webfont.woff2 +0 -0
- package/src/{fonts → common/assets/fonts}/roboto-italic-webfont.woff +0 -0
- package/src/{fonts → common/assets/fonts}/roboto-italic-webfont.woff2 +0 -0
- package/src/{fonts → common/assets/fonts}/roboto-regular-webfont.woff +0 -0
- package/src/{fonts → common/assets/fonts}/roboto-regular-webfont.woff2 +0 -0
- package/src/{fonts → common/assets/fonts}/robotocondensed-bold-webfont.woff +0 -0
- package/src/{fonts → common/assets/fonts}/robotocondensed-bold-webfont.woff2 +0 -0
- package/src/{fonts → common/assets/fonts}/robotocondensed-bolditalic-webfont.woff +0 -0
- package/src/{fonts → common/assets/fonts}/robotocondensed-bolditalic-webfont.woff2 +0 -0
- package/src/common/assets/icons/Fill.png +0 -0
- package/src/common/assets/icons/Fill.svg +3 -0
- package/src/common/assets/icons/Icon_wechat.png +0 -0
- package/src/common/assets/icons/Icon_whatsapp.png +0 -0
- package/src/common/assets/icons/admin.png +0 -0
- package/src/common/assets/icons/admin.svg +3 -0
- package/src/common/assets/icons/book_mark.png +0 -0
- package/src/common/assets/icons/book_mark.svg +3 -0
- package/src/common/assets/icons/icon_barcode.png +0 -0
- package/src/common/assets/icons/icon_camera.png +0 -0
- package/src/common/assets/icons/icon_dislike.svg +3 -0
- package/src/common/assets/icons/icon_disslike.png +0 -0
- package/src/common/assets/icons/icon_email.png +0 -0
- package/src/common/assets/icons/icon_like.png +0 -0
- package/src/common/assets/icons/icon_like.svg +3 -0
- package/src/common/assets/icons/icon_modal_image.png +0 -0
- package/src/common/assets/icons/icon_modal_image.svg +21 -0
- package/src/common/assets/icons/icon_picture.png +0 -0
- package/src/common/assets/icons/icon_search_image.png +0 -0
- package/src/common/assets/icons/icon_search_image.svg +3 -0
- package/src/common/assets/icons/nyris_logo.svg +3 -0
- package/src/common/assets/icons/reload_icon.png +0 -0
- package/src/common/assets/icons/reload_icon.svg +3 -0
- package/src/common/assets/icons/save_search.png +0 -0
- package/src/common/assets/icons/save_search.svg +3 -0
- package/src/common/assets/icons/setting_search_icon.png +0 -0
- package/src/common/assets/icons/support.png +0 -0
- package/src/common/assets/icons/support.svg +3 -0
- package/src/common/assets/icons/translate_icon.png +0 -0
- package/src/common/assets/icons/translate_icon.svg +3 -0
- package/src/common/assets/icons/view_off.png +0 -0
- package/src/common/assets/images/Rectangle.png +0 -0
- package/src/common/assets/images/bg-support-page.svg +9 -0
- package/src/{images → common/assets/images}/fav/android-icon-192x192.png +0 -0
- package/src/{images → common/assets/images}/fav/apple-icon-114x114.png +0 -0
- package/src/{images → common/assets/images}/fav/apple-icon-120x120.png +0 -0
- package/src/{images → common/assets/images}/fav/apple-icon-144x144.png +0 -0
- package/src/{images → common/assets/images}/fav/apple-icon-152x152.png +0 -0
- package/src/{images → common/assets/images}/fav/apple-icon-180x180.png +0 -0
- package/src/{images → common/assets/images}/fav/apple-icon-57x57.png +0 -0
- package/src/{images → common/assets/images}/fav/apple-icon-60x60.png +0 -0
- package/src/{images → common/assets/images}/fav/apple-icon-72x72.png +0 -0
- package/src/{images → common/assets/images}/fav/apple-icon-76x76.png +0 -0
- package/src/{images → common/assets/images}/fav/browserconfig.xml +0 -0
- package/src/{images → common/assets/images}/fav/favicon-16x16.png +0 -0
- package/src/{images → common/assets/images}/fav/favicon-32x32.png +0 -0
- package/src/{images → common/assets/images}/fav/favicon-96x96.png +0 -0
- package/src/{images → common/assets/images}/fav/manifest.json +0 -0
- package/src/{images → common/assets/images}/ic_cam.png +0 -0
- package/src/{images → common/assets/images}/ic_cam.svg +0 -0
- package/src/{images → common/assets/images}/ic_cam_large.png +0 -0
- package/src/{images → common/assets/images}/ic_cam_large.svg +0 -0
- package/src/{images → common/assets/images}/ic_cam_large_noimage.png +0 -0
- package/src/{images → common/assets/images}/ic_close_feedback.png +0 -0
- package/src/{images → common/assets/images}/ic_close_feedback.svg +0 -0
- package/src/{images → common/assets/images}/ic_shopNow.png +0 -0
- package/src/{images → common/assets/images}/ic_shopNow.svg +0 -0
- package/src/{images → common/assets/images}/ic_shopNowLight.png +0 -0
- package/src/{images → common/assets/images}/ic_shopNowLight.svg +0 -0
- package/src/common/assets/images/image_test.png +0 -0
- package/src/{images → common/assets/images}/nyris_logo.png +0 -0
- package/src/{images → common/assets/images}/rewe.svg +0 -0
- package/src/{images → common/assets/images}/sectionTransBack.png +0 -0
- package/src/{images → common/assets/images}/sectionTransBack.svg +0 -0
- package/src/{images → common/assets/images}/sectionTransTop.png +0 -0
- package/src/{images → common/assets/images}/sectionTransTop.svg +0 -0
- package/src/components/DetailItem.tsx +175 -0
- package/src/components/DragDropFile.tsx +188 -0
- package/src/components/ExampleImages.tsx +32 -17
- package/src/components/Feedback.tsx +87 -48
- package/src/components/FilterComponent.tsx +33 -0
- package/src/components/Footer.tsx +29 -0
- package/src/components/FooterMD.tsx +54 -0
- package/src/components/FooterNewVersion.tsx +12 -0
- package/src/components/FooterResult.tsx +47 -0
- package/src/components/Header.tsx +35 -0
- package/src/components/HeaderMd.tsx +39 -0
- package/src/components/HeaderNewVersion.tsx +92 -0
- package/src/components/Layout.tsx +46 -0
- package/src/components/LoadingScreen/index.tsx +29 -0
- package/src/components/Navigation.tsx +34 -0
- package/src/components/Panigation/Pagination.tsx +140 -0
- package/src/components/Panigation/cx.js +3 -0
- package/src/components/Panigation/isModifierClick.js +10 -0
- package/src/components/Result.tsx +186 -113
- package/src/components/Saved/AllItem.tsx +32 -0
- package/src/components/Saved/Category.tsx +16 -0
- package/src/components/carousel/DefaultCarousel.tsx +48 -0
- package/src/components/common.d.ts +9 -0
- package/src/components/common.scss +54 -0
- package/src/components/default-select.tsx +44 -0
- package/src/components/hitItem/hits.tsx +50 -0
- package/src/components/hitItem/infinitiHits.tsx +33 -0
- package/src/components/input/inputSearch.tsx +77 -0
- package/src/components/modal/DefaultModal.tsx +28 -0
- package/src/components/preview/preview.tsx +433 -0
- package/src/components/results/ItemResult.tsx +155 -0
- package/src/components/search/ListSearch.tsx +209 -0
- package/src/defaults.ts +4 -3
- package/src/index.css +577 -306
- package/src/index.tsx +39 -187
- package/src/modules/LandingPage/common.scss +1304 -0
- package/src/modules/LandingPage/indexApp.tsx +474 -0
- package/src/modules/LandingPage/indexAppMD.tsx +494 -0
- package/src/modules/LandingPage/indexNewVersion.tsx +117 -0
- package/src/page/Auth/login.tsx +7 -0
- package/src/page/Exception/404.tsx +11 -0
- package/src/page/History/index.tsx +76 -0
- package/src/page/Profile/index.tsx +87 -0
- package/src/page/Saved/MockData.ts +223 -0
- package/src/page/Saved/index.tsx +166 -0
- package/src/page/Support/index.tsx +160 -0
- package/src/page/result/MockData.ts +36 -0
- package/src/page/result/index.tsx +473 -0
- package/src/services/Feedback.ts +65 -0
- package/src/services/findByImage.ts +24 -0
- package/src/services/findRegionsCustom.ts +212 -0
- package/src/services/image.ts +110 -0
- package/src/services/nyris.ts +123 -0
- package/src/services/session.ts +20 -0
- package/src/services/types.ts +96 -0
- package/src/types.ts +43 -3
- package/tsconfig.json +3 -8
- package/build/static/css/2.43a1c8b7.chunk.css +0 -2
- package/build/static/css/2.43a1c8b7.chunk.css.map +0 -1
- package/build/static/css/main.f6ed5f12.chunk.css +0 -2
- package/build/static/css/main.f6ed5f12.chunk.css.map +0 -1
- package/build/static/js/2.a591d52a.chunk.js +0 -3
- package/build/static/js/2.a591d52a.chunk.js.LICENSE.txt +0 -79
- package/build/static/js/2.a591d52a.chunk.js.map +0 -1
- package/build/static/js/main.28bb3581.chunk.js +0 -2
- package/build/static/js/main.28bb3581.chunk.js.map +0 -1
- package/src/AppMD.tsx +0 -320
- package/src/actions/nyrisAppActions.ts +0 -76
- package/src/actions/searchActions.ts +0 -143
- package/src/epics/index.ts +0 -149
- package/src/epics/search.ts +0 -114
|
@@ -1,137 +1,210 @@
|
|
|
1
|
-
import React from
|
|
2
|
-
import {OfferNyrisResult as ResultData} from "@nyris/nyris-api";
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { OfferNyrisResult as ResultData } from "@nyris/nyris-api";
|
|
3
3
|
|
|
4
4
|
// TODO this needs refactoring: Make it one block with parameters for first line, second line, image url ..
|
|
5
5
|
|
|
6
6
|
interface Options {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
7
|
+
result: any;
|
|
8
|
+
noImageUrl: string;
|
|
9
|
+
onImageClick: (e: React.MouseEvent) => void;
|
|
10
|
+
onLinkClick: (e: React.MouseEvent) => void;
|
|
11
11
|
}
|
|
12
12
|
|
|
13
13
|
const renderPrice = (result: ResultData) =>
|
|
14
|
-
|
|
14
|
+
result.p ? "" + (result.p.vi / 100).toFixed(2) + " " + result.p.c : "";
|
|
15
15
|
|
|
16
|
-
const renderDefault = ({
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
<div className="imgWrap">
|
|
24
|
-
<img src={(result.img && result.img.url + '?r=512x512') || noImageUrl} alt={result.title}/>
|
|
25
|
-
</div>
|
|
26
|
-
</div>
|
|
27
|
-
</a>
|
|
28
|
-
<div className="prdctDetailsWrap">
|
|
29
|
-
<div>
|
|
30
|
-
<div className="prdctTitle">{result.title}</div>
|
|
31
|
-
<div className="prdctMeta">
|
|
32
|
-
<span className="prdctPrice">{renderPrice(result)}</span>
|
|
33
|
-
</div>
|
|
34
|
-
<a onClick={onLinkClick} onAuxClick={onLinkClick} className="prdctShopLink" href={result.l}
|
|
35
|
-
target="_blank" rel="noopener noreferrer">Buy Now</a>
|
|
36
|
-
</div>
|
|
37
|
-
</div>
|
|
38
|
-
</>
|
|
39
|
-
);
|
|
40
|
-
};
|
|
41
|
-
|
|
42
|
-
const renderSnr = ({result, noImageUrl, onImageClick, onLinkClick}: Options) => (
|
|
16
|
+
const renderDefault = ({
|
|
17
|
+
result,
|
|
18
|
+
noImageUrl,
|
|
19
|
+
onImageClick,
|
|
20
|
+
onLinkClick,
|
|
21
|
+
}: Options) => {
|
|
22
|
+
return (
|
|
43
23
|
<>
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
<div className="
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
24
|
+
<a
|
|
25
|
+
href={result.l}
|
|
26
|
+
className="imageLink"
|
|
27
|
+
title="Click the image so see similar products"
|
|
28
|
+
onClick={onImageClick}
|
|
29
|
+
onAuxClick={onLinkClick}
|
|
30
|
+
>
|
|
31
|
+
<div className="prdctImg">
|
|
32
|
+
<div className="imgWrap">
|
|
33
|
+
<img
|
|
34
|
+
src={(result.img && result.img.url + "?r=512x512") || noImageUrl}
|
|
35
|
+
alt={result.title}
|
|
36
|
+
/>
|
|
37
|
+
</div>
|
|
38
|
+
</div>
|
|
39
|
+
</a>
|
|
40
|
+
<div className="prdctDetailsWrap">
|
|
41
|
+
<div>
|
|
42
|
+
<div className="prdctTitle">{result.title}</div>
|
|
43
|
+
<div className="prdctMeta">
|
|
44
|
+
<span className="prdctPrice">{renderPrice(result)}</span>
|
|
45
|
+
</div>
|
|
46
|
+
<a
|
|
47
|
+
onClick={onLinkClick}
|
|
48
|
+
onAuxClick={onLinkClick}
|
|
49
|
+
className="prdctShopLink"
|
|
50
|
+
href={result.l}
|
|
51
|
+
target="_blank"
|
|
52
|
+
rel="noopener noreferrer"
|
|
53
|
+
>
|
|
54
|
+
Buy Now
|
|
55
|
+
</a>
|
|
61
56
|
</div>
|
|
57
|
+
</div>
|
|
62
58
|
</>
|
|
63
|
-
);
|
|
59
|
+
);
|
|
60
|
+
};
|
|
64
61
|
|
|
65
|
-
const
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
62
|
+
const renderSnr = ({
|
|
63
|
+
result,
|
|
64
|
+
noImageUrl,
|
|
65
|
+
onImageClick,
|
|
66
|
+
onLinkClick,
|
|
67
|
+
}: Options) => (
|
|
68
|
+
<>
|
|
69
|
+
<a
|
|
70
|
+
href={result.l}
|
|
71
|
+
className="imageLink"
|
|
72
|
+
onClick={onImageClick}
|
|
73
|
+
onAuxClick={onLinkClick}
|
|
74
|
+
>
|
|
75
|
+
<div className="prdctImg">
|
|
76
|
+
<div className="imgWrap">
|
|
77
|
+
<img
|
|
78
|
+
src={(result.img && result.img.url + "?r=512x512") || noImageUrl}
|
|
79
|
+
alt={result.title}
|
|
80
|
+
/>
|
|
81
|
+
</div>
|
|
82
|
+
</div>
|
|
83
|
+
</a>
|
|
84
|
+
<div className="prdctDetailsWrap">
|
|
85
|
+
<div>
|
|
86
|
+
<div className="prdctTitle">{result.sku}</div>
|
|
87
|
+
<div
|
|
88
|
+
className="prdctMeta"
|
|
89
|
+
style={{ height: "5em", whiteSpace: "normal" }}
|
|
90
|
+
>
|
|
91
|
+
{result.title}
|
|
92
|
+
</div>
|
|
93
|
+
<a
|
|
94
|
+
style={{ backgroundImage: "none", paddingLeft: "10px" }}
|
|
95
|
+
className="prdctShopLink"
|
|
96
|
+
href={result.l}
|
|
97
|
+
target="_blank"
|
|
98
|
+
rel="noopener noreferrer"
|
|
99
|
+
onClick={onLinkClick}
|
|
100
|
+
onAuxClick={onLinkClick}
|
|
101
|
+
>
|
|
102
|
+
Info
|
|
74
103
|
</a>
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
104
|
+
</div>
|
|
105
|
+
</div>
|
|
106
|
+
</>
|
|
107
|
+
);
|
|
108
|
+
|
|
109
|
+
const renderSnrMultilink = (
|
|
110
|
+
{ result, noImageUrl, onImageClick }: Options,
|
|
111
|
+
onLinkClick: (url: string) => void
|
|
112
|
+
) => (
|
|
113
|
+
<>
|
|
114
|
+
<a
|
|
115
|
+
href={result.l}
|
|
116
|
+
className="imageLink"
|
|
117
|
+
onClick={onImageClick}
|
|
118
|
+
onAuxClick={onImageClick}
|
|
119
|
+
>
|
|
120
|
+
<div className="prdctImg">
|
|
121
|
+
<div className="imgWrap">
|
|
122
|
+
<img
|
|
123
|
+
src={(result.img && result.img.url + "?r=512x512") || noImageUrl}
|
|
124
|
+
alt={result.title}
|
|
125
|
+
/>
|
|
88
126
|
</div>
|
|
89
|
-
|
|
127
|
+
</div>
|
|
128
|
+
</a>
|
|
129
|
+
<div className="prdctDetailsWrap">
|
|
130
|
+
<div>
|
|
131
|
+
<div className="prdctTitle">{result.sku}</div>
|
|
132
|
+
<div
|
|
133
|
+
className="prdctMeta"
|
|
134
|
+
style={{ height: "5em", whiteSpace: "normal" }}
|
|
135
|
+
>
|
|
136
|
+
{result.title}
|
|
137
|
+
</div>
|
|
138
|
+
{result.l.map((l: { text: string; href: string }) => (
|
|
139
|
+
<a
|
|
140
|
+
style={{ backgroundImage: "none", paddingLeft: "10px" }}
|
|
141
|
+
className="prdctShopLink"
|
|
142
|
+
href={l.href}
|
|
143
|
+
onClick={() => onLinkClick(l.href)}
|
|
144
|
+
onAuxClick={() => onLinkClick(l.href)}
|
|
145
|
+
target="_blank"
|
|
146
|
+
key={l.href}
|
|
147
|
+
rel="noopener noreferrer"
|
|
148
|
+
>
|
|
149
|
+
{l.text}
|
|
150
|
+
</a>
|
|
151
|
+
))}
|
|
152
|
+
</div>
|
|
153
|
+
</div>
|
|
154
|
+
</>
|
|
90
155
|
);
|
|
91
156
|
|
|
92
157
|
export interface ResultProps {
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
158
|
+
result: any;
|
|
159
|
+
style: any;
|
|
160
|
+
template?: string;
|
|
161
|
+
onImageClick: (pos: number, url: string) => void;
|
|
162
|
+
onLinkClick: (pos: number, url: string) => void;
|
|
163
|
+
noImageUrl?: string;
|
|
99
164
|
}
|
|
100
165
|
|
|
101
|
-
const Result: React.FC<ResultProps> = ({
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
}
|
|
166
|
+
const Result: React.FC<ResultProps> = ({
|
|
167
|
+
result,
|
|
168
|
+
style,
|
|
169
|
+
template,
|
|
170
|
+
onImageClick,
|
|
171
|
+
onLinkClick,
|
|
172
|
+
noImageUrl,
|
|
173
|
+
}) => {
|
|
174
|
+
let options: Options = {
|
|
175
|
+
onImageClick: (e: React.MouseEvent) => {
|
|
176
|
+
e.preventDefault();
|
|
177
|
+
onImageClick(result.position, result.img.url);
|
|
178
|
+
},
|
|
179
|
+
onLinkClick: (e: React.MouseEvent) => {
|
|
180
|
+
e.preventDefault();
|
|
181
|
+
onLinkClick(result.position, result.l);
|
|
182
|
+
},
|
|
183
|
+
noImageUrl: noImageUrl || "images/ic_cam_large_noimage.png",
|
|
184
|
+
result,
|
|
185
|
+
};
|
|
114
186
|
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
187
|
+
let resultInner = null;
|
|
188
|
+
switch (template) {
|
|
189
|
+
case "snr":
|
|
190
|
+
resultInner = renderSnr(options);
|
|
191
|
+
break;
|
|
192
|
+
case "snr-multilink":
|
|
193
|
+
resultInner = renderSnrMultilink(options, (url) =>
|
|
194
|
+
onLinkClick(result.position, url)
|
|
195
|
+
);
|
|
196
|
+
break;
|
|
197
|
+
case "default":
|
|
198
|
+
default:
|
|
199
|
+
resultInner = renderDefault(options);
|
|
200
|
+
break;
|
|
201
|
+
}
|
|
128
202
|
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
203
|
+
return (
|
|
204
|
+
<div className="prdctItem" style={{ ...style }}>
|
|
205
|
+
{resultInner}
|
|
206
|
+
</div>
|
|
207
|
+
);
|
|
134
208
|
};
|
|
135
209
|
|
|
136
|
-
|
|
137
210
|
export default Result;
|
|
@@ -0,0 +1,32 @@
|
|
|
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;
|
|
@@ -0,0 +1,16 @@
|
|
|
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;
|
|
@@ -0,0 +1,48 @@
|
|
|
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;
|
|
@@ -0,0 +1,54 @@
|
|
|
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
|
+
}
|
|
@@ -0,0 +1,44 @@
|
|
|
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;
|
|
@@ -0,0 +1,50 @@
|
|
|
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
|
+
}
|
|
@@ -0,0 +1,33 @@
|
|
|
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;
|