kitchen-simulator 5.0.0-test.17 → 5.0.0-test.19

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 (206) hide show
  1. package/package.json +8 -18
  2. package/src/@history.js +3 -0
  3. package/src/CrossSignOn.jsx +94 -0
  4. package/src/KitchenConfigurator.jsx +1526 -0
  5. package/src/KitchenConfiguratorApp.jsx +1 -1
  6. package/src/_KitchenConfigurator.jsx +3 -91
  7. package/src/components/atoms/Snackbar/index.jsx +43 -0
  8. package/src/components/atoms/radio-button/index.jsx +20 -0
  9. package/src/components/atoms/radio-button/styles.js +56 -0
  10. package/src/components/button/MainButton.jsx +157 -0
  11. package/src/components/button/ToggleMeasureButton.jsx +65 -0
  12. package/src/components/catalog-view/catalog-breadcrumb.jsx +53 -0
  13. package/src/components/catalog-view/catalog-item.jsx +229 -0
  14. package/src/components/catalog-view/catalog-list.jsx +173 -0
  15. package/src/components/catalog-view/catalog-page-item.jsx +110 -0
  16. package/src/components/catalog-view/catalog-turn-back-page-item.jsx +80 -0
  17. package/src/components/configurator/custom-configurator.jsx +77 -0
  18. package/src/components/configurator/project-configurator.jsx +120 -0
  19. package/src/components/content.jsx +136 -0
  20. package/src/components/export.js +36 -0
  21. package/src/components/firstsetting/button/styles.js +223 -0
  22. package/src/components/firstsetting/export.js +9 -0
  23. package/src/components/firstsetting/firstsetting-content-button.jsx +198 -0
  24. package/src/components/firstsetting/firstsetting-toggle-button.jsx +101 -0
  25. package/src/components/firstsetting/firstsetting.jsx +814 -0
  26. package/src/components/footerbar/button/ControlButton.jsx +43 -0
  27. package/src/components/footerbar/button/DirectionButton.jsx +54 -0
  28. package/src/components/footerbar/button/DirectionPanSpinButton.jsx +36 -0
  29. package/src/components/footerbar/button/ToggleButton.jsx +58 -0
  30. package/src/components/footerbar/button/ToggleConvertButton.jsx +48 -0
  31. package/src/components/footerbar/button/ToggleMeasureButton.jsx +33 -0
  32. package/src/components/footerbar/button/styles.js +217 -0
  33. package/src/components/footerbar/export.js +9 -0
  34. package/src/components/footerbar/footer-content-button.jsx +198 -0
  35. package/src/components/footerbar/footer-toggle-button.jsx +101 -0
  36. package/src/components/footerbar/footerbar.jsx +1103 -0
  37. package/src/components/footerbar/styles.js +263 -0
  38. package/src/components/header/button/MenuButton.jsx +46 -0
  39. package/src/components/header/button/SaveButton.jsx +54 -0
  40. package/src/components/header/button/styles.js +181 -0
  41. package/src/components/header/export.js +5 -0
  42. package/src/components/header/header.jsx +631 -0
  43. package/src/components/header/header.style.css +47 -0
  44. package/src/components/header/styles.js +320 -0
  45. package/src/components/login/Login.js +77 -0
  46. package/src/components/login/LoginForm/index.js +108 -0
  47. package/src/components/login/Register.js +82 -0
  48. package/src/components/login/RegisterForm/index.js +171 -0
  49. package/src/components/login/jwtService.js +201 -0
  50. package/src/components/login/style.css +158 -0
  51. package/src/components/login/style.scss +260 -0
  52. package/src/components/molecules/slider/index.jsx +15 -0
  53. package/src/components/molecules/slider/styles.js +0 -0
  54. package/src/components/molecules/slider/styles.scss +3 -0
  55. package/src/components/myprojects/export.js +5 -0
  56. package/src/components/myprojects/index.jsx +445 -0
  57. package/src/components/myprojects/styles.js +241 -0
  58. package/src/components/sidebar/custom-accordion.jsx +48 -0
  59. package/src/components/sidebar/export.js +15 -0
  60. package/src/components/sidebar/panel-element-editor/attributes-editor/attributes-editor.jsx +73 -0
  61. package/src/components/sidebar/panel-element-editor/attributes-editor/confirm-popup.jsx +101 -0
  62. package/src/components/sidebar/panel-element-editor/attributes-editor/hole-attributes-editor.jsx +149 -0
  63. package/src/components/sidebar/panel-element-editor/attributes-editor/item-attributes-editor.jsx +316 -0
  64. package/src/components/sidebar/panel-element-editor/attributes-editor/line-attributes-editor.jsx +108 -0
  65. package/src/components/sidebar/panel-element-editor/element-editor.jsx +1070 -0
  66. package/src/components/sidebar/panel-element-editor/multi-elements-editor.jsx +0 -0
  67. package/src/components/sidebar/panel-element-editor/panel-element-editor.jsx +104 -0
  68. package/src/components/sidebar/panel-element-editor/panel-multi-elements-editor.jsx +155 -0
  69. package/src/components/sidebar/panel-group-editor.jsx +272 -0
  70. package/src/components/sidebar/panel-groups.jsx +310 -0
  71. package/src/components/sidebar/panel-guides.jsx +192 -0
  72. package/src/components/sidebar/panel-layer-elements.jsx +298 -0
  73. package/src/components/sidebar/panel-layers.jsx +381 -0
  74. package/src/components/sidebar/panel.jsx +71 -0
  75. package/src/components/sidebar/sidebar.jsx +106 -0
  76. package/src/components/sidebar/toolbar-panel.jsx +139 -0
  77. package/src/components/sign/export.js +7 -0
  78. package/src/components/sign/main/index.jsx +523 -0
  79. package/src/components/sign/main/styles.js +163 -0
  80. package/src/components/style/button.jsx +95 -0
  81. package/src/components/style/cancel-button.jsx +20 -0
  82. package/src/components/style/content-container.jsx +29 -0
  83. package/src/components/style/content-title.jsx +20 -0
  84. package/src/components/style/delete-button.jsx +23 -0
  85. package/src/components/style/export.jsx +48 -0
  86. package/src/components/style/form-block.jsx +13 -0
  87. package/src/components/style/form-color-input.jsx +27 -0
  88. package/src/components/style/form-label.jsx +15 -0
  89. package/src/components/style/form-number-input.jsx +196 -0
  90. package/src/components/style/form-number-input_2.jsx +191 -0
  91. package/src/components/style/form-select.jsx +38 -0
  92. package/src/components/style/form-slider.jsx +36 -0
  93. package/src/components/style/form-submit-button.jsx +23 -0
  94. package/src/components/style/form-text-input.jsx +65 -0
  95. package/src/components/toolbar/button/ControlButton.jsx +41 -0
  96. package/src/components/toolbar/button/DirectionButton.jsx +34 -0
  97. package/src/components/toolbar/button/RightButton.jsx +103 -0
  98. package/src/components/toolbar/button/ToggleButton.jsx +41 -0
  99. package/src/components/toolbar/button/index.jsx +55 -0
  100. package/src/components/toolbar/button/styles.js +127 -0
  101. package/src/components/toolbar/components/DoorStyleMenu.jsx +103 -0
  102. package/src/components/toolbar/components/Pricing.jsx +126 -0
  103. package/src/components/toolbar/components/ReviewForQuote.jsx +635 -0
  104. package/src/components/toolbar/export.js +21 -0
  105. package/src/components/toolbar/main/Alert.js +122 -0
  106. package/src/components/toolbar/main/TakePictureModal.jsx +104 -0
  107. package/src/components/toolbar/main/confirm-popup.jsx +99 -0
  108. package/src/components/toolbar/main/index.jsx +5627 -0
  109. package/src/components/toolbar/main/lShaped.json +311 -0
  110. package/src/components/toolbar/main/longNarrow.json +238 -0
  111. package/src/components/toolbar/main/myComponents.js +123 -0
  112. package/src/components/toolbar/main/oRectangle.json +220 -0
  113. package/src/components/toolbar/main/rectangle.json +238 -0
  114. package/src/components/toolbar/main/style.css +107 -0
  115. package/src/components/toolbar/main/styles.js +696 -0
  116. package/src/components/toolbar/plugin-item.jsx +123 -0
  117. package/src/components/toolbar/popup/appliance/appliance-category/index.jsx +73 -0
  118. package/src/components/toolbar/popup/appliance/choose-appliance/index.jsx +102 -0
  119. package/src/components/toolbar/popup/appliance/index.jsx +83 -0
  120. package/src/components/toolbar/popup/autosaveprompt/index.jsx +150 -0
  121. package/src/components/toolbar/popup/autosaveprompt/styles.css +64 -0
  122. package/src/components/toolbar/popup/autosaveprompt/styles.js +40 -0
  123. package/src/components/toolbar/popup/cabinet/cabinet-category/index.jsx +73 -0
  124. package/src/components/toolbar/popup/cabinet/choose-product/index.jsx +119 -0
  125. package/src/components/toolbar/popup/cabinet/index.jsx +85 -0
  126. package/src/components/toolbar/popup/doorStyle/choose-style/index.jsx +63 -0
  127. package/src/components/toolbar/popup/doorStyle/index.jsx +71 -0
  128. package/src/components/toolbar/popup/doorStyle/style-category/index.jsx +139 -0
  129. package/src/components/toolbar/popup/downloadsummary/downloadSummaryContext.js +2 -0
  130. package/src/components/toolbar/popup/downloadsummary/downloadSummaryTemp.jsx +157 -0
  131. package/src/components/toolbar/popup/downloadsummary/index.jsx +643 -0
  132. package/src/components/toolbar/popup/downloadsummary/show2D/show2DView.jsx +51 -0
  133. package/src/components/toolbar/popup/downloadsummary/show2D/viewer2DDownLoad.jsx +175 -0
  134. package/src/components/toolbar/popup/downloadsummary/show3D/show3DView.jsx +283 -0
  135. package/src/components/toolbar/popup/downloadsummary/show3D/viewer3DDownLoad.jsx +2257 -0
  136. package/src/components/toolbar/popup/downloadsummary/showCabinetInfo.js +93 -0
  137. package/src/components/toolbar/popup/downloadsummary/showElevation/showElevationView.jsx +132 -0
  138. package/src/components/toolbar/popup/downloadsummary/showElevation/viewer3DElevationDownload.jsx +2198 -0
  139. package/src/components/toolbar/popup/downloadsummary/showElevation/viewerElevationDownload.jsx +152 -0
  140. package/src/components/toolbar/popup/downloadsummary/showWarranty.jsx +149 -0
  141. package/src/components/toolbar/popup/downloadsummary/styles.css +177 -0
  142. package/src/components/toolbar/popup/downloadsummary/styles.js +453 -0
  143. package/src/components/toolbar/popup/finishingtouch/category/index.jsx +34 -0
  144. package/src/components/toolbar/popup/finishingtouch/index.jsx +58 -0
  145. package/src/components/toolbar/popup/finishingtouch/material-edit.jsx +112 -0
  146. package/src/components/toolbar/popup/finishingtouch/product/index.jsx +116 -0
  147. package/src/components/toolbar/popup/floorplan/choose-floor/confirm-popup.jsx +101 -0
  148. package/src/components/toolbar/popup/floorplan/choose-floor/index.jsx +254 -0
  149. package/src/components/toolbar/popup/floorplan/choose-floor/lShaped.json +311 -0
  150. package/src/components/toolbar/popup/floorplan/choose-floor/longNarrow.json +238 -0
  151. package/src/components/toolbar/popup/floorplan/choose-floor/oRectangle.json +220 -0
  152. package/src/components/toolbar/popup/floorplan/choose-floor/rectangle.json +238 -0
  153. package/src/components/toolbar/popup/floorplan/choose-floor/styles.js +86 -0
  154. package/src/components/toolbar/popup/floorplan/floor-category/index.jsx +109 -0
  155. package/src/components/toolbar/popup/floorplan/index.jsx +60 -0
  156. package/src/components/toolbar/popup/index.jsx +241 -0
  157. package/src/components/toolbar/popup/newproject/index.jsx +59 -0
  158. package/src/components/toolbar/popup/newproject/styles.css +64 -0
  159. package/src/components/toolbar/popup/newproject/styles.js +41 -0
  160. package/src/components/toolbar/popup/product/appliance.jsx +54 -0
  161. package/src/components/toolbar/popup/product/cabinetproduct.jsx +15 -0
  162. package/src/components/toolbar/popup/product/doorstyle.jsx +58 -0
  163. package/src/components/toolbar/popup/product/doorstyleproduct.jsx +47 -0
  164. package/src/components/toolbar/popup/product/floor.jsx +36 -0
  165. package/src/components/toolbar/popup/product/floorproduct.jsx +42 -0
  166. package/src/components/toolbar/popup/product/index.jsx +36 -0
  167. package/src/components/toolbar/popup/product/primary.jsx +77 -0
  168. package/src/components/toolbar/popup/product/productline.jsx +93 -0
  169. package/src/components/toolbar/popup/product/reviewItem.jsx +427 -0
  170. package/src/components/toolbar/popup/product/reviewMolding.jsx +310 -0
  171. package/src/components/toolbar/popup/product/style.css +54 -0
  172. package/src/components/toolbar/popup/product/styles.js +260 -0
  173. package/src/components/toolbar/popup/savedesign/FullPictureForm.jsx +146 -0
  174. package/src/components/toolbar/popup/savedesign/index.jsx +495 -0
  175. package/src/components/toolbar/popup/savedesign/savedesign.style.css +16 -0
  176. package/src/components/toolbar/popup/savedesign/styles.js +151 -0
  177. package/src/components/toolbar/popup/setDoorStyleOption/index.jsx +87 -0
  178. package/src/components/toolbar/popup/styles.js +909 -0
  179. package/src/components/toolbar/popup/submitforquote/AddToCartOptions.jsx +192 -0
  180. package/src/components/toolbar/popup/submitforquote/CustomerRequestsForm.jsx +96 -0
  181. package/src/components/toolbar/popup/submitforquote/SkipDesignerReview.jsx +54 -0
  182. package/src/components/toolbar/popup/submitforquote/StepDots.jsx +25 -0
  183. package/src/components/toolbar/popup/submitforquote/cart-choice.jsx +116 -0
  184. package/src/components/toolbar/popup/submitforquote/doorstyle-menus.js +38 -0
  185. package/src/components/toolbar/popup/submitforquote/index.jsx +698 -0
  186. package/src/components/toolbar/popup/submitforquote/styles.css +105 -0
  187. package/src/components/toolbar/popup/submitforquote/styles.js +294 -0
  188. package/src/components/toolbar/popup/submitprompt/index.jsx +89 -0
  189. package/src/components/toolbar/popup/submitprompt/styles.css +64 -0
  190. package/src/components/toolbar/popup/submitprompt/styles.js +42 -0
  191. package/src/components/toolbar/toolbar-button.jsx +90 -0
  192. package/src/components/toolbar/toolbar-load-button.jsx +36 -0
  193. package/src/components/toolbar/toolbar-save-button.jsx +32 -0
  194. package/src/components/tutorial-view/Modal.jsx +584 -0
  195. package/src/components/tutorial-view/style.css +111 -0
  196. package/src/components/tutorial-view/styles.js +65 -0
  197. package/src/components/wizardstep/button/styles.js +677 -0
  198. package/src/components/wizardstep/export.js +5 -0
  199. package/src/components/wizardstep/index.jsx +1372 -0
  200. package/src/components/wizardstep/styles.js +688 -0
  201. package/src/components/wizardstep/wizardstep-content-button.jsx +198 -0
  202. package/src/components/wizardstep/wizardstep-toggle-button.jsx +101 -0
  203. package/src/{_index.js → index.js} +4 -4
  204. package/src/renderer.jsx +466 -0
  205. package/src/actions/_export.js +0 -35
  206. package/src/components/_export.js +0 -11
@@ -0,0 +1,42 @@
1
+ import React, { useState } from 'react';
2
+
3
+ import * as S from './styles';
4
+ import * as MS from '../styles';
5
+ const STYLE_TITLE = {
6
+ fontSize: '12px',
7
+ color: '#fff',
8
+ padding: '5px 7px 8px 8px',
9
+ backgroundColor: '#3e3e3f',
10
+ display: 'flex',
11
+ height: '90px',
12
+ justifyContent: 'start',
13
+ alignItems: 'center'
14
+ };
15
+
16
+ export default function FloorProduct({ url, title, onClick, name }) {
17
+ return (
18
+ <S.FloorPlanContentWraper
19
+ style={{ display: 'flex', alignItems: 'center', cursor: 'pointer' }}
20
+ onClick={onClick}
21
+ >
22
+ <h3 style={{ ...STYLE_TITLE }}>
23
+ <img name={name} src={url} width={40} height={60} />
24
+ </h3>
25
+ <div style={{ ...STYLE_TITLE }}>
26
+ <div style={{ width: '60px' }}>
27
+ <span>{title}</span>
28
+ </div>
29
+ <S.Control style={{ paddingLeft: 5 }}>
30
+ <S.ControlIcon key={name}>
31
+ <img
32
+ width={'60px'}
33
+ name={name}
34
+ src={'/assets/img/svg/toolbar/add_button.svg'}
35
+ />
36
+ <MS.ButtonTitle style={{ top: '40%' }}>ADD</MS.ButtonTitle>
37
+ </S.ControlIcon>
38
+ </S.Control>
39
+ </div>
40
+ </S.FloorPlanContentWraper>
41
+ );
42
+ }
@@ -0,0 +1,36 @@
1
+ import React, { useState } from 'react';
2
+
3
+ import * as S from './styles';
4
+
5
+ const STYLE_TITLE = {
6
+ fontSize: '12px',
7
+ color: '#fff',
8
+ padding: '10px',
9
+ // backgroundColor: '#3e3e3f',
10
+ margin: '0px',
11
+ cursor: 'pointer',
12
+ display: 'flex',
13
+ height: '85px',
14
+ justifyContent: 'start',
15
+ alignItems: 'center'
16
+ };
17
+ // const STYLE_CONTENT = {
18
+ // fontSize: '10px',
19
+ // color: 'rgba(222, 222, 222, 1)',
20
+ // padding: '0px',
21
+ // backgroundColor: '#28292d',
22
+ // };
23
+ // const STYLE_ARROW = {
24
+ // float: 'right'
25
+ // };
26
+
27
+ export default function Product({ url, title, onClick, name }) {
28
+ return (
29
+ <S.PlanWraper onClick={onClick}>
30
+ <h3 style={{ ...STYLE_TITLE, paddingLeft: url ? 15 : 0 }}>
31
+ {url !== null && <img name={name} src={url} height={60} />}
32
+ <span style={{ marginLeft: 23 }}> {title} </span>
33
+ </h3>
34
+ </S.PlanWraper>
35
+ );
36
+ }
@@ -0,0 +1,77 @@
1
+ import React, { useState } from 'react';
2
+
3
+ import * as S from './styles';
4
+ import * as MS from '../styles';
5
+
6
+ export default function PrimaryDoorStyle({ url, title, onClick }) {
7
+ if (title !== null) title = title.charAt(0).toUpperCase() + title.substr(1);
8
+
9
+ return (
10
+ <div style={{ height: '100%' }}>
11
+ <h3
12
+ style={{
13
+ fontSize: 12,
14
+ padding: '8px 15px',
15
+ backgroundColor: 'rgb(47, 47, 47)',
16
+ margin: 0,
17
+ display: 'flex',
18
+ height: 30,
19
+ justifyContent: 'start',
20
+ color: 'rgb(255, 255, 255)'
21
+ }}
22
+ >
23
+ <span> Current Door Style </span>
24
+ </h3>
25
+ <S.PrimayDoorStyleLineWrapper
26
+ id="primarywrapper"
27
+ style={{ padding: '5px 15px 8px', display: 'grid' }}
28
+ >
29
+ {title != null && (
30
+ <h4
31
+ style={{
32
+ marginTop: '3px',
33
+ marginBottom: '9px',
34
+ justifySelf: 'center'
35
+ }}
36
+ >
37
+ <strong>{title}</strong>
38
+ </h4>
39
+ )}
40
+ {title != null && (
41
+ <img
42
+ style={{ justifySelf: 'center' }}
43
+ name={title}
44
+ width={'90px'}
45
+ height={'155px'}
46
+ src={url}
47
+ />
48
+ )}
49
+ {/* <p> <strong>Collection :</strong> Brilliant White </p> */}
50
+ <div>
51
+ <p>
52
+ {' '}
53
+ <strong>Description: </strong>
54
+ </p>
55
+ <p>
56
+ Door selection for all cabinets. <br />
57
+ To browse the entire collection of doors see below.
58
+ </p>
59
+ </div>
60
+ </S.PrimayDoorStyleLineWrapper>
61
+ <div style={{ marginTop: title == null ? 125 : 40 }}>
62
+ <S.Control onClick={onClick}>
63
+ <S.ControlIcon key={title}>
64
+ <img
65
+ width={'100px'}
66
+ name={title}
67
+ src={'/assets/img/svg/toolbar/style_change_button.svg'}
68
+ />
69
+ <MS.ButtonTitle style={{ top: '42%', fontSize: 11 }}>
70
+ CHANGE
71
+ </MS.ButtonTitle>
72
+ </S.ControlIcon>
73
+ </S.Control>
74
+ </div>
75
+ </div>
76
+ );
77
+ }
@@ -0,0 +1,93 @@
1
+ import React, { useState } from 'react';
2
+
3
+ import * as S from './styles';
4
+ import * as MS from '../styles';
5
+
6
+ export default function ProductLine({
7
+ url,
8
+ title,
9
+ info,
10
+ onClick,
11
+ name,
12
+ hascds
13
+ }) {
14
+ const [newstate, setNewstate] = useState(false);
15
+ title = title.charAt(0).toUpperCase() + title.substr(1);
16
+ let spanStyle = { fontSize: 11 };
17
+
18
+ return (
19
+ <S.LineWrapper style={{ padding: '5px 15px 8px' }}>
20
+ {hascds === true ? (
21
+ <S.Control onClick={onClick} style={{ marginTop: 3 }}>
22
+ <div style={{ width: '100%', display: 'flex' }}>
23
+ <S.LineImage>
24
+ <img
25
+ width={90}
26
+ height={90}
27
+ name={name}
28
+ src={url}
29
+ style={{ objectFit: 'contain' }}
30
+ />
31
+ </S.LineImage>
32
+ <div style={{ display: 'grid', marginLeft: '10px' }}>
33
+ <h4
34
+ style={{
35
+ marginTop: '3px',
36
+ marginBottom: '9px',
37
+ overflowWrap: 'anywhere'
38
+ }}
39
+ >
40
+ <span style={{ fontSize: 12 }}>{title}</span>
41
+ </h4>
42
+ <span style={spanStyle}>Width: {info.width}"</span>
43
+ <span style={spanStyle}>Depth: {info.height}"</span>
44
+ <span style={spanStyle}>Height: {info.tall}"</span>
45
+
46
+ <S.ControlIcon key={name}>
47
+ <img
48
+ width={72}
49
+ name={name}
50
+ src={'/assets/img/svg/toolbar/add_button.svg'}
51
+ />
52
+ <MS.ButtonTitle style={{ top: '37%', fontSize: 12 }}>
53
+ ADD
54
+ </MS.ButtonTitle>
55
+ </S.ControlIcon>
56
+ </div>
57
+ </div>
58
+ </S.Control>
59
+ ) : (
60
+ <S.UnControl
61
+ // onClick={onClick}
62
+ style={{ marginTop: 3 }}
63
+ >
64
+ <div style={{ width: '100%', display: 'flex' }}>
65
+ <S.LineImage>
66
+ <img
67
+ width={90}
68
+ height={90}
69
+ name={name}
70
+ src={url}
71
+ style={{ objectFit: 'contain' }}
72
+ />
73
+ </S.LineImage>
74
+ <div style={{ display: 'grid', marginLeft: '10px' }}>
75
+ <h4
76
+ style={{
77
+ marginTop: '3px',
78
+ marginBottom: '9px',
79
+ overflowWrap: 'anywhere'
80
+ }}
81
+ >
82
+ <span style={{ fontSize: 12 }}>{title}</span>
83
+ </h4>
84
+ <span style={spanStyle}>Width: {info.width}"</span>
85
+ <span style={spanStyle}>Depth: {info.height}"</span>
86
+ <span style={spanStyle}>Height: {info.tall}"</span>
87
+ </div>
88
+ </div>
89
+ </S.UnControl>
90
+ )}
91
+ </S.LineWrapper>
92
+ );
93
+ }
@@ -0,0 +1,427 @@
1
+ import React from 'react';
2
+ import Tooltip from '@material-ui/core/Tooltip';
3
+ import { withStyles } from '@material-ui/core/styles';
4
+ import convert from 'convert-units';
5
+ import {
6
+ BG_COLOR_1,
7
+ DEFAULT_FONT_FAMILY,
8
+ INSTALLATION_SUFFIX_TYPE,
9
+ STATUS_NEGATIVE_COLOR,
10
+ STATUS_NEGATIVE_LIGHT_COLOR,
11
+ STATUS_POSITIVE_COLOR,
12
+ STATUS_WARNING_COLOR,
13
+ STATUS_WARNING_LIGHT_COLOR,
14
+ TEXT_COLOR_NEUTRAL_0,
15
+ TEXT_COLOR_NEUTRAL_2
16
+ } from '../../../../constants';
17
+ import * as S from '../../main/styles';
18
+ import {
19
+ getInstallationSuffix,
20
+ returnReplaceableDeepSearchType
21
+ } from '../../../../components/viewer2d/utils';
22
+ import Skeleton from '@material-ui/lab/Skeleton';
23
+
24
+ const StyledTooltip = withStyles(theme => ({
25
+ tooltip: {
26
+ backgroundColor: TEXT_COLOR_NEUTRAL_0,
27
+ color: BG_COLOR_1,
28
+ maxWidth: 180,
29
+ fontSize: 9,
30
+ fontFamily: DEFAULT_FONT_FAMILY,
31
+ boxShadow:
32
+ '0px 3px 5px -1px rgba(156, 154, 154, 0.2), 0px 6px 10px 0px rgba(156, 154, 154, 0.39), 0px 1px 18px 0px rgba(156, 154, 154, 0.12)',
33
+ padding: '2px 15px'
34
+ }
35
+ }))(Tooltip);
36
+
37
+ export default function ReviewItem({
38
+ downLoad,
39
+ catalog,
40
+ internalSKU,
41
+ categoryData,
42
+ product,
43
+ item,
44
+ count,
45
+ measurementUnit,
46
+ suffix,
47
+ loading
48
+ }) {
49
+ if (loading) {
50
+ return (
51
+ <div
52
+ style={{
53
+ height: 120,
54
+ display: 'flex',
55
+ justifyContent: 'space-between'
56
+ }}
57
+ >
58
+ {downLoad ? (
59
+ <div
60
+ style={{
61
+ width: '100%',
62
+ display: 'inline-flex',
63
+ justifyContent: 'space-between'
64
+ }}
65
+ >
66
+ <S.ReviewQuoteItem style={{ justifyContent: 'left' }}>
67
+ <Skeleton variant="rect" width={50} height={50} />
68
+ <Skeleton variant="text" width={80} height={15} />
69
+ </S.ReviewQuoteItem>
70
+ <S.ReviewQuoteItem style={{ justifyContent: 'right' }}>
71
+ <Skeleton variant="text" width={50} height={18} />
72
+ </S.ReviewQuoteItem>
73
+ </div>
74
+ ) : (
75
+ <>
76
+ <S.ReviewQuoteItem
77
+ style={{
78
+ justifyContent: 'unset',
79
+ width: 310,
80
+ marginLeft: 15,
81
+ gap: '1rem'
82
+ }}
83
+ >
84
+ <Skeleton variant="rect" width={100} height={100} />
85
+ <Skeleton variant="text" width={120} height={30} />
86
+ </S.ReviewQuoteItem>
87
+ <S.ReviewQuoteItem style={{ width: 80 }}>
88
+ <Skeleton variant="rect" width={60} height={30} />
89
+ </S.ReviewQuoteItem>
90
+ <S.ReviewQuoteItem style={{ width: 50 }}>
91
+ <Skeleton variant="text" width={30} height={15} />
92
+ </S.ReviewQuoteItem>
93
+ <S.ReviewQuoteItem style={{ width: 100 }}>
94
+ <Skeleton variant="text" width={50} height={18} />
95
+ </S.ReviewQuoteItem>
96
+ <S.ReviewQuoteItem style={{ width: 100 }}>
97
+ <Skeleton variant="text" width={50} height={18} />
98
+ </S.ReviewQuoteItem>
99
+ <S.ReviewQuoteItem style={{ width: 80, marginRight: 13 }}>
100
+ <Skeleton variant="text" width={50} height={18} />
101
+ </S.ReviewQuoteItem>
102
+ </>
103
+ )}
104
+ </div>
105
+ );
106
+ }
107
+
108
+ let review;
109
+ let doorColor = item.doorStyle;
110
+ if (doorColor.size) {
111
+ doorColor = doorColor.toJS();
112
+ }
113
+
114
+ let doorStyleName = doorColor?.name;
115
+ if (catalog !== undefined) {
116
+ doorColor = {
117
+ ...doorColor,
118
+ install: getInstallationSuffix(
119
+ INSTALLATION_SUFFIX_TYPE.NAME,
120
+ doorColor
121
+ ).toLowerCase()
122
+ };
123
+ const installation = categoryData.data.doorStyles.items.filter(
124
+ it => it.name.toLowerCase() === doorColor?.install?.toLowerCase()
125
+ )[0];
126
+ const doorCategory = installation.items.filter(
127
+ item => (item.name = doorColor.door_style_name)
128
+ )[0];
129
+ review = catalog.elements[item.type];
130
+ if (!review)
131
+ review = catalog.elements[returnReplaceableDeepSearchType(item.type)];
132
+
133
+ const showPositive =
134
+ product?.regular_price &&
135
+ product?.discounted_price &&
136
+ product?.discounted_price !== product?.regular_price;
137
+
138
+ const showWarning =
139
+ product?.regular_price &&
140
+ product?.discounted_price &&
141
+ product?.discounted_price === product?.regular_price &&
142
+ product.tier !== 'retail';
143
+
144
+ const showError =
145
+ !product ||
146
+ (product?.regular_price === 0 && product?.discounted_price === 0);
147
+
148
+ const isDiscounted =
149
+ product?.discounted_price &&
150
+ product?.discounted_price !== product?.regular_price;
151
+
152
+ const getDiscountColor = () => {
153
+ if (showPositive) {
154
+ return STATUS_POSITIVE_COLOR;
155
+ } else if (showWarning) {
156
+ return STATUS_WARNING_COLOR;
157
+ } else if (showError) {
158
+ return STATUS_NEGATIVE_COLOR;
159
+ }
160
+ return TEXT_COLOR_NEUTRAL_2;
161
+ };
162
+
163
+ const getDiscountBackgroundColor = () => {
164
+ if (showWarning) {
165
+ return STATUS_WARNING_LIGHT_COLOR;
166
+ } else if (showError) {
167
+ return STATUS_NEGATIVE_LIGHT_COLOR;
168
+ }
169
+ return BG_COLOR_1;
170
+ };
171
+
172
+ const getDiscountBorderColor = () => {
173
+ if (showWarning) {
174
+ return STATUS_WARNING_COLOR;
175
+ } else if (showError) {
176
+ return STATUS_NEGATIVE_COLOR;
177
+ }
178
+ return BG_COLOR_1;
179
+ };
180
+
181
+ const DiscountedPrice = () => {
182
+ return (
183
+ <S.DistcountedPriceWrapper
184
+ bgColor={getDiscountBackgroundColor()}
185
+ borderHoverColor={getDiscountBorderColor()}
186
+ >
187
+ <S.ReviewQuoteItemLabel
188
+ style={{
189
+ margin: 'unset',
190
+ color: getDiscountColor()
191
+ }}
192
+ >
193
+ {showError && `$0.00`}
194
+ {!showError && !showWarning && !showPositive && <span>-</span>}
195
+ {product?.discounted_price > 0 &&
196
+ product?.discounted_price !== product?.regular_price &&
197
+ `$${product?.discounted_price?.toFixed(2)}`}
198
+ </S.ReviewQuoteItemLabel>
199
+ {showWarning && (
200
+ <StyledTooltip
201
+ style={{ backgroundColor: TEXT_COLOR_NEUTRAL_0 }}
202
+ title="Please contact us for Sale price"
203
+ >
204
+ <img
205
+ style={{ height: 12, marginLeft: 7 }}
206
+ src="\assets\img\svg\lefttoolbar\warning_icon.svg"
207
+ />
208
+ </StyledTooltip>
209
+ )}
210
+ {showError && (
211
+ <StyledTooltip title="This item is not available in the finish you have selected. Please contact us for alternate options in the finish you want.">
212
+ <img
213
+ style={{ height: 12, marginLeft: 7 }}
214
+ src="\assets\img\svg\lefttoolbar\error_icon.svg"
215
+ />
216
+ </StyledTooltip>
217
+ )}
218
+ </S.DistcountedPriceWrapper>
219
+ );
220
+ };
221
+
222
+ return (
223
+ <div
224
+ style={{
225
+ height: 120,
226
+ display: 'flex',
227
+ justifyContent: 'space-between'
228
+ }}
229
+ >
230
+ {downLoad ? (
231
+ <div
232
+ style={{
233
+ width: '100%',
234
+ display: 'inline-flex',
235
+ justifyContent: 'space-between'
236
+ }}
237
+ >
238
+ <S.ReviewQuoteItem style={{ justifyContent: 'left' }}>
239
+ <img
240
+ style={{
241
+ height: 50,
242
+ width: 50
243
+ // boxShadow: '0px 1px 4px rgba(0, 15, 51, 0.30)',
244
+ // marginRight: '10px'
245
+ }}
246
+ src={review.img}
247
+ />
248
+ <S.ReviewQuoteItemLabel
249
+ style={{
250
+ textAlign: 'left',
251
+ color: '#565F77',
252
+ fontSize: '7px'
253
+ }}
254
+ >
255
+ {internalSKU}
256
+ <br />
257
+ W:{' '}
258
+ {Math.round(
259
+ convert(review.info.sizeinfo.width)
260
+ .from('in')
261
+ .to(measurementUnit._unit) * 100
262
+ ) / 100}
263
+ {measurementUnit._unit !== 'in'
264
+ ? measurementUnit._unit
265
+ : '"' + ' '}
266
+ D:{' '}
267
+ {Math.round(
268
+ convert(review.info.sizeinfo.depth)
269
+ .from('in')
270
+ .to(measurementUnit._unit) * 100
271
+ ) / 100}
272
+ {measurementUnit._unit !== 'in'
273
+ ? measurementUnit._unit
274
+ : '"' + ' '}
275
+ H:{' '}
276
+ {Math.round(
277
+ convert(review.info.sizeinfo.height)
278
+ .from('in')
279
+ .to(measurementUnit._unit) * 100
280
+ ) / 100}
281
+ {measurementUnit._unit !== 'in' ? measurementUnit._unit : '"'}
282
+ </S.ReviewQuoteItemLabel>
283
+ </S.ReviewQuoteItem>
284
+ <S.ReviewQuoteItem style={{ justifyContent: 'right' }}>
285
+ <S.ReviewQuoteItemLabel
286
+ style={{
287
+ fontSize: '7px',
288
+ color:
289
+ product?.discounted_price === 0
290
+ ? STATUS_NEGATIVE_COLOR
291
+ : '#565F77'
292
+ }}
293
+ >
294
+ {isDiscounted
295
+ ? `$${(product?.discounted_price * (count || 1))?.toFixed(2)}`
296
+ : product?.regular_price?.toFixed(2)
297
+ ? `$${(product?.regular_price * (count || 1))?.toFixed(2)}`
298
+ : '$0.00'}
299
+ </S.ReviewQuoteItemLabel>
300
+ </S.ReviewQuoteItem>
301
+ </div>
302
+ ) : (
303
+ <>
304
+ <S.ReviewQuoteItem
305
+ style={{ justifyContent: 'unset', width: 310, marginLeft: 15 }}
306
+ >
307
+ <img
308
+ style={{
309
+ width: 100,
310
+ height: 100
311
+ }}
312
+ src={review.img}
313
+ />
314
+ <S.ReviewQuoteItemLabel style={{ textAlign: 'left' }}>
315
+ SKU: {internalSKU} <br />
316
+ Width:{' '}
317
+ {Math.round(
318
+ convert(review.info.sizeinfo.width)
319
+ .from('in')
320
+ .to(measurementUnit._unit) * 100
321
+ ) / 100}
322
+ {measurementUnit._unit !== 'in'
323
+ ? measurementUnit._unit
324
+ : '"' + ' '}
325
+ Depth:{' '}
326
+ {Math.round(
327
+ convert(review.info.sizeinfo.depth)
328
+ .from('in')
329
+ .to(measurementUnit._unit) * 100
330
+ ) / 100}
331
+ {measurementUnit._unit !== 'in'
332
+ ? measurementUnit._unit
333
+ : '"' + ' '}
334
+ Height:{' '}
335
+ {Math.round(
336
+ convert(review.info.sizeinfo.height)
337
+ .from('in')
338
+ .to(measurementUnit._unit) * 100
339
+ ) / 100}
340
+ {measurementUnit._unit !== 'in' ? measurementUnit._unit : '"'}
341
+ </S.ReviewQuoteItemLabel>
342
+ </S.ReviewQuoteItem>
343
+ <S.ReviewQuoteItem style={{ width: 80 }}>
344
+ <div
345
+ style={{
346
+ width: '100%',
347
+ display: 'flex',
348
+ justifyContent: 'space-evenly'
349
+ }}
350
+ >
351
+ <StyledTooltip
352
+ style={{
353
+ backgroundColor: TEXT_COLOR_NEUTRAL_0,
354
+ fontSize: 18
355
+ }}
356
+ title={
357
+ <span>
358
+ Installation: <strong>{installation.name}</strong>
359
+ </span>
360
+ }
361
+ >
362
+ <img
363
+ style={{ width: 30, height: 30, padding: 3 }}
364
+ src={installation?.thumbnail}
365
+ />
366
+ </StyledTooltip>
367
+ <StyledTooltip
368
+ style={{
369
+ backgroundColor: TEXT_COLOR_NEUTRAL_0,
370
+ fontSize: 18
371
+ }}
372
+ title={
373
+ <span>
374
+ Door Style: <strong>{doorStyleName}</strong>
375
+ </span>
376
+ }
377
+ >
378
+ <img
379
+ style={{ width: 30, height: 30 }}
380
+ src={doorCategory?.thumbnail}
381
+ />
382
+ </StyledTooltip>
383
+ </div>
384
+ </S.ReviewQuoteItem>
385
+ <S.ReviewQuoteItem style={{ width: 50 }}>
386
+ <S.ReviewQuoteItemLabel style={{ margin: 'unset' }}>
387
+ {count || 1}
388
+ </S.ReviewQuoteItemLabel>
389
+ </S.ReviewQuoteItem>
390
+ <S.ReviewQuoteItem style={{ width: 100 }}>
391
+ <S.ReviewQuoteItemLabel
392
+ style={{
393
+ margin: 'unset',
394
+ color: TEXT_COLOR_NEUTRAL_2
395
+ }}
396
+ >
397
+ {product?.regular_price
398
+ ? `$${product?.regular_price?.toFixed(2)}`
399
+ : '$0.00'}
400
+ </S.ReviewQuoteItemLabel>
401
+ </S.ReviewQuoteItem>
402
+ <S.ReviewQuoteItem style={{ width: 100 }}>
403
+ <DiscountedPrice />
404
+ </S.ReviewQuoteItem>
405
+ <S.ReviewQuoteItem style={{ width: 80, marginRight: 13 }}>
406
+ <S.ReviewQuoteItemLabel
407
+ style={{
408
+ margin: 'unset',
409
+ color:
410
+ product?.discounted_price === 0 && STATUS_NEGATIVE_COLOR
411
+ }}
412
+ >
413
+ {isDiscounted
414
+ ? `$${(product?.discounted_price * (count || 1))?.toFixed(2)}`
415
+ : product?.regular_price?.toFixed(2)
416
+ ? `$${(product?.regular_price * (count || 1))?.toFixed(2)}`
417
+ : '$0.00'}
418
+ </S.ReviewQuoteItemLabel>
419
+ </S.ReviewQuoteItem>
420
+ </>
421
+ )}
422
+ </div>
423
+ );
424
+ } else {
425
+ null;
426
+ }
427
+ }