@nyris/nyris-webapp 0.3.5 → 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 (203) hide show
  1. package/build/asset-manifest.json +18 -32
  2. package/build/index.html +1 -1
  3. package/build/{precache-manifest.bbb31f2ce7710d7eb3175b1b48241d24.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.test.tsx +49 -0
  19. package/src/App.tsx +253 -15
  20. package/src/AppMD.tsx +320 -0
  21. package/src/Demo2.tsx +220 -0
  22. package/src/actions/nyrisAppActions.ts +76 -0
  23. package/src/actions/searchActions.ts +218 -0
  24. package/src/components/ExampleImages.tsx +17 -32
  25. package/src/components/Feedback.tsx +48 -87
  26. package/src/components/FiltersList.tsx +69 -0
  27. package/src/components/Header.tsx +17 -32
  28. package/src/components/Result.tsx +113 -186
  29. package/src/components/Sidebar.tsx +40 -0
  30. package/src/defaults.ts +3 -4
  31. package/src/epics/feedback.ts +59 -0
  32. package/src/epics/index.ts +154 -0
  33. package/src/epics/search.ts +203 -0
  34. package/src/epics/types.ts +12 -0
  35. package/src/{common/assets/fonts → fonts}/roboto-bold-webfont.woff +0 -0
  36. package/src/{common/assets/fonts → fonts}/roboto-bold-webfont.woff2 +0 -0
  37. package/src/{common/assets/fonts → fonts}/roboto-italic-webfont.woff +0 -0
  38. package/src/{common/assets/fonts → fonts}/roboto-italic-webfont.woff2 +0 -0
  39. package/src/{common/assets/fonts → fonts}/roboto-regular-webfont.woff +0 -0
  40. package/src/{common/assets/fonts → fonts}/roboto-regular-webfont.woff2 +0 -0
  41. package/src/{common/assets/fonts → fonts}/robotocondensed-bold-webfont.woff +0 -0
  42. package/src/{common/assets/fonts → fonts}/robotocondensed-bold-webfont.woff2 +0 -0
  43. package/src/{common/assets/fonts → fonts}/robotocondensed-bolditalic-webfont.woff +0 -0
  44. package/src/{common/assets/fonts → fonts}/robotocondensed-bolditalic-webfont.woff2 +0 -0
  45. package/src/{common/assets/images → images}/fav/android-icon-192x192.png +0 -0
  46. package/src/{common/assets/images → images}/fav/apple-icon-114x114.png +0 -0
  47. package/src/{common/assets/images → images}/fav/apple-icon-120x120.png +0 -0
  48. package/src/{common/assets/images → images}/fav/apple-icon-144x144.png +0 -0
  49. package/src/{common/assets/images → images}/fav/apple-icon-152x152.png +0 -0
  50. package/src/{common/assets/images → images}/fav/apple-icon-180x180.png +0 -0
  51. package/src/{common/assets/images → images}/fav/apple-icon-57x57.png +0 -0
  52. package/src/{common/assets/images → images}/fav/apple-icon-60x60.png +0 -0
  53. package/src/{common/assets/images → images}/fav/apple-icon-72x72.png +0 -0
  54. package/src/{common/assets/images → images}/fav/apple-icon-76x76.png +0 -0
  55. package/src/{common/assets/images → images}/fav/browserconfig.xml +0 -0
  56. package/src/{common/assets/images → images}/fav/favicon-16x16.png +0 -0
  57. package/src/{common/assets/images → images}/fav/favicon-32x32.png +0 -0
  58. package/src/{common/assets/images → images}/fav/favicon-96x96.png +0 -0
  59. package/src/{common/assets/images → images}/fav/manifest.json +0 -0
  60. package/src/{common/assets/images → images}/ic_cam.png +0 -0
  61. package/src/{common/assets/images → images}/ic_cam.svg +0 -0
  62. package/src/{common/assets/images → images}/ic_cam_large.png +0 -0
  63. package/src/{common/assets/images → images}/ic_cam_large.svg +0 -0
  64. package/src/{common/assets/images → images}/ic_cam_large_noimage.png +0 -0
  65. package/src/{common/assets/images → images}/ic_close_feedback.png +0 -0
  66. package/src/{common/assets/images → images}/ic_close_feedback.svg +0 -0
  67. package/src/{common/assets/images → images}/ic_shopNow.png +0 -0
  68. package/src/{common/assets/images → images}/ic_shopNow.svg +0 -0
  69. package/src/{common/assets/images → images}/ic_shopNowLight.png +0 -0
  70. package/src/{common/assets/images → images}/ic_shopNowLight.svg +0 -0
  71. package/src/{common/assets/images → images}/nyris_logo.png +0 -0
  72. package/src/{common/assets/images → images}/rewe.svg +0 -0
  73. package/src/{common/assets/images → images}/sectionTransBack.png +0 -0
  74. package/src/{common/assets/images → images}/sectionTransBack.svg +0 -0
  75. package/src/{common/assets/images → images}/sectionTransTop.png +0 -0
  76. package/src/{common/assets/images → images}/sectionTransTop.svg +0 -0
  77. package/src/index.css +416 -573
  78. package/src/index.tsx +189 -39
  79. package/src/types.ts +7 -51
  80. package/tsconfig.json +8 -3
  81. package/build/js/settings.example.js +0 -31
  82. package/build/js/test.js +0 -56
  83. package/build/static/css/2.8285176a.chunk.css +0 -2
  84. package/build/static/css/2.8285176a.chunk.css.map +0 -1
  85. package/build/static/css/main.6676fe1f.chunk.css +0 -2
  86. package/build/static/css/main.6676fe1f.chunk.css.map +0 -1
  87. package/build/static/js/2.4a55bc61.chunk.js +0 -3
  88. package/build/static/js/2.4a55bc61.chunk.js.LICENSE.txt +0 -124
  89. package/build/static/js/2.4a55bc61.chunk.js.map +0 -1
  90. package/build/static/js/main.2660f94a.chunk.js +0 -2
  91. package/build/static/js/main.2660f94a.chunk.js.map +0 -1
  92. package/build/static/media/Fill.37094b44.svg +0 -3
  93. package/build/static/media/Montserrat-Bold.5a052e98.otf +0 -0
  94. package/build/static/media/Montserrat-Light.21789e89.otf +0 -0
  95. package/build/static/media/Montserrat-Medium.a53e0373.otf +0 -0
  96. package/build/static/media/Montserrat-Regular.71cdc681.otf +0 -0
  97. package/build/static/media/Montserrat-SemiBold.f613d915.otf +0 -0
  98. package/build/static/media/Rectangle.4dd8b747.png +0 -0
  99. package/build/static/media/admin.9529c7f6.svg +0 -3
  100. package/build/static/media/bg-support-page.6ac55268.svg +0 -9
  101. package/build/static/media/book_mark.8e294c0b.svg +0 -3
  102. package/build/static/media/icon_dislike.94607ca6.svg +0 -3
  103. package/build/static/media/icon_like.a4fb1b18.svg +0 -3
  104. package/build/static/media/icon_modal_image.3068d0ea.svg +0 -21
  105. package/build/static/media/icon_search_image.c2c728c0.svg +0 -3
  106. package/build/static/media/nyris_logo.22d8f250.svg +0 -3
  107. package/build/static/media/reload_icon.4b579a74.svg +0 -3
  108. package/build/static/media/save_search.bebaeebf.svg +0 -3
  109. package/build/static/media/support.289c3a3c.svg +0 -3
  110. package/build/static/media/translate_icon.f0492297.svg +0 -3
  111. package/public/js/settings.example.js +0 -31
  112. package/public/js/test.js +0 -56
  113. package/src/Router.tsx +0 -97
  114. package/src/Store/Auth.ts +0 -44
  115. package/src/Store/Nyris.ts +0 -77
  116. package/src/Store/Search.ts +0 -243
  117. package/src/Store/Store.ts +0 -53
  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 -192
  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 -38
  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/results/ItemResult.tsx +0 -155
  184. package/src/components/search/ListSearch.tsx +0 -209
  185. package/src/modules/LandingPage/App.tsx +0 -318
  186. package/src/modules/LandingPage/AppMD.tsx +0 -399
  187. package/src/modules/LandingPage/common.scss +0 -1304
  188. package/src/modules/LandingPage/index.tsx +0 -169
  189. package/src/modules/LandingPage/indexNewVersion.tsx +0 -110
  190. package/src/modules/LandingPage/propsType.ts +0 -43
  191. package/src/page/Auth/login.tsx +0 -7
  192. package/src/page/Exception/404.tsx +0 -11
  193. package/src/page/History/index.tsx +0 -76
  194. package/src/page/Profile/index.tsx +0 -87
  195. package/src/page/Saved/MockData.ts +0 -223
  196. package/src/page/Saved/index.tsx +0 -166
  197. package/src/page/Support/index.tsx +0 -160
  198. package/src/page/result/MockData.ts +0 -36
  199. package/src/page/result/index.tsx +0 -418
  200. package/src/services/Feedback.ts +0 -64
  201. package/src/services/image.ts +0 -40
  202. package/src/services/session.ts +0 -17
  203. package/src/services/types.ts +0 -50
@@ -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,192 +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 {createImage, findByImage, findRegions} from "services/image";
8
- import {
9
- setSearchResults,
10
- loadingActionResults,
11
- setRequestImage, setRegions, setSelectedRegion,
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
- import {RectCoords} from "@nyris/nyris-api";
19
-
20
- interface Props {
21
- acceptTypes: any;
22
- onChangeLoading: any;
23
- isLoading: boolean;
24
- }
25
-
26
- function DragDropFile(props: Props) {
27
- const history = useHistory();
28
- const dispatch = useAppDispatch();
29
- const { acceptTypes, onChangeLoading, isLoading } = props;
30
- const searchState = useAppSelector((state) => state);
31
- const { settings } = searchState;
32
- const [isLoadingLoadFile, setLoadingLoadFile] = useState<any>(false);
33
-
34
- const { getRootProps, getInputProps, isDragActive } = useDropzone({
35
- onDrop: async (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
- let image = await createImage(fs[0]);
44
- dispatch(setRequestImage(image));
45
- // TODO support regions
46
- return findByImage(image, searchState.settings).then((res: any) => {
47
- console.log("res?.results", res);
48
-
49
- res?.results.map((item: any) => {
50
- filters.push({
51
- sku: item.sku,
52
- score: item.score,
53
- });
54
- });
55
- payload = {
56
- ...res,
57
- // results: newResult,
58
- filters,
59
- };
60
- console.log("payload", payload);
61
-
62
- dispatch(setSearchResults(payload));
63
- setLoadingLoadFile(false);
64
- onChangeLoading(false);
65
- history.push("/result");
66
- return dispatch(showFeedback());
67
- });
68
- },
69
- });
70
-
71
- const getUrlToCanvasFile = async (url: string, position?: number) => {
72
- onChangeLoading(true);
73
- dispatch(showResults());
74
- dispatch(loadingActionResults());
75
- if (position) {
76
- feedbackClickEpic(searchState, position);
77
- }
78
-
79
- let image = await createImage(url);
80
- dispatch(setRequestImage(image));
81
- let searchRegion: RectCoords| undefined = undefined;
82
- if (settings.regions) {
83
- let res = await findRegions(image, settings);
84
- dispatch(setRegions(res.regions));
85
- searchRegion = res.selectedRegion;
86
- dispatch(setSelectedRegion(searchRegion));
87
- }
88
- return findByImage(image, searchState.settings, searchRegion).then((res) => {
89
- dispatch(setSearchResults(res));
90
- onChangeLoading(false);
91
- history.push("/result");
92
- return dispatch(showFeedback());
93
- });
94
- };
95
-
96
- return (
97
- <Box
98
- className={
99
- !isDragActive && !isLoadingLoadFile
100
- ? `box-content-main`
101
- : `box-content-main-drop`
102
- }
103
- >
104
- {isLoading && (
105
- <Box className="loadingSpinCT">
106
- <Box className="box-content-spin"></Box>
107
- </Box>
108
- )}
109
-
110
- <div
111
- className={`box-border`}
112
- style={{ position: "relative" }}
113
- {...getRootProps({
114
- onClick: (e) => {
115
- e.stopPropagation();
116
- },
117
- })}
118
- >
119
- {isDragActive ? (
120
- <Box>
121
- <Typography className="text-drop-file">
122
- DRAG <span className="tractor">&</span> DROP
123
- </Typography>
124
- <input
125
- {...getInputProps({
126
- onClick: (e) => {
127
- e.stopPropagation();
128
- },
129
- })}
130
- type="file"
131
- name="file"
132
- id="select_file"
133
- // className="inputFile"
134
- placeholder="Choose photo"
135
- accept={acceptTypes}
136
- onChange={makeFileHandler((e) => {})}
137
- />
138
- </Box>
139
- ) : (
140
- <>
141
- <Box
142
- className="box-content-drop"
143
- {...getRootProps({
144
- onClick: (e) => {
145
- e.stopPropagation();
146
- },
147
- })}
148
- >
149
- <Box className="box-image">
150
- <img
151
- width={27}
152
- height={27}
153
- src={IconSearch}
154
- alt="icon_search"
155
- />
156
- </Box>
157
- <label htmlFor="select_file" className="text-f20 text-bold">
158
- <span className="box-blue">Choose photo</span> or drag & drop it
159
- here
160
- </label>
161
- <input
162
- {...getInputProps()}
163
- type="file"
164
- name="file"
165
- id="select_file"
166
- className="inputFile"
167
- placeholder="Choose photo"
168
- style={{ display: "block" }}
169
- // accept={acceptTypes}
170
- // onChange={makeFileHandler((e) => {
171
- // return isCheckImageFile(e);
172
- // })}
173
- />
174
- </Box>
175
- <Box style={{ marginTop: 19, zIndex: 109 }} className="box-thumb">
176
- <Box display={"flex"} alignItems={"flex-end"}>
177
- <ExampleImages
178
- images={settings.exampleImages}
179
- onExampleImageClicked={(url: string) => {
180
- return getUrlToCanvasFile(url);
181
- }}
182
- />
183
- </Box>
184
- </Box>
185
- </>
186
- )}
187
- </div>
188
- </Box>
189
- );
190
- }
191
-
192
- 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,12 +0,0 @@
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
@@ -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,38 +0,0 @@
1
- import React from "react";
2
- import { Container, Toolbar, Typography, AppBar } from "@material-ui/core";
3
- import { useAppSelector } from "Store/Store";
4
- import {MDSettings} from "../types";
5
- interface Props {
6
- settings: any;
7
- }
8
-
9
- function HeaderMdComponent(): JSX.Element {
10
- const { settings } = useAppSelector((state) => state);
11
- const { themePage } = settings;
12
- const mdSettings = themePage.materialDesign as MDSettings;
13
-
14
- return (
15
- <AppBar
16
- position={"relative"}
17
- style={{ backgroundColor: mdSettings.appBarCustomBackgroundColor }}
18
- >
19
- <Container
20
- maxWidth="md"
21
- style={{ flexDirection: "row", display: "flex" }}
22
- >
23
- <img
24
- src={mdSettings.appBarLogoUrl}
25
- style={{ height: "2em", minHeight: "64px", display: "flex" }}
26
- alt="Logo"
27
- />
28
- <Toolbar component="span">
29
- <Typography style={{ color: mdSettings.appBarCustomTextColor }}>
30
- {mdSettings.appBarTitle}
31
- </Typography>
32
- </Toolbar>
33
- </Container>
34
- </AppBar>
35
- );
36
- }
37
-
38
- export default HeaderMdComponent;