@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.
- package/build/asset-manifest.json +18 -32
- package/build/index.html +1 -1
- package/build/{precache-manifest.01ce682577e62add75aa397b2a944b75.js → precache-manifest.bffed513ca17d8ac16af1cc3aaa7d908.js} +13 -89
- package/build/service-worker.js +1 -1
- package/build/static/css/2.43a1c8b7.chunk.css +2 -0
- package/build/static/css/2.43a1c8b7.chunk.css.map +1 -0
- package/build/static/css/main.2a76dc8a.chunk.css +2 -0
- package/build/static/css/main.2a76dc8a.chunk.css.map +1 -0
- package/build/static/js/2.4e9a4ce1.chunk.js +3 -0
- package/build/static/js/2.4e9a4ce1.chunk.js.LICENSE.txt +79 -0
- package/build/static/js/2.4e9a4ce1.chunk.js.map +1 -0
- package/build/static/js/main.ec93aa4d.chunk.js +2 -0
- package/build/static/js/main.ec93aa4d.chunk.js.map +1 -0
- package/build/static/js/{runtime-main.b418ff16.js → runtime-main.f5553a9b.js} +1 -1
- package/build/static/js/{runtime-main.b418ff16.js.map → runtime-main.f5553a9b.js.map} +1 -1
- package/package.json +7 -30
- package/src/App.css +64 -20
- package/src/App.tsx +253 -19
- package/src/AppMD.tsx +320 -0
- package/src/Demo2.tsx +220 -0
- package/src/actions/nyrisAppActions.ts +76 -0
- package/src/actions/searchActions.ts +218 -0
- package/src/components/ExampleImages.tsx +17 -32
- package/src/components/Feedback.tsx +48 -87
- package/src/components/FiltersList.tsx +69 -0
- package/src/components/Header.tsx +17 -32
- package/src/components/Result.tsx +113 -186
- package/src/components/Sidebar.tsx +40 -0
- package/src/defaults.ts +3 -4
- package/src/{Store/epics → epics}/feedback.ts +0 -0
- package/src/epics/index.ts +154 -0
- package/src/epics/search.ts +203 -0
- package/src/{Store/epics → epics}/types.ts +1 -1
- package/src/{common/assets/fonts → fonts}/roboto-bold-webfont.woff +0 -0
- package/src/{common/assets/fonts → fonts}/roboto-bold-webfont.woff2 +0 -0
- package/src/{common/assets/fonts → fonts}/roboto-italic-webfont.woff +0 -0
- package/src/{common/assets/fonts → fonts}/roboto-italic-webfont.woff2 +0 -0
- package/src/{common/assets/fonts → fonts}/roboto-regular-webfont.woff +0 -0
- package/src/{common/assets/fonts → fonts}/roboto-regular-webfont.woff2 +0 -0
- package/src/{common/assets/fonts → fonts}/robotocondensed-bold-webfont.woff +0 -0
- package/src/{common/assets/fonts → fonts}/robotocondensed-bold-webfont.woff2 +0 -0
- package/src/{common/assets/fonts → fonts}/robotocondensed-bolditalic-webfont.woff +0 -0
- package/src/{common/assets/fonts → fonts}/robotocondensed-bolditalic-webfont.woff2 +0 -0
- package/src/{common/assets/images → images}/fav/android-icon-192x192.png +0 -0
- package/src/{common/assets/images → images}/fav/apple-icon-114x114.png +0 -0
- package/src/{common/assets/images → images}/fav/apple-icon-120x120.png +0 -0
- package/src/{common/assets/images → images}/fav/apple-icon-144x144.png +0 -0
- package/src/{common/assets/images → images}/fav/apple-icon-152x152.png +0 -0
- package/src/{common/assets/images → images}/fav/apple-icon-180x180.png +0 -0
- package/src/{common/assets/images → images}/fav/apple-icon-57x57.png +0 -0
- package/src/{common/assets/images → images}/fav/apple-icon-60x60.png +0 -0
- package/src/{common/assets/images → images}/fav/apple-icon-72x72.png +0 -0
- package/src/{common/assets/images → images}/fav/apple-icon-76x76.png +0 -0
- package/src/{common/assets/images → images}/fav/browserconfig.xml +0 -0
- package/src/{common/assets/images → images}/fav/favicon-16x16.png +0 -0
- package/src/{common/assets/images → images}/fav/favicon-32x32.png +0 -0
- package/src/{common/assets/images → images}/fav/favicon-96x96.png +0 -0
- package/src/{common/assets/images → images}/fav/manifest.json +0 -0
- package/src/{common/assets/images → images}/ic_cam.png +0 -0
- package/src/{common/assets/images → images}/ic_cam.svg +0 -0
- package/src/{common/assets/images → images}/ic_cam_large.png +0 -0
- package/src/{common/assets/images → images}/ic_cam_large.svg +0 -0
- package/src/{common/assets/images → images}/ic_cam_large_noimage.png +0 -0
- package/src/{common/assets/images → images}/ic_close_feedback.png +0 -0
- package/src/{common/assets/images → images}/ic_close_feedback.svg +0 -0
- package/src/{common/assets/images → images}/ic_shopNow.png +0 -0
- package/src/{common/assets/images → images}/ic_shopNow.svg +0 -0
- package/src/{common/assets/images → images}/ic_shopNowLight.png +0 -0
- package/src/{common/assets/images → images}/ic_shopNowLight.svg +0 -0
- package/src/{common/assets/images → images}/nyris_logo.png +0 -0
- package/src/{common/assets/images → images}/rewe.svg +0 -0
- package/src/{common/assets/images → images}/sectionTransBack.png +0 -0
- package/src/{common/assets/images → images}/sectionTransBack.svg +0 -0
- package/src/{common/assets/images → images}/sectionTransTop.png +0 -0
- package/src/{common/assets/images → images}/sectionTransTop.svg +0 -0
- package/src/index.css +416 -573
- package/src/index.tsx +190 -39
- package/src/types.ts +3 -43
- package/tsconfig.json +8 -3
- package/build/js/settings.example.js +0 -31
- package/build/js/test.js +0 -56
- package/build/static/css/2.8285176a.chunk.css +0 -2
- package/build/static/css/2.8285176a.chunk.css.map +0 -1
- package/build/static/css/main.6676fe1f.chunk.css +0 -2
- package/build/static/css/main.6676fe1f.chunk.css.map +0 -1
- package/build/static/js/2.d1562c08.chunk.js +0 -3
- package/build/static/js/2.d1562c08.chunk.js.LICENSE.txt +0 -133
- package/build/static/js/2.d1562c08.chunk.js.map +0 -1
- package/build/static/js/main.5c08aba4.chunk.js +0 -2
- package/build/static/js/main.5c08aba4.chunk.js.map +0 -1
- package/build/static/media/Fill.37094b44.svg +0 -3
- 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 +0 -3
- package/build/static/media/bg-support-page.6ac55268.svg +0 -9
- package/build/static/media/book_mark.8e294c0b.svg +0 -3
- package/build/static/media/icon_dislike.94607ca6.svg +0 -3
- package/build/static/media/icon_like.a4fb1b18.svg +0 -3
- package/build/static/media/icon_modal_image.3068d0ea.svg +0 -21
- package/build/static/media/icon_search_image.c2c728c0.svg +0 -3
- package/build/static/media/nyris_logo.22d8f250.svg +0 -3
- package/build/static/media/reload_icon.4b579a74.svg +0 -3
- package/build/static/media/save_search.bebaeebf.svg +0 -3
- package/build/static/media/support.289c3a3c.svg +0 -3
- package/build/static/media/translate_icon.f0492297.svg +0 -3
- package/public/js/settings.example.js +0 -31
- package/public/js/test.js +0 -56
- package/src/Router.tsx +0 -97
- package/src/Store/Auth.ts +0 -44
- package/src/Store/Nyris.ts +0 -77
- package/src/Store/Search.ts +0 -269
- package/src/Store/Store.ts +0 -46
- package/src/Store/common.d.ts +0 -10
- 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/common/assets/icons/Fill.png +0 -0
- package/src/common/assets/icons/Fill.svg +0 -3
- 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 +0 -3
- package/src/common/assets/icons/book_mark.png +0 -0
- package/src/common/assets/icons/book_mark.svg +0 -3
- 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 +0 -3
- 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 +0 -3
- package/src/common/assets/icons/icon_modal_image.png +0 -0
- package/src/common/assets/icons/icon_modal_image.svg +0 -21
- 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 +0 -3
- package/src/common/assets/icons/nyris_logo.svg +0 -3
- package/src/common/assets/icons/reload_icon.png +0 -0
- package/src/common/assets/icons/reload_icon.svg +0 -3
- package/src/common/assets/icons/save_search.png +0 -0
- package/src/common/assets/icons/save_search.svg +0 -3
- 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 +0 -3
- package/src/common/assets/icons/translate_icon.png +0 -0
- package/src/common/assets/icons/translate_icon.svg +0 -3
- 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 +0 -9
- package/src/common/assets/images/image_test.png +0 -0
- package/src/components/CustomHits/index.tsx +0 -57
- package/src/components/DetailItem.tsx +0 -175
- package/src/components/DragDropFile.tsx +0 -188
- package/src/components/FilterComponent.tsx +0 -33
- package/src/components/Footer.tsx +0 -29
- package/src/components/FooterMD.tsx +0 -54
- package/src/components/FooterNewVersion.tsx +0 -12
- package/src/components/FooterResult.tsx +0 -47
- package/src/components/HeaderMd.tsx +0 -39
- package/src/components/HeaderNewVersion.tsx +0 -92
- package/src/components/Layout.tsx +0 -46
- package/src/components/LoadingScreen/index.tsx +0 -29
- package/src/components/Navigation.tsx +0 -34
- package/src/components/Panigation/Pagination.tsx +0 -140
- package/src/components/Panigation/cx.js +0 -3
- package/src/components/Panigation/isModifierClick.js +0 -10
- package/src/components/Saved/AllItem.tsx +0 -32
- package/src/components/Saved/Category.tsx +0 -16
- package/src/components/carousel/DefaultCarousel.tsx +0 -48
- package/src/components/common.d.ts +0 -9
- package/src/components/common.scss +0 -54
- package/src/components/default-select.tsx +0 -44
- package/src/components/hitItem/hits.tsx +0 -50
- package/src/components/hitItem/infinitiHits.tsx +0 -33
- package/src/components/input/inputSearch.tsx +0 -77
- package/src/components/modal/DefaultModal.tsx +0 -28
- package/src/components/preview/preview.tsx +0 -433
- package/src/components/results/ItemResult.tsx +0 -155
- package/src/components/search/ListSearch.tsx +0 -209
- package/src/modules/LandingPage/common.scss +0 -1304
- package/src/modules/LandingPage/indexApp.tsx +0 -492
- package/src/modules/LandingPage/indexAppMD.tsx +0 -501
- package/src/modules/LandingPage/indexNewVersion.tsx +0 -117
- package/src/page/Auth/login.tsx +0 -7
- package/src/page/Exception/404.tsx +0 -11
- package/src/page/History/index.tsx +0 -76
- package/src/page/Profile/index.tsx +0 -87
- package/src/page/Saved/MockData.ts +0 -223
- package/src/page/Saved/index.tsx +0 -166
- package/src/page/Support/index.tsx +0 -160
- package/src/page/result/MockData.ts +0 -36
- package/src/page/result/index.tsx +0 -473
- package/src/services/Feedback.ts +0 -65
- package/src/services/findByImage.ts +0 -24
- package/src/services/findRegionsCustom.ts +0 -212
- package/src/services/image.ts +0 -110
- package/src/services/nyris.ts +0 -123
- package/src/services/session.ts +0 -20
- package/src/services/types.ts +0 -96
|
Binary file
|
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
import PropTypes from "prop-types";
|
|
3
|
-
import { connectHits } from "react-instantsearch-dom";
|
|
4
|
-
import ItemResult from "components/results/ItemResult";
|
|
5
|
-
|
|
6
|
-
function Hits({
|
|
7
|
-
hits,
|
|
8
|
-
setDataResultToAlgolia,
|
|
9
|
-
handlerToggleModal,
|
|
10
|
-
setOpenModalShare,
|
|
11
|
-
setSearchStateInput,
|
|
12
|
-
getUrlToCanvasFile,
|
|
13
|
-
setLoading,
|
|
14
|
-
sendFeedBackAction,
|
|
15
|
-
}: any): JSX.Element {
|
|
16
|
-
const handleSearch = () => {
|
|
17
|
-
setDataResultToAlgolia(hits);
|
|
18
|
-
};
|
|
19
|
-
console.log("hitshits", hits);
|
|
20
|
-
|
|
21
|
-
return (
|
|
22
|
-
<>
|
|
23
|
-
{handleSearch}
|
|
24
|
-
{hits.map((hit: any, index: any) => {
|
|
25
|
-
return (
|
|
26
|
-
<ItemResult
|
|
27
|
-
key={index}
|
|
28
|
-
dataItem={hit}
|
|
29
|
-
handlerToggleModal={() => {
|
|
30
|
-
handlerToggleModal(hit);
|
|
31
|
-
}}
|
|
32
|
-
handlerToggleModalShare={() => setOpenModalShare(true)}
|
|
33
|
-
indexItem={hit.__position}
|
|
34
|
-
isHover={false}
|
|
35
|
-
onSearchImage={(url: any) => {
|
|
36
|
-
setSearchStateInput({});
|
|
37
|
-
getUrlToCanvasFile(url);
|
|
38
|
-
setLoading(true);
|
|
39
|
-
}}
|
|
40
|
-
handlerFeedback={(value: string) => {
|
|
41
|
-
sendFeedBackAction(value);
|
|
42
|
-
}}
|
|
43
|
-
/>
|
|
44
|
-
);
|
|
45
|
-
})}
|
|
46
|
-
</>
|
|
47
|
-
);
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
Hits.propTypes = {
|
|
51
|
-
hits: PropTypes.arrayOf(PropTypes.object),
|
|
52
|
-
objectIDs: PropTypes.arrayOf(PropTypes.string),
|
|
53
|
-
setObjectIDs: PropTypes.func,
|
|
54
|
-
};
|
|
55
|
-
|
|
56
|
-
const CustomHits = connectHits(Hits);
|
|
57
|
-
export default CustomHits;
|
|
@@ -1,175 +0,0 @@
|
|
|
1
|
-
import { Box, Button, Grid, Typography } from "@material-ui/core";
|
|
2
|
-
import React from "react";
|
|
3
|
-
import CloseOutlinedIcon from "@material-ui/icons/CloseOutlined";
|
|
4
|
-
import DefaultCarousel from "./carousel/DefaultCarousel";
|
|
5
|
-
import { Link } from "react-router-dom";
|
|
6
|
-
import IconSupport from "common/assets/icons/support.svg";
|
|
7
|
-
import IconLike from "common/assets/icons/icon_like.svg";
|
|
8
|
-
import IconDisLike from "common/assets/icons/icon_dislike.svg";
|
|
9
|
-
import IconShare from "common/assets/icons/Fill.svg";
|
|
10
|
-
import IconBookmark from "common/assets/icons/book_mark.svg";
|
|
11
|
-
// import IconPicture from "common/assets/icons/icon_picture.png";
|
|
12
|
-
import IconPicture from "common/assets/icons/icon_modal_image.svg";
|
|
13
|
-
import { useState } from "react";
|
|
14
|
-
import { isEmpty } from "lodash";
|
|
15
|
-
import { useEffect } from "react";
|
|
16
|
-
|
|
17
|
-
interface Props {
|
|
18
|
-
numberResult?: number;
|
|
19
|
-
results?: any;
|
|
20
|
-
handlerCloseModal: () => void;
|
|
21
|
-
onNextItem?: () => void;
|
|
22
|
-
onPrevItem?: () => void;
|
|
23
|
-
dataItem?: any;
|
|
24
|
-
onHandlerModalShare?: () => void;
|
|
25
|
-
onSearchImage?: any;
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
function DetailItem(props: Props) {
|
|
29
|
-
const {
|
|
30
|
-
handlerCloseModal,
|
|
31
|
-
dataItem,
|
|
32
|
-
onHandlerModalShare,
|
|
33
|
-
onSearchImage,
|
|
34
|
-
} = props;
|
|
35
|
-
|
|
36
|
-
const { img, title, sku, main_image_link } = dataItem;
|
|
37
|
-
const [dataImageCarousel, setDataImageCarouSel] = useState<any[]>([]);
|
|
38
|
-
|
|
39
|
-
useEffect(() => {
|
|
40
|
-
checkDataItemResult(dataItem);
|
|
41
|
-
}, [dataItem]);
|
|
42
|
-
|
|
43
|
-
const checkDataItemResult = (dataItem: any) => {
|
|
44
|
-
if (!dataItem) {
|
|
45
|
-
return setDataImageCarouSel([]);
|
|
46
|
-
}
|
|
47
|
-
let valueKey: any[] = [];
|
|
48
|
-
const newObject = dataItem;
|
|
49
|
-
for (let key in newObject) {
|
|
50
|
-
if (key?.includes("recognition_image_link")) {
|
|
51
|
-
if (!isEmpty(newObject[key])) {
|
|
52
|
-
valueKey.push({
|
|
53
|
-
url: newObject[key],
|
|
54
|
-
});
|
|
55
|
-
}
|
|
56
|
-
} else {
|
|
57
|
-
if (key === "main_image_link") {
|
|
58
|
-
valueKey.push({
|
|
59
|
-
url: newObject[key],
|
|
60
|
-
});
|
|
61
|
-
}
|
|
62
|
-
}
|
|
63
|
-
}
|
|
64
|
-
setDataImageCarouSel(valueKey);
|
|
65
|
-
};
|
|
66
|
-
|
|
67
|
-
return (
|
|
68
|
-
<Box className="box-modal-default">
|
|
69
|
-
<Box className="ml-auto" style={{ width: "fit-content", marginRight: 5 }}>
|
|
70
|
-
<Button style={{ padding: 0 }} onClick={handlerCloseModal}>
|
|
71
|
-
<CloseOutlinedIcon style={{ fontSize: 12, color: "#55566B" }} />
|
|
72
|
-
</Button>
|
|
73
|
-
</Box>
|
|
74
|
-
|
|
75
|
-
<Box className="box-carosel">
|
|
76
|
-
<DefaultCarousel imgItem={dataImageCarousel} />
|
|
77
|
-
<Button
|
|
78
|
-
className="icon-style"
|
|
79
|
-
onClick={() => {
|
|
80
|
-
if (!main_image_link) {
|
|
81
|
-
console.log("321");
|
|
82
|
-
|
|
83
|
-
return;
|
|
84
|
-
}
|
|
85
|
-
onSearchImage(main_image_link);
|
|
86
|
-
handlerCloseModal();
|
|
87
|
-
}}
|
|
88
|
-
>
|
|
89
|
-
<img src={IconPicture} alt="icon_picture" />
|
|
90
|
-
</Button>
|
|
91
|
-
</Box>
|
|
92
|
-
|
|
93
|
-
<Box
|
|
94
|
-
className="box-content"
|
|
95
|
-
display={"flex"}
|
|
96
|
-
style={{ flexDirection: "column" }}
|
|
97
|
-
>
|
|
98
|
-
<Box className="box-top">
|
|
99
|
-
<Grid container justifyContent="space-between">
|
|
100
|
-
<Grid item xs={10}>
|
|
101
|
-
<Typography className="text-f9 fw-500 max-line-1">
|
|
102
|
-
SKU: {sku}
|
|
103
|
-
</Typography>
|
|
104
|
-
<Typography className="text-f16 fw-600 text-dark">
|
|
105
|
-
{title}
|
|
106
|
-
</Typography>
|
|
107
|
-
<Link className="text-f9 text-blue" to={"/"} href="#">
|
|
108
|
-
View full description
|
|
109
|
-
</Link>
|
|
110
|
-
</Grid>
|
|
111
|
-
<Grid item>
|
|
112
|
-
<Button className="btn-item">
|
|
113
|
-
<img
|
|
114
|
-
src={IconBookmark}
|
|
115
|
-
alt="image_item"
|
|
116
|
-
className="icon_action"
|
|
117
|
-
/>
|
|
118
|
-
</Button>
|
|
119
|
-
</Grid>
|
|
120
|
-
</Grid>
|
|
121
|
-
</Box>
|
|
122
|
-
|
|
123
|
-
<Box className="box-bottom">
|
|
124
|
-
<Grid container justifyContent="space-between" alignItems="center">
|
|
125
|
-
<Grid item>
|
|
126
|
-
<Box display={"flex"} alignItems={"center"}>
|
|
127
|
-
<Button className="btn-item">
|
|
128
|
-
<img
|
|
129
|
-
src={IconLike}
|
|
130
|
-
alt="image_item"
|
|
131
|
-
className="icon_action"
|
|
132
|
-
/>
|
|
133
|
-
</Button>
|
|
134
|
-
<Button className="btn-item">
|
|
135
|
-
<img
|
|
136
|
-
src={IconDisLike}
|
|
137
|
-
alt="image_item"
|
|
138
|
-
className="icon_action"
|
|
139
|
-
/>
|
|
140
|
-
</Button>
|
|
141
|
-
</Box>
|
|
142
|
-
</Grid>
|
|
143
|
-
<Grid item>
|
|
144
|
-
<Box display={"flex"} alignItems={"center"}>
|
|
145
|
-
<Button className="btn-item" onClick={onHandlerModalShare}>
|
|
146
|
-
<img
|
|
147
|
-
src={IconShare}
|
|
148
|
-
alt="image_item"
|
|
149
|
-
className="icon_action"
|
|
150
|
-
/>
|
|
151
|
-
</Button>
|
|
152
|
-
<Button className="btn-item">
|
|
153
|
-
<Box
|
|
154
|
-
className="box-gray text-center box-support"
|
|
155
|
-
display={"flex"}
|
|
156
|
-
justifyContent={"center"}
|
|
157
|
-
alignItems={"center"}
|
|
158
|
-
>
|
|
159
|
-
<img
|
|
160
|
-
src={IconSupport}
|
|
161
|
-
alt="image_item"
|
|
162
|
-
className="icon_support"
|
|
163
|
-
/>
|
|
164
|
-
</Box>
|
|
165
|
-
</Button>
|
|
166
|
-
</Box>
|
|
167
|
-
</Grid>
|
|
168
|
-
</Grid>
|
|
169
|
-
</Box>
|
|
170
|
-
</Box>
|
|
171
|
-
</Box>
|
|
172
|
-
);
|
|
173
|
-
}
|
|
174
|
-
|
|
175
|
-
export default DetailItem;
|
|
@@ -1,188 +0,0 @@
|
|
|
1
|
-
import { Box, Typography } from "@material-ui/core";
|
|
2
|
-
import React from "react";
|
|
3
|
-
import { useDropzone } from "react-dropzone";
|
|
4
|
-
import IconSearch from "common/assets/icons/icon_search_image.svg";
|
|
5
|
-
import { makeFileHandler } from "@nyris/nyris-react-components";
|
|
6
|
-
import { useAppDispatch, useAppSelector } from "Store/Store";
|
|
7
|
-
import { serviceImage, serviceImageNonRegion } from "services/image";
|
|
8
|
-
import {
|
|
9
|
-
loadFile,
|
|
10
|
-
loadingActionResults,
|
|
11
|
-
searchFileImageNonRegion,
|
|
12
|
-
} from "Store/Search";
|
|
13
|
-
import { showFeedback, showResults } from "Store/Nyris";
|
|
14
|
-
import { useHistory } from "react-router-dom";
|
|
15
|
-
import ExampleImages from "./ExampleImages";
|
|
16
|
-
import { feedbackClickEpic } from "services/Feedback";
|
|
17
|
-
import { useState } from "react";
|
|
18
|
-
|
|
19
|
-
interface Props {
|
|
20
|
-
acceptTypes: any;
|
|
21
|
-
onChangeLoading: any;
|
|
22
|
-
isLoading: boolean;
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
function DragDropFile(props: Props) {
|
|
26
|
-
const history = useHistory();
|
|
27
|
-
const dispatch = useAppDispatch();
|
|
28
|
-
const { acceptTypes, onChangeLoading, isLoading } = props;
|
|
29
|
-
const searchState = useAppSelector((state) => state);
|
|
30
|
-
const { settings } = searchState;
|
|
31
|
-
const [rectCoords] = useState<any>(undefined);
|
|
32
|
-
const [isLoadingLoadFile, setLoadingLoadFile] = useState<any>(false);
|
|
33
|
-
|
|
34
|
-
const { getRootProps, getInputProps, isDragActive } = useDropzone({
|
|
35
|
-
onDrop: (fs: File[]) => {
|
|
36
|
-
onChangeLoading(true);
|
|
37
|
-
console.log("321");
|
|
38
|
-
let payload: any;
|
|
39
|
-
let filters: any[] = [];
|
|
40
|
-
setLoadingLoadFile(true);
|
|
41
|
-
console.log("fs", fs);
|
|
42
|
-
|
|
43
|
-
return serviceImage(fs[0], searchState).then((res: any) => {
|
|
44
|
-
console.log("res?.results", res);
|
|
45
|
-
|
|
46
|
-
res?.results.map((item: any) => {
|
|
47
|
-
filters.push({
|
|
48
|
-
sku: item.sku,
|
|
49
|
-
score: item.score,
|
|
50
|
-
});
|
|
51
|
-
});
|
|
52
|
-
payload = {
|
|
53
|
-
...res,
|
|
54
|
-
// results: newResult,
|
|
55
|
-
filters,
|
|
56
|
-
};
|
|
57
|
-
console.log("payload", payload);
|
|
58
|
-
|
|
59
|
-
dispatch(loadFile(payload));
|
|
60
|
-
setLoadingLoadFile(false);
|
|
61
|
-
onChangeLoading(false);
|
|
62
|
-
history.push("/result");
|
|
63
|
-
return dispatch(showFeedback(""));
|
|
64
|
-
});
|
|
65
|
-
},
|
|
66
|
-
});
|
|
67
|
-
|
|
68
|
-
const getUrlToCanvasFile = (url: string, position?: number) => {
|
|
69
|
-
onChangeLoading(true);
|
|
70
|
-
dispatch(showResults(""));
|
|
71
|
-
dispatch(loadingActionResults(""));
|
|
72
|
-
if (position) {
|
|
73
|
-
feedbackClickEpic(searchState, position);
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
if (settings.regions) {
|
|
77
|
-
serviceImage(url, searchState).then((res) => {
|
|
78
|
-
dispatch(loadFile(res));
|
|
79
|
-
onChangeLoading(false);
|
|
80
|
-
history.push("/result");
|
|
81
|
-
return dispatch(showFeedback(""));
|
|
82
|
-
});
|
|
83
|
-
} else {
|
|
84
|
-
serviceImageNonRegion(url, searchState, rectCoords).then((res) => {
|
|
85
|
-
onChangeLoading(false);
|
|
86
|
-
history.push("/result");
|
|
87
|
-
dispatch(searchFileImageNonRegion(res));
|
|
88
|
-
});
|
|
89
|
-
}
|
|
90
|
-
};
|
|
91
|
-
|
|
92
|
-
return (
|
|
93
|
-
<Box
|
|
94
|
-
className={
|
|
95
|
-
!isDragActive && !isLoadingLoadFile
|
|
96
|
-
? `box-content-main`
|
|
97
|
-
: `box-content-main-drop`
|
|
98
|
-
}
|
|
99
|
-
>
|
|
100
|
-
{isLoading && (
|
|
101
|
-
<Box className="loadingSpinCT">
|
|
102
|
-
<Box className="box-content-spin"></Box>
|
|
103
|
-
</Box>
|
|
104
|
-
)}
|
|
105
|
-
|
|
106
|
-
<div
|
|
107
|
-
className={`box-border`}
|
|
108
|
-
style={{ position: "relative" }}
|
|
109
|
-
{...getRootProps({
|
|
110
|
-
onClick: (e) => {
|
|
111
|
-
e.stopPropagation();
|
|
112
|
-
},
|
|
113
|
-
})}
|
|
114
|
-
>
|
|
115
|
-
{isDragActive ? (
|
|
116
|
-
<Box>
|
|
117
|
-
<Typography className="text-drop-file">
|
|
118
|
-
DRAG <span className="tractor">&</span> DROP
|
|
119
|
-
</Typography>
|
|
120
|
-
<input
|
|
121
|
-
{...getInputProps({
|
|
122
|
-
onClick: (e) => {
|
|
123
|
-
e.stopPropagation();
|
|
124
|
-
},
|
|
125
|
-
})}
|
|
126
|
-
type="file"
|
|
127
|
-
name="file"
|
|
128
|
-
id="select_file"
|
|
129
|
-
// className="inputFile"
|
|
130
|
-
placeholder="Choose photo"
|
|
131
|
-
accept={acceptTypes}
|
|
132
|
-
onChange={makeFileHandler((e) => {})}
|
|
133
|
-
/>
|
|
134
|
-
</Box>
|
|
135
|
-
) : (
|
|
136
|
-
<>
|
|
137
|
-
<Box
|
|
138
|
-
className="box-content-drop"
|
|
139
|
-
{...getRootProps({
|
|
140
|
-
onClick: (e) => {
|
|
141
|
-
e.stopPropagation();
|
|
142
|
-
},
|
|
143
|
-
})}
|
|
144
|
-
>
|
|
145
|
-
<Box className="box-image">
|
|
146
|
-
<img
|
|
147
|
-
width={27}
|
|
148
|
-
height={27}
|
|
149
|
-
src={IconSearch}
|
|
150
|
-
alt="icon_search"
|
|
151
|
-
/>
|
|
152
|
-
</Box>
|
|
153
|
-
<label htmlFor="select_file" className="text-f20 text-bold">
|
|
154
|
-
<span className="box-blue">Choose photo</span> or drag & drop it
|
|
155
|
-
here
|
|
156
|
-
</label>
|
|
157
|
-
<input
|
|
158
|
-
{...getInputProps()}
|
|
159
|
-
type="file"
|
|
160
|
-
name="file"
|
|
161
|
-
id="select_file"
|
|
162
|
-
className="inputFile"
|
|
163
|
-
placeholder="Choose photo"
|
|
164
|
-
style={{ display: "block" }}
|
|
165
|
-
// accept={acceptTypes}
|
|
166
|
-
// onChange={makeFileHandler((e) => {
|
|
167
|
-
// return isCheckImageFile(e);
|
|
168
|
-
// })}
|
|
169
|
-
/>
|
|
170
|
-
</Box>
|
|
171
|
-
<Box style={{ marginTop: 19, zIndex: 109 }} className="box-thumb">
|
|
172
|
-
<Box display={"flex"} alignItems={"flex-end"}>
|
|
173
|
-
<ExampleImages
|
|
174
|
-
images={settings.exampleImages}
|
|
175
|
-
onExampleImageClicked={(url: string) => {
|
|
176
|
-
return getUrlToCanvasFile(url);
|
|
177
|
-
}}
|
|
178
|
-
/>
|
|
179
|
-
</Box>
|
|
180
|
-
</Box>
|
|
181
|
-
</>
|
|
182
|
-
)}
|
|
183
|
-
</div>
|
|
184
|
-
</Box>
|
|
185
|
-
);
|
|
186
|
-
}
|
|
187
|
-
|
|
188
|
-
export default DragDropFile;
|
|
@@ -1,33 +0,0 @@
|
|
|
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;
|
|
@@ -1,29 +0,0 @@
|
|
|
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;
|
|
@@ -1,54 +0,0 @@
|
|
|
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;
|
|
@@ -1,47 +0,0 @@
|
|
|
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;
|
|
@@ -1,39 +0,0 @@
|
|
|
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;
|