kitchen-simulator 5.0.0-test.18 → 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 (179) hide show
  1. package/package.json +8 -26
  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 -3
  7. package/src/components/catalog-view/catalog-breadcrumb.jsx +53 -0
  8. package/src/components/catalog-view/catalog-item.jsx +229 -0
  9. package/src/components/catalog-view/catalog-list.jsx +173 -0
  10. package/src/components/catalog-view/catalog-page-item.jsx +110 -0
  11. package/src/components/catalog-view/catalog-turn-back-page-item.jsx +80 -0
  12. package/src/components/configurator/custom-configurator.jsx +77 -0
  13. package/src/components/configurator/project-configurator.jsx +120 -0
  14. package/src/components/export.js +36 -0
  15. package/src/components/firstsetting/button/styles.js +223 -0
  16. package/src/components/firstsetting/export.js +9 -0
  17. package/src/components/firstsetting/firstsetting-content-button.jsx +198 -0
  18. package/src/components/firstsetting/firstsetting-toggle-button.jsx +101 -0
  19. package/src/components/firstsetting/firstsetting.jsx +814 -0
  20. package/src/components/footerbar/button/ControlButton.jsx +43 -0
  21. package/src/components/footerbar/button/DirectionButton.jsx +54 -0
  22. package/src/components/footerbar/button/DirectionPanSpinButton.jsx +36 -0
  23. package/src/components/footerbar/button/ToggleButton.jsx +58 -0
  24. package/src/components/footerbar/button/ToggleConvertButton.jsx +48 -0
  25. package/src/components/footerbar/button/ToggleMeasureButton.jsx +33 -0
  26. package/src/components/footerbar/button/styles.js +217 -0
  27. package/src/components/footerbar/export.js +9 -0
  28. package/src/components/footerbar/footer-content-button.jsx +198 -0
  29. package/src/components/footerbar/footer-toggle-button.jsx +101 -0
  30. package/src/components/footerbar/footerbar.jsx +1103 -0
  31. package/src/components/footerbar/styles.js +263 -0
  32. package/src/components/header/button/MenuButton.jsx +46 -0
  33. package/src/components/header/button/SaveButton.jsx +54 -0
  34. package/src/components/header/button/styles.js +181 -0
  35. package/src/components/header/export.js +5 -0
  36. package/src/components/header/header.jsx +631 -0
  37. package/src/components/header/header.style.css +47 -0
  38. package/src/components/header/styles.js +320 -0
  39. package/src/components/login/Login.js +77 -0
  40. package/src/components/login/LoginForm/index.js +108 -0
  41. package/src/components/login/Register.js +82 -0
  42. package/src/components/login/RegisterForm/index.js +171 -0
  43. package/src/components/login/jwtService.js +201 -0
  44. package/src/components/login/style.css +158 -0
  45. package/src/components/login/style.scss +260 -0
  46. package/src/components/myprojects/export.js +5 -0
  47. package/src/components/myprojects/index.jsx +445 -0
  48. package/src/components/myprojects/styles.js +241 -0
  49. package/src/components/sidebar/custom-accordion.jsx +48 -0
  50. package/src/components/sidebar/export.js +15 -0
  51. package/src/components/sidebar/panel-element-editor/attributes-editor/attributes-editor.jsx +73 -0
  52. package/src/components/sidebar/panel-element-editor/attributes-editor/confirm-popup.jsx +101 -0
  53. package/src/components/sidebar/panel-element-editor/attributes-editor/hole-attributes-editor.jsx +149 -0
  54. package/src/components/sidebar/panel-element-editor/attributes-editor/item-attributes-editor.jsx +316 -0
  55. package/src/components/sidebar/panel-element-editor/attributes-editor/line-attributes-editor.jsx +108 -0
  56. package/src/components/sidebar/panel-element-editor/element-editor.jsx +1070 -0
  57. package/src/components/sidebar/panel-element-editor/multi-elements-editor.jsx +0 -0
  58. package/src/components/sidebar/panel-element-editor/panel-element-editor.jsx +104 -0
  59. package/src/components/sidebar/panel-element-editor/panel-multi-elements-editor.jsx +155 -0
  60. package/src/components/sidebar/panel-group-editor.jsx +272 -0
  61. package/src/components/sidebar/panel-groups.jsx +310 -0
  62. package/src/components/sidebar/panel-guides.jsx +192 -0
  63. package/src/components/sidebar/panel-layer-elements.jsx +298 -0
  64. package/src/components/sidebar/panel-layers.jsx +381 -0
  65. package/src/components/sidebar/panel.jsx +71 -0
  66. package/src/components/sidebar/sidebar.jsx +106 -0
  67. package/src/components/sidebar/toolbar-panel.jsx +139 -0
  68. package/src/components/sign/export.js +7 -0
  69. package/src/components/sign/main/index.jsx +523 -0
  70. package/src/components/sign/main/styles.js +163 -0
  71. package/src/components/toolbar/button/ControlButton.jsx +41 -0
  72. package/src/components/toolbar/button/DirectionButton.jsx +34 -0
  73. package/src/components/toolbar/button/RightButton.jsx +103 -0
  74. package/src/components/toolbar/button/ToggleButton.jsx +41 -0
  75. package/src/components/toolbar/button/index.jsx +55 -0
  76. package/src/components/toolbar/button/styles.js +127 -0
  77. package/src/components/toolbar/components/DoorStyleMenu.jsx +103 -0
  78. package/src/components/toolbar/components/Pricing.jsx +126 -0
  79. package/src/components/toolbar/components/ReviewForQuote.jsx +635 -0
  80. package/src/components/toolbar/export.js +21 -0
  81. package/src/components/toolbar/main/Alert.js +122 -0
  82. package/src/components/toolbar/main/TakePictureModal.jsx +104 -0
  83. package/src/components/toolbar/main/confirm-popup.jsx +99 -0
  84. package/src/components/toolbar/main/index.jsx +5627 -0
  85. package/src/components/toolbar/main/lShaped.json +311 -0
  86. package/src/components/toolbar/main/longNarrow.json +238 -0
  87. package/src/components/toolbar/main/myComponents.js +123 -0
  88. package/src/components/toolbar/main/oRectangle.json +220 -0
  89. package/src/components/toolbar/main/rectangle.json +238 -0
  90. package/src/components/toolbar/main/style.css +107 -0
  91. package/src/components/toolbar/main/styles.js +696 -0
  92. package/src/components/toolbar/plugin-item.jsx +123 -0
  93. package/src/components/toolbar/popup/appliance/appliance-category/index.jsx +73 -0
  94. package/src/components/toolbar/popup/appliance/choose-appliance/index.jsx +102 -0
  95. package/src/components/toolbar/popup/appliance/index.jsx +83 -0
  96. package/src/components/toolbar/popup/autosaveprompt/index.jsx +150 -0
  97. package/src/components/toolbar/popup/autosaveprompt/styles.css +64 -0
  98. package/src/components/toolbar/popup/autosaveprompt/styles.js +40 -0
  99. package/src/components/toolbar/popup/cabinet/cabinet-category/index.jsx +73 -0
  100. package/src/components/toolbar/popup/cabinet/choose-product/index.jsx +119 -0
  101. package/src/components/toolbar/popup/cabinet/index.jsx +85 -0
  102. package/src/components/toolbar/popup/doorStyle/choose-style/index.jsx +63 -0
  103. package/src/components/toolbar/popup/doorStyle/index.jsx +71 -0
  104. package/src/components/toolbar/popup/doorStyle/style-category/index.jsx +139 -0
  105. package/src/components/toolbar/popup/downloadsummary/downloadSummaryContext.js +2 -0
  106. package/src/components/toolbar/popup/downloadsummary/downloadSummaryTemp.jsx +157 -0
  107. package/src/components/toolbar/popup/downloadsummary/index.jsx +643 -0
  108. package/src/components/toolbar/popup/downloadsummary/show2D/show2DView.jsx +51 -0
  109. package/src/components/toolbar/popup/downloadsummary/show2D/viewer2DDownLoad.jsx +175 -0
  110. package/src/components/toolbar/popup/downloadsummary/show3D/show3DView.jsx +283 -0
  111. package/src/components/toolbar/popup/downloadsummary/show3D/viewer3DDownLoad.jsx +2257 -0
  112. package/src/components/toolbar/popup/downloadsummary/showCabinetInfo.js +93 -0
  113. package/src/components/toolbar/popup/downloadsummary/showElevation/showElevationView.jsx +132 -0
  114. package/src/components/toolbar/popup/downloadsummary/showElevation/viewer3DElevationDownload.jsx +2198 -0
  115. package/src/components/toolbar/popup/downloadsummary/showElevation/viewerElevationDownload.jsx +152 -0
  116. package/src/components/toolbar/popup/downloadsummary/showWarranty.jsx +149 -0
  117. package/src/components/toolbar/popup/downloadsummary/styles.css +177 -0
  118. package/src/components/toolbar/popup/downloadsummary/styles.js +453 -0
  119. package/src/components/toolbar/popup/finishingtouch/category/index.jsx +34 -0
  120. package/src/components/toolbar/popup/finishingtouch/index.jsx +58 -0
  121. package/src/components/toolbar/popup/finishingtouch/material-edit.jsx +112 -0
  122. package/src/components/toolbar/popup/finishingtouch/product/index.jsx +116 -0
  123. package/src/components/toolbar/popup/floorplan/choose-floor/confirm-popup.jsx +101 -0
  124. package/src/components/toolbar/popup/floorplan/choose-floor/index.jsx +254 -0
  125. package/src/components/toolbar/popup/floorplan/choose-floor/lShaped.json +311 -0
  126. package/src/components/toolbar/popup/floorplan/choose-floor/longNarrow.json +238 -0
  127. package/src/components/toolbar/popup/floorplan/choose-floor/oRectangle.json +220 -0
  128. package/src/components/toolbar/popup/floorplan/choose-floor/rectangle.json +238 -0
  129. package/src/components/toolbar/popup/floorplan/choose-floor/styles.js +86 -0
  130. package/src/components/toolbar/popup/floorplan/floor-category/index.jsx +109 -0
  131. package/src/components/toolbar/popup/floorplan/index.jsx +60 -0
  132. package/src/components/toolbar/popup/index.jsx +241 -0
  133. package/src/components/toolbar/popup/newproject/index.jsx +59 -0
  134. package/src/components/toolbar/popup/newproject/styles.css +64 -0
  135. package/src/components/toolbar/popup/newproject/styles.js +41 -0
  136. package/src/components/toolbar/popup/product/appliance.jsx +54 -0
  137. package/src/components/toolbar/popup/product/cabinetproduct.jsx +15 -0
  138. package/src/components/toolbar/popup/product/doorstyle.jsx +58 -0
  139. package/src/components/toolbar/popup/product/doorstyleproduct.jsx +47 -0
  140. package/src/components/toolbar/popup/product/floor.jsx +36 -0
  141. package/src/components/toolbar/popup/product/floorproduct.jsx +42 -0
  142. package/src/components/toolbar/popup/product/index.jsx +36 -0
  143. package/src/components/toolbar/popup/product/primary.jsx +77 -0
  144. package/src/components/toolbar/popup/product/productline.jsx +93 -0
  145. package/src/components/toolbar/popup/product/reviewItem.jsx +427 -0
  146. package/src/components/toolbar/popup/product/reviewMolding.jsx +310 -0
  147. package/src/components/toolbar/popup/product/style.css +54 -0
  148. package/src/components/toolbar/popup/product/styles.js +260 -0
  149. package/src/components/toolbar/popup/savedesign/FullPictureForm.jsx +146 -0
  150. package/src/components/toolbar/popup/savedesign/index.jsx +495 -0
  151. package/src/components/toolbar/popup/savedesign/savedesign.style.css +16 -0
  152. package/src/components/toolbar/popup/savedesign/styles.js +151 -0
  153. package/src/components/toolbar/popup/setDoorStyleOption/index.jsx +87 -0
  154. package/src/components/toolbar/popup/styles.js +909 -0
  155. package/src/components/toolbar/popup/submitforquote/AddToCartOptions.jsx +192 -0
  156. package/src/components/toolbar/popup/submitforquote/CustomerRequestsForm.jsx +96 -0
  157. package/src/components/toolbar/popup/submitforquote/SkipDesignerReview.jsx +54 -0
  158. package/src/components/toolbar/popup/submitforquote/StepDots.jsx +25 -0
  159. package/src/components/toolbar/popup/submitforquote/cart-choice.jsx +116 -0
  160. package/src/components/toolbar/popup/submitforquote/doorstyle-menus.js +38 -0
  161. package/src/components/toolbar/popup/submitforquote/index.jsx +698 -0
  162. package/src/components/toolbar/popup/submitforquote/styles.css +105 -0
  163. package/src/components/toolbar/popup/submitforquote/styles.js +294 -0
  164. package/src/components/toolbar/popup/submitprompt/index.jsx +89 -0
  165. package/src/components/toolbar/popup/submitprompt/styles.css +64 -0
  166. package/src/components/toolbar/popup/submitprompt/styles.js +42 -0
  167. package/src/components/toolbar/toolbar-button.jsx +90 -0
  168. package/src/components/toolbar/toolbar-load-button.jsx +36 -0
  169. package/src/components/toolbar/toolbar-save-button.jsx +32 -0
  170. package/src/components/wizardstep/button/styles.js +677 -0
  171. package/src/components/wizardstep/export.js +5 -0
  172. package/src/components/wizardstep/index.jsx +1372 -0
  173. package/src/components/wizardstep/styles.js +688 -0
  174. package/src/components/wizardstep/wizardstep-content-button.jsx +198 -0
  175. package/src/components/wizardstep/wizardstep-toggle-button.jsx +101 -0
  176. package/src/{_index.js → index.js} +4 -4
  177. package/src/renderer.jsx +466 -0
  178. package/src/actions/_export.js +0 -35
  179. package/src/components/_export.js +0 -11
@@ -0,0 +1,41 @@
1
+ import React, { Component } from 'react';
2
+ import PropTypes from 'prop-types';
3
+ import * as SharedStyle from '../../../shared-style';
4
+ import * as S from './styles';
5
+
6
+ export default class ControlButton extends Component {
7
+ constructor(props, context) {
8
+ super(props, context);
9
+ this.state = { hover: false };
10
+ }
11
+
12
+ render() {
13
+ let { state, props } = this;
14
+ let overlayStyle = {};
15
+ if (state.hover) overlayStyle = { ...overlayStyle, display: 'block' };
16
+
17
+ return (
18
+ <S.Control
19
+ onMouseOver={event => this.setState({ hover: true })}
20
+ onMouseOut={event => this.setState({ hover: false })}
21
+ onClick={props.onClick}
22
+ >
23
+ {[
24
+ props.title !== undefined ? (
25
+ <S.ControlTitle key={props.title}>{props.title}</S.ControlTitle>
26
+ ) : null,
27
+ props.icon !== undefined ? (
28
+ <S.ControlIcon key={props.icon}>{props.icon}</S.ControlIcon>
29
+ ) : null
30
+ ]}
31
+ </S.Control>
32
+ );
33
+ }
34
+ }
35
+
36
+ ControlButton.propTypes = {
37
+ title: PropTypes.string,
38
+ hover: PropTypes.bool,
39
+ active: PropTypes.bool.isRequired,
40
+ onClick: PropTypes.func
41
+ };
@@ -0,0 +1,34 @@
1
+ import React, { Component } from 'react';
2
+ import PropTypes from 'prop-types';
3
+ import * as SharedStyle from '../../../shared-style';
4
+ import * as S from './styles';
5
+
6
+ export default class DirectionButton extends Component {
7
+ constructor(props, context) {
8
+ super(props, context);
9
+ }
10
+
11
+ render() {
12
+ let { props } = this;
13
+ let overlayStyle = {};
14
+ overlayStyle = props.active
15
+ ? { ...overlayStyle, background: SharedStyle.TOOLBAR_COLOR.active }
16
+ : { ...overlayStyle };
17
+ return (
18
+ <S.DirectionIcon
19
+ style={props.style}
20
+ onClick={props.onClick}
21
+ key={props.icon}
22
+ >
23
+ {props.icon}
24
+ </S.DirectionIcon>
25
+ );
26
+ }
27
+ }
28
+
29
+ DirectionButton.propTypes = {
30
+ title: PropTypes.string,
31
+ hover: PropTypes.bool,
32
+ active: PropTypes.bool.isRequired,
33
+ onClick: PropTypes.func
34
+ };
@@ -0,0 +1,103 @@
1
+ import React, { Component } from 'react';
2
+ import PropTypes from 'prop-types';
3
+ import * as S from './styles';
4
+
5
+ export default class RightButton extends Component {
6
+ constructor(props, context) {
7
+ super(props, context);
8
+ this.state = { hover: false };
9
+ }
10
+
11
+ render() {
12
+ let { state, props } = this;
13
+ let overlayStyle = {};
14
+ if (state.hover) overlayStyle = { ...overlayStyle, display: 'block' };
15
+ if (props.active) overlayStyle = { ...overlayStyle, display: 'block' };
16
+ return (
17
+ <S.rMain
18
+ onMouseOver={event => this.setState({ hover: true })}
19
+ onMouseOut={event => this.setState({ hover: false })}
20
+ onClick={props.onClick}
21
+ >
22
+ <S.rightIcon>{props.icon}</S.rightIcon>
23
+
24
+ <S.rOverlay style={{ ...overlayStyle }}>
25
+ <img width="40px" src={props.src} />
26
+ <S.rTitle>{props.title}</S.rTitle>
27
+ </S.rOverlay>
28
+ {/* {
29
+ state.active ?
30
+ <div style={STYLE_TOOLTIP}>
31
+ <span style={STYLE_TOOLTIP_PIN} />
32
+ {props.tooltip}
33
+ </div>
34
+ : null
35
+ } */}
36
+ </S.rMain>
37
+ );
38
+ }
39
+ }
40
+
41
+ RightButton.propTypes = {
42
+ title: PropTypes.string,
43
+ hover: PropTypes.bool,
44
+ onClick: PropTypes.func
45
+ };
46
+
47
+ export class RightTextButton extends Component {
48
+ constructor(props, context) {
49
+ super(props, context);
50
+ this.state = { hover: false };
51
+ }
52
+
53
+ render() {
54
+ let { state, props } = this;
55
+ return (
56
+ <S.rMain
57
+ onMouseOver={event => this.setState({ hover: true })}
58
+ onMouseOut={event => this.setState({ hover: false })}
59
+ onClick={props.onClick}
60
+ >
61
+ <S.rightIcon>{props.icon}</S.rightIcon>
62
+
63
+ {state.hover ? (
64
+ <S.rOverlay style={{ display: 'block' }}>
65
+ <img width="40px" src={props.src} />
66
+ <S.rTitle
67
+ style={{ top: '20px', paddingTop: '7px', paddingBottom: '7px' }}
68
+ >
69
+ {props.title}
70
+ </S.rTitle>
71
+ </S.rOverlay>
72
+ ) : (
73
+ <S.rOverlay style={{ display: 'block' }}>
74
+ <S.rTitle
75
+ style={{
76
+ color: 'black',
77
+ top: '20px',
78
+ paddingTop: '7px',
79
+ paddingBottom: '7px'
80
+ }}
81
+ >
82
+ {props.title}
83
+ </S.rTitle>
84
+ </S.rOverlay>
85
+ )}
86
+ {/* {
87
+ state.active ?
88
+ <div style={STYLE_TOOLTIP}>
89
+ <span style={STYLE_TOOLTIP_PIN} />
90
+ {props.tooltip}
91
+ </div>
92
+ : null
93
+ } */}
94
+ </S.rMain>
95
+ );
96
+ }
97
+ }
98
+
99
+ RightTextButton.propTypes = {
100
+ title: PropTypes.string,
101
+ hover: PropTypes.bool,
102
+ onClick: PropTypes.func
103
+ };
@@ -0,0 +1,41 @@
1
+ import React, { Component } from 'react';
2
+ import PropTypes from 'prop-types';
3
+ import * as SharedStyle from '../../../shared-style';
4
+ import { MODE_IDLE_3D } from '../../../constants';
5
+ import * as S from './styles';
6
+
7
+ export default class ToggleButton extends Component {
8
+ constructor(props, context) {
9
+ super(props, context);
10
+ }
11
+
12
+ render() {
13
+ let { props } = this;
14
+ let overlayStyle = {};
15
+ let activeStyle =
16
+ props.settingMode === MODE_IDLE_3D || props.active
17
+ ? { paddingRight: '30px', paddingBottom: '2px' }
18
+ : { paddingLeft: '30px', paddingBottom: '2px' };
19
+ return (
20
+ <S.Toggle style={{ ...overlayStyle }} onClick={props.onClick}>
21
+ {[
22
+ props.title !== undefined ? (
23
+ <S.ControlTitle key={props.title}>{props.title}</S.ControlTitle>
24
+ ) : null,
25
+ props.icon !== undefined ? (
26
+ <S.ToggleIcon style={{ ...activeStyle }} key={props.icon}>
27
+ {props.icon}
28
+ </S.ToggleIcon>
29
+ ) : null
30
+ ]}
31
+ </S.Toggle>
32
+ );
33
+ }
34
+ }
35
+
36
+ ToggleButton.propTypes = {
37
+ title: PropTypes.string,
38
+ hover: PropTypes.bool,
39
+ active: PropTypes.bool.isRequired,
40
+ onClick: PropTypes.func
41
+ };
@@ -0,0 +1,55 @@
1
+ import React, { Component } from 'react';
2
+ import PropTypes from 'prop-types';
3
+
4
+ import * as S from './styles';
5
+
6
+ //http://www.cssportal.com/css-tooltip-generator/
7
+
8
+ export default class ToolbarButton extends Component {
9
+ constructor(props, context) {
10
+ super(props, context);
11
+ this.state = { hover: false };
12
+ }
13
+
14
+ render() {
15
+ let { state, props } = this;
16
+ const { active, onClick, children, src, title, ...otherProps } = props;
17
+ let overlayStyle = {};
18
+ if (state.hover) overlayStyle = { ...overlayStyle, display: 'block' };
19
+ // overlayStyle = { ...overlayStyle, 'display': 'block', 'background': SharedStyle.TOOLBAR_COLOR.focus }
20
+
21
+ if (props.active) overlayStyle = { ...overlayStyle, display: 'block' };
22
+ // overlayStyle = { ...overlayStyle, 'display': 'block', 'background': SharedStyle.TOOLBAR_COLOR.active }
23
+ return (
24
+ <S.Main
25
+ {...otherProps}
26
+ onMouseOver={event => this.setState({ hover: true })}
27
+ onMouseOut={event => this.setState({ hover: false })}
28
+ onClick={props.onClick}
29
+ >
30
+ <div>{props.children}</div>
31
+
32
+ <S.Overlay style={{ ...overlayStyle }}>
33
+ <img width="75px" src={props.src} />
34
+ <S.Title>{props.title}</S.Title>
35
+ </S.Overlay>
36
+ {/* {
37
+ state.active ?
38
+ <div style={STYLE_TOOLTIP}>
39
+ <span style={STYLE_TOOLTIP_PIN} />
40
+ {props.tooltip}
41
+ </div>
42
+ : null
43
+ } */}
44
+ </S.Main>
45
+ );
46
+ }
47
+ }
48
+
49
+ ToolbarButton.propTypes = {
50
+ title: PropTypes.string,
51
+ hover: PropTypes.bool,
52
+ active: PropTypes.bool.isRequired,
53
+ tooltip: PropTypes.string.isRequired,
54
+ onClick: PropTypes.func
55
+ };
@@ -0,0 +1,127 @@
1
+ import styled from 'styled-components';
2
+
3
+ export const Main = styled.div`
4
+ z-index: 6;
5
+ width: 75px;
6
+ height: 75px;
7
+ display: flex;
8
+ align-items: center;
9
+ justify-content: center;
10
+ font-size: 0px;
11
+ position: relative;
12
+ cursor: pointer;
13
+ background: #d3e7e5;
14
+ box-shadow: 3px 1px 3px 0px rgba(0, 0, 0, 0.2),
15
+ -1px -1px 1px 0px rgba(0, 0, 0, 0.14), 0px 2px 1px -1px rgba(0, 0, 0, 0.12);
16
+ `;
17
+ export const rightIcon = styled.div`
18
+ img {
19
+ box-shadow: 3px 1px 3px 0px rgba(0, 0, 0, 0.2),
20
+ -1px -1px 1px 0px rgba(0, 0, 0, 0.14),
21
+ 0px 2px 1px -1px rgba(0, 0, 0, 0.12);
22
+ border-radius: 8%;
23
+ }
24
+ `;
25
+ export const Overlay = styled.div`
26
+ position: absolute;
27
+ top: 0px;
28
+ left: 0px;
29
+ bottom: 0px;
30
+ width: 100%;
31
+ text-align: center;
32
+ background: rgba(0, 0, 0, 0.5);
33
+ display: none;
34
+ `;
35
+ export const Title = styled.span`
36
+ position: absolute;
37
+ top: 51%;
38
+ left: 0px;
39
+ width: 100%;
40
+ color: #fff;
41
+ text-transform: uppercase;
42
+ transform: translate(0%, -50%);
43
+ font-size: 11px;
44
+ `;
45
+ export const rMain = styled.div`
46
+ width: 40px;
47
+ display: inline-block;
48
+ align-items: center;
49
+ justify-content: center;
50
+ margin-right: 14px;
51
+ position: relative;
52
+ cursor: pointer;
53
+ `;
54
+ export const rOverlay = styled.div`
55
+ position: absolute;
56
+ top: 0px;
57
+ left: 0px;
58
+ bottom: 0px;
59
+ width: 100%;
60
+ text-align: center;
61
+ display: none;
62
+ `;
63
+ export const rTitle = styled.span`
64
+ position: absolute;
65
+ top: 45%;
66
+ left: 1px;
67
+ width: 100%;
68
+ color: #fff;
69
+ text-transform: uppercase;
70
+ transform: translate(0%, -50%);
71
+
72
+ @media screen and (min-width: 1024) {
73
+ font-size: 11px;
74
+ }
75
+ @media screen and (max-width: 1024) {
76
+ font-size: 11px;
77
+ }
78
+ @media screen and (min-width: 1366) {
79
+ font-size: 13px;
80
+ }
81
+ @media screen and (max-width: 1366) {
82
+ font-size: 13px;
83
+ }
84
+ @media screen and (min-width: 1440) {
85
+ font-size: 16px;
86
+ }
87
+ @media screen and (max-width: 1440) {
88
+ font-size: 16px;
89
+ }
90
+ `;
91
+
92
+ export const Toggle = styled.div`
93
+ display: flex;
94
+ align-items: center;
95
+ position: relative;
96
+ height: 36px;
97
+ margin-left: 20px;
98
+ justify-content: center;
99
+ font-size: 14px;
100
+ cursor: pointer;
101
+ -webkit-user-select: none;
102
+ -moz-user-select: none;
103
+ -ms-user-select: none;
104
+ user-select: none;
105
+ :hover {
106
+ box-shadow: 0px 3px 5px -1px rgba(156, 154, 154, 0.2),
107
+ 0px 6px 10px 0px rgba(156, 154, 154, 0.39),
108
+ 0px 1px 18px 0px rgba(156, 154, 154, 0.12);
109
+ border-radius: 18px;
110
+ }
111
+ `;
112
+
113
+ export const ToggleIcon = styled.div`
114
+ ${'' /* transition-duration: .3s; */}
115
+ position: absolute;
116
+ top: 0px;
117
+ img {
118
+ font-size: 1.4rem;
119
+ box-sizing: border-box;
120
+ border-radius: 50%;
121
+ }
122
+ `;
123
+
124
+ export const ControlTitle = styled.span`
125
+ margin: 10px;
126
+ font-size: 12px;
127
+ `;
@@ -0,0 +1,103 @@
1
+ import React from 'react';
2
+ import { FormControl, InputLabel, Select, MenuItem } from '@material-ui/core';
3
+ import { makeStyles } from '@material-ui/core/styles';
4
+
5
+ const useStyles = makeStyles({
6
+ selectRoot: {
7
+ display: 'flex',
8
+ alignItems: 'center',
9
+ gap: '0.5rem',
10
+ color: 'rgb(76, 18, 161)',
11
+ fontWeight: 600,
12
+ fontSize: '14px'
13
+ },
14
+ inputLabel: {
15
+ color: 'black'
16
+ }
17
+ });
18
+
19
+ const DoorStyleMenu = ({
20
+ selected,
21
+ data,
22
+ onChange,
23
+ getValue,
24
+ placeholder,
25
+ iconStyle
26
+ }) => {
27
+ const classes = useStyles();
28
+
29
+ if (!data || !data.length) return null;
30
+
31
+ return (
32
+ <FormControl fullWidth variant="outlined">
33
+ {placeholder && (
34
+ <InputLabel className={classes.inputLabel}>{placeholder}</InputLabel>
35
+ )}
36
+ <Select
37
+ value={selected}
38
+ onChange={e => onChange(e.target.value)}
39
+ label={placeholder}
40
+ classes={{ root: classes.selectRoot }}
41
+ renderValue={value => {
42
+ if (!value) {
43
+ return <span style={{ color: 'rgba(86, 95, 119, 1)' }}>Any</span>;
44
+ }
45
+ const selectedItem = data.find(item => getValue(item) === value.name);
46
+ if (!selectedItem)
47
+ return <span style={{ color: 'rgba(86, 95, 119, 1)' }}>Any</span>;
48
+ return (
49
+ <span
50
+ style={{
51
+ display: 'flex',
52
+ alignItems: 'center',
53
+ gap: '0.5rem',
54
+ width: '100%'
55
+ }}
56
+ >
57
+ <span>{selectedItem.name}</span>
58
+ <img
59
+ style={
60
+ iconStyle && {
61
+ ...iconStyle
62
+ }
63
+ }
64
+ height="20"
65
+ src={selectedItem.thumbnail}
66
+ alt=""
67
+ />
68
+ </span>
69
+ );
70
+ }}
71
+ >
72
+ <MenuItem value={''}>
73
+ <span style={{ color: 'rgba(86, 95, 119, 1)' }}>Any</span>
74
+ </MenuItem>
75
+ {data.map((item, key) => (
76
+ <MenuItem
77
+ classes={{ root: classes.selectRoot }}
78
+ key={key}
79
+ value={getValue(item)}
80
+ >
81
+ <font size="2">{item.name}</font>
82
+ <img
83
+ style={
84
+ iconStyle && {
85
+ ...iconStyle
86
+ }
87
+ }
88
+ height="20"
89
+ src={item.thumbnail}
90
+ alt=""
91
+ />
92
+ </MenuItem>
93
+ ))}
94
+ </Select>
95
+ </FormControl>
96
+ );
97
+ };
98
+
99
+ DoorStyleMenu.defaultProps = {
100
+ getValue: it => it.name
101
+ };
102
+
103
+ export default DoorStyleMenu;
@@ -0,0 +1,126 @@
1
+ import React from 'react';
2
+ import Skeleton from '@material-ui/lab/Skeleton';
3
+ import * as PS from '../popup/styles';
4
+ import { TEXT_COLOR_NEUTRAL_0 } from '../../../../src/constants';
5
+ import { useGetPricesBySku } from '../../../../src/hooks/useGetPricesBySku';
6
+ import { useValidateToken } from '../../../../src/hooks/useValidateToken';
7
+
8
+ export const Pricing = ({ internalSKU, accessToken }) => {
9
+ const { data } = useValidateToken(accessToken);
10
+
11
+ const {
12
+ data: { prices = [] },
13
+ isFetching
14
+ } = useGetPricesBySku(data?.source === 'none' ? [] : [internalSKU]);
15
+
16
+ if (isFetching || data?.source === 'none') {
17
+ return (
18
+ <React.Fragment>
19
+ <PS.DesignValue
20
+ style={{
21
+ fontSize: 16,
22
+ margin: '10px 0',
23
+ fontWeight: 600,
24
+ marginBottom: 0
25
+ }}
26
+ >
27
+ <Skeleton variant="text" width={80} height={24} />
28
+ </PS.DesignValue>
29
+ <span
30
+ style={{
31
+ display: 'flex',
32
+ justifyContent: 'space-between',
33
+ marginBottom: 5
34
+ }}
35
+ >
36
+ <Skeleton variant="text" width={100} height={20} />
37
+ <Skeleton variant="text" width={60} height={20} />
38
+ </span>
39
+ <span
40
+ style={{
41
+ display: 'flex',
42
+ justifyContent: 'space-between'
43
+ }}
44
+ >
45
+ <Skeleton variant="text" width={120} height={20} />
46
+ <Skeleton variant="text" width={60} height={20} />
47
+ </span>
48
+ </React.Fragment>
49
+ );
50
+ }
51
+
52
+ const product = prices && prices.length > 0 ? prices[0] : null;
53
+
54
+ if (!prices || prices.length === 0) {
55
+ return (
56
+ <PS.DesignValue
57
+ style={{
58
+ fontSize: 16,
59
+ margin: '10px 0',
60
+ fontWeight: 600,
61
+ marginBottom: 0
62
+ }}
63
+ >
64
+ No pricing information available
65
+ </PS.DesignValue>
66
+ );
67
+ }
68
+
69
+ return (
70
+ <React.Fragment>
71
+ <PS.DesignValue
72
+ style={{
73
+ fontSize: 16,
74
+ margin: '10px 0',
75
+ fontWeight: 600,
76
+ marginBottom: 0
77
+ }}
78
+ >
79
+ Pricing
80
+ </PS.DesignValue>
81
+ <span
82
+ style={{
83
+ display: 'flex',
84
+ justifyContent: 'space-between',
85
+ marginBottom: 5
86
+ }}
87
+ >
88
+ <PS.PropteryValue2>Regular Price: </PS.PropteryValue2>
89
+ <PS.PropteryValue2
90
+ style={{
91
+ color: TEXT_COLOR_NEUTRAL_0,
92
+ textDecoration:
93
+ product?.discounted_price !== product?.regular_price
94
+ ? 'line-through'
95
+ : 'none',
96
+ width: 'unset',
97
+ fontWeight: 600
98
+ }}
99
+ >
100
+ {`$${product?.regular_price}`}
101
+ </PS.PropteryValue2>
102
+ </span>
103
+ {product?.discounted_price !== null ? (
104
+ <span
105
+ style={{
106
+ display: 'flex',
107
+ justifyContent: 'space-between'
108
+ }}
109
+ >
110
+ <PS.PropteryValue2>Discounted Price: </PS.PropteryValue2>
111
+ <PS.PropteryValue2
112
+ style={{
113
+ color: 'green',
114
+ width: 'unset',
115
+ fontWeight: 600
116
+ }}
117
+ >
118
+ {product?.discounted_price !== product.regular_price
119
+ ? `$${product?.discounted_price}`
120
+ : '-'}
121
+ </PS.PropteryValue2>
122
+ </span>
123
+ ) : null}
124
+ </React.Fragment>
125
+ );
126
+ };