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.
- package/package.json +8 -26
- package/src/@history.js +3 -0
- package/src/CrossSignOn.jsx +94 -0
- package/src/KitchenConfigurator.jsx +1526 -0
- package/src/KitchenConfiguratorApp.jsx +1 -1
- package/src/_KitchenConfigurator.jsx +3 -3
- package/src/components/catalog-view/catalog-breadcrumb.jsx +53 -0
- package/src/components/catalog-view/catalog-item.jsx +229 -0
- package/src/components/catalog-view/catalog-list.jsx +173 -0
- package/src/components/catalog-view/catalog-page-item.jsx +110 -0
- package/src/components/catalog-view/catalog-turn-back-page-item.jsx +80 -0
- package/src/components/configurator/custom-configurator.jsx +77 -0
- package/src/components/configurator/project-configurator.jsx +120 -0
- package/src/components/export.js +36 -0
- package/src/components/firstsetting/button/styles.js +223 -0
- package/src/components/firstsetting/export.js +9 -0
- package/src/components/firstsetting/firstsetting-content-button.jsx +198 -0
- package/src/components/firstsetting/firstsetting-toggle-button.jsx +101 -0
- package/src/components/firstsetting/firstsetting.jsx +814 -0
- package/src/components/footerbar/button/ControlButton.jsx +43 -0
- package/src/components/footerbar/button/DirectionButton.jsx +54 -0
- package/src/components/footerbar/button/DirectionPanSpinButton.jsx +36 -0
- package/src/components/footerbar/button/ToggleButton.jsx +58 -0
- package/src/components/footerbar/button/ToggleConvertButton.jsx +48 -0
- package/src/components/footerbar/button/ToggleMeasureButton.jsx +33 -0
- package/src/components/footerbar/button/styles.js +217 -0
- package/src/components/footerbar/export.js +9 -0
- package/src/components/footerbar/footer-content-button.jsx +198 -0
- package/src/components/footerbar/footer-toggle-button.jsx +101 -0
- package/src/components/footerbar/footerbar.jsx +1103 -0
- package/src/components/footerbar/styles.js +263 -0
- package/src/components/header/button/MenuButton.jsx +46 -0
- package/src/components/header/button/SaveButton.jsx +54 -0
- package/src/components/header/button/styles.js +181 -0
- package/src/components/header/export.js +5 -0
- package/src/components/header/header.jsx +631 -0
- package/src/components/header/header.style.css +47 -0
- package/src/components/header/styles.js +320 -0
- package/src/components/login/Login.js +77 -0
- package/src/components/login/LoginForm/index.js +108 -0
- package/src/components/login/Register.js +82 -0
- package/src/components/login/RegisterForm/index.js +171 -0
- package/src/components/login/jwtService.js +201 -0
- package/src/components/login/style.css +158 -0
- package/src/components/login/style.scss +260 -0
- package/src/components/myprojects/export.js +5 -0
- package/src/components/myprojects/index.jsx +445 -0
- package/src/components/myprojects/styles.js +241 -0
- package/src/components/sidebar/custom-accordion.jsx +48 -0
- package/src/components/sidebar/export.js +15 -0
- package/src/components/sidebar/panel-element-editor/attributes-editor/attributes-editor.jsx +73 -0
- package/src/components/sidebar/panel-element-editor/attributes-editor/confirm-popup.jsx +101 -0
- package/src/components/sidebar/panel-element-editor/attributes-editor/hole-attributes-editor.jsx +149 -0
- package/src/components/sidebar/panel-element-editor/attributes-editor/item-attributes-editor.jsx +316 -0
- package/src/components/sidebar/panel-element-editor/attributes-editor/line-attributes-editor.jsx +108 -0
- package/src/components/sidebar/panel-element-editor/element-editor.jsx +1070 -0
- package/src/components/sidebar/panel-element-editor/multi-elements-editor.jsx +0 -0
- package/src/components/sidebar/panel-element-editor/panel-element-editor.jsx +104 -0
- package/src/components/sidebar/panel-element-editor/panel-multi-elements-editor.jsx +155 -0
- package/src/components/sidebar/panel-group-editor.jsx +272 -0
- package/src/components/sidebar/panel-groups.jsx +310 -0
- package/src/components/sidebar/panel-guides.jsx +192 -0
- package/src/components/sidebar/panel-layer-elements.jsx +298 -0
- package/src/components/sidebar/panel-layers.jsx +381 -0
- package/src/components/sidebar/panel.jsx +71 -0
- package/src/components/sidebar/sidebar.jsx +106 -0
- package/src/components/sidebar/toolbar-panel.jsx +139 -0
- package/src/components/sign/export.js +7 -0
- package/src/components/sign/main/index.jsx +523 -0
- package/src/components/sign/main/styles.js +163 -0
- package/src/components/toolbar/button/ControlButton.jsx +41 -0
- package/src/components/toolbar/button/DirectionButton.jsx +34 -0
- package/src/components/toolbar/button/RightButton.jsx +103 -0
- package/src/components/toolbar/button/ToggleButton.jsx +41 -0
- package/src/components/toolbar/button/index.jsx +55 -0
- package/src/components/toolbar/button/styles.js +127 -0
- package/src/components/toolbar/components/DoorStyleMenu.jsx +103 -0
- package/src/components/toolbar/components/Pricing.jsx +126 -0
- package/src/components/toolbar/components/ReviewForQuote.jsx +635 -0
- package/src/components/toolbar/export.js +21 -0
- package/src/components/toolbar/main/Alert.js +122 -0
- package/src/components/toolbar/main/TakePictureModal.jsx +104 -0
- package/src/components/toolbar/main/confirm-popup.jsx +99 -0
- package/src/components/toolbar/main/index.jsx +5627 -0
- package/src/components/toolbar/main/lShaped.json +311 -0
- package/src/components/toolbar/main/longNarrow.json +238 -0
- package/src/components/toolbar/main/myComponents.js +123 -0
- package/src/components/toolbar/main/oRectangle.json +220 -0
- package/src/components/toolbar/main/rectangle.json +238 -0
- package/src/components/toolbar/main/style.css +107 -0
- package/src/components/toolbar/main/styles.js +696 -0
- package/src/components/toolbar/plugin-item.jsx +123 -0
- package/src/components/toolbar/popup/appliance/appliance-category/index.jsx +73 -0
- package/src/components/toolbar/popup/appliance/choose-appliance/index.jsx +102 -0
- package/src/components/toolbar/popup/appliance/index.jsx +83 -0
- package/src/components/toolbar/popup/autosaveprompt/index.jsx +150 -0
- package/src/components/toolbar/popup/autosaveprompt/styles.css +64 -0
- package/src/components/toolbar/popup/autosaveprompt/styles.js +40 -0
- package/src/components/toolbar/popup/cabinet/cabinet-category/index.jsx +73 -0
- package/src/components/toolbar/popup/cabinet/choose-product/index.jsx +119 -0
- package/src/components/toolbar/popup/cabinet/index.jsx +85 -0
- package/src/components/toolbar/popup/doorStyle/choose-style/index.jsx +63 -0
- package/src/components/toolbar/popup/doorStyle/index.jsx +71 -0
- package/src/components/toolbar/popup/doorStyle/style-category/index.jsx +139 -0
- package/src/components/toolbar/popup/downloadsummary/downloadSummaryContext.js +2 -0
- package/src/components/toolbar/popup/downloadsummary/downloadSummaryTemp.jsx +157 -0
- package/src/components/toolbar/popup/downloadsummary/index.jsx +643 -0
- package/src/components/toolbar/popup/downloadsummary/show2D/show2DView.jsx +51 -0
- package/src/components/toolbar/popup/downloadsummary/show2D/viewer2DDownLoad.jsx +175 -0
- package/src/components/toolbar/popup/downloadsummary/show3D/show3DView.jsx +283 -0
- package/src/components/toolbar/popup/downloadsummary/show3D/viewer3DDownLoad.jsx +2257 -0
- package/src/components/toolbar/popup/downloadsummary/showCabinetInfo.js +93 -0
- package/src/components/toolbar/popup/downloadsummary/showElevation/showElevationView.jsx +132 -0
- package/src/components/toolbar/popup/downloadsummary/showElevation/viewer3DElevationDownload.jsx +2198 -0
- package/src/components/toolbar/popup/downloadsummary/showElevation/viewerElevationDownload.jsx +152 -0
- package/src/components/toolbar/popup/downloadsummary/showWarranty.jsx +149 -0
- package/src/components/toolbar/popup/downloadsummary/styles.css +177 -0
- package/src/components/toolbar/popup/downloadsummary/styles.js +453 -0
- package/src/components/toolbar/popup/finishingtouch/category/index.jsx +34 -0
- package/src/components/toolbar/popup/finishingtouch/index.jsx +58 -0
- package/src/components/toolbar/popup/finishingtouch/material-edit.jsx +112 -0
- package/src/components/toolbar/popup/finishingtouch/product/index.jsx +116 -0
- package/src/components/toolbar/popup/floorplan/choose-floor/confirm-popup.jsx +101 -0
- package/src/components/toolbar/popup/floorplan/choose-floor/index.jsx +254 -0
- package/src/components/toolbar/popup/floorplan/choose-floor/lShaped.json +311 -0
- package/src/components/toolbar/popup/floorplan/choose-floor/longNarrow.json +238 -0
- package/src/components/toolbar/popup/floorplan/choose-floor/oRectangle.json +220 -0
- package/src/components/toolbar/popup/floorplan/choose-floor/rectangle.json +238 -0
- package/src/components/toolbar/popup/floorplan/choose-floor/styles.js +86 -0
- package/src/components/toolbar/popup/floorplan/floor-category/index.jsx +109 -0
- package/src/components/toolbar/popup/floorplan/index.jsx +60 -0
- package/src/components/toolbar/popup/index.jsx +241 -0
- package/src/components/toolbar/popup/newproject/index.jsx +59 -0
- package/src/components/toolbar/popup/newproject/styles.css +64 -0
- package/src/components/toolbar/popup/newproject/styles.js +41 -0
- package/src/components/toolbar/popup/product/appliance.jsx +54 -0
- package/src/components/toolbar/popup/product/cabinetproduct.jsx +15 -0
- package/src/components/toolbar/popup/product/doorstyle.jsx +58 -0
- package/src/components/toolbar/popup/product/doorstyleproduct.jsx +47 -0
- package/src/components/toolbar/popup/product/floor.jsx +36 -0
- package/src/components/toolbar/popup/product/floorproduct.jsx +42 -0
- package/src/components/toolbar/popup/product/index.jsx +36 -0
- package/src/components/toolbar/popup/product/primary.jsx +77 -0
- package/src/components/toolbar/popup/product/productline.jsx +93 -0
- package/src/components/toolbar/popup/product/reviewItem.jsx +427 -0
- package/src/components/toolbar/popup/product/reviewMolding.jsx +310 -0
- package/src/components/toolbar/popup/product/style.css +54 -0
- package/src/components/toolbar/popup/product/styles.js +260 -0
- package/src/components/toolbar/popup/savedesign/FullPictureForm.jsx +146 -0
- package/src/components/toolbar/popup/savedesign/index.jsx +495 -0
- package/src/components/toolbar/popup/savedesign/savedesign.style.css +16 -0
- package/src/components/toolbar/popup/savedesign/styles.js +151 -0
- package/src/components/toolbar/popup/setDoorStyleOption/index.jsx +87 -0
- package/src/components/toolbar/popup/styles.js +909 -0
- package/src/components/toolbar/popup/submitforquote/AddToCartOptions.jsx +192 -0
- package/src/components/toolbar/popup/submitforquote/CustomerRequestsForm.jsx +96 -0
- package/src/components/toolbar/popup/submitforquote/SkipDesignerReview.jsx +54 -0
- package/src/components/toolbar/popup/submitforquote/StepDots.jsx +25 -0
- package/src/components/toolbar/popup/submitforquote/cart-choice.jsx +116 -0
- package/src/components/toolbar/popup/submitforquote/doorstyle-menus.js +38 -0
- package/src/components/toolbar/popup/submitforquote/index.jsx +698 -0
- package/src/components/toolbar/popup/submitforquote/styles.css +105 -0
- package/src/components/toolbar/popup/submitforquote/styles.js +294 -0
- package/src/components/toolbar/popup/submitprompt/index.jsx +89 -0
- package/src/components/toolbar/popup/submitprompt/styles.css +64 -0
- package/src/components/toolbar/popup/submitprompt/styles.js +42 -0
- package/src/components/toolbar/toolbar-button.jsx +90 -0
- package/src/components/toolbar/toolbar-load-button.jsx +36 -0
- package/src/components/toolbar/toolbar-save-button.jsx +32 -0
- package/src/components/wizardstep/button/styles.js +677 -0
- package/src/components/wizardstep/export.js +5 -0
- package/src/components/wizardstep/index.jsx +1372 -0
- package/src/components/wizardstep/styles.js +688 -0
- package/src/components/wizardstep/wizardstep-content-button.jsx +198 -0
- package/src/components/wizardstep/wizardstep-toggle-button.jsx +101 -0
- package/src/{_index.js → index.js} +4 -4
- package/src/renderer.jsx +466 -0
- package/src/actions/_export.js +0 -35
- package/src/components/_export.js +0 -11
|
@@ -0,0 +1,146 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import {
|
|
3
|
+
Typography,
|
|
4
|
+
FormControl,
|
|
5
|
+
InputLabel,
|
|
6
|
+
Select,
|
|
7
|
+
MenuItem,
|
|
8
|
+
Button,
|
|
9
|
+
Box,
|
|
10
|
+
CircularProgress
|
|
11
|
+
} from '@material-ui/core';
|
|
12
|
+
import * as S from './styles';
|
|
13
|
+
|
|
14
|
+
const FullPictureForm = ({ onComplete, onSkip, isLoading, initialValues }) => {
|
|
15
|
+
const [form, setForm] = React.useState(initialValues);
|
|
16
|
+
|
|
17
|
+
const handleChange = e => {
|
|
18
|
+
const { name, value } = e.target;
|
|
19
|
+
setForm(prev => ({
|
|
20
|
+
...prev,
|
|
21
|
+
[name]: value
|
|
22
|
+
}));
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
return (
|
|
26
|
+
<Box position="relative">
|
|
27
|
+
{isLoading && (
|
|
28
|
+
<Box
|
|
29
|
+
position="absolute"
|
|
30
|
+
top={0}
|
|
31
|
+
left={0}
|
|
32
|
+
width="100%"
|
|
33
|
+
height="100%"
|
|
34
|
+
display="flex"
|
|
35
|
+
alignItems="center"
|
|
36
|
+
justifyContent="center"
|
|
37
|
+
zIndex={2}
|
|
38
|
+
style={{ opacity: 0.5 }}
|
|
39
|
+
>
|
|
40
|
+
<CircularProgress size={40} style={{ color: '#4C12A1' }} />
|
|
41
|
+
</Box>
|
|
42
|
+
)}
|
|
43
|
+
<form
|
|
44
|
+
style={isLoading ? { pointerEvents: 'none', opacity: 0.5 } : undefined}
|
|
45
|
+
>
|
|
46
|
+
<FormControl
|
|
47
|
+
style={{
|
|
48
|
+
marginTop: '10px'
|
|
49
|
+
}}
|
|
50
|
+
variant="outlined"
|
|
51
|
+
fullWidth
|
|
52
|
+
margin="normal"
|
|
53
|
+
>
|
|
54
|
+
<InputLabel>What best describes you?</InputLabel>
|
|
55
|
+
<Select
|
|
56
|
+
name="userType"
|
|
57
|
+
value={form.userType}
|
|
58
|
+
onChange={handleChange}
|
|
59
|
+
label="What best describes you?"
|
|
60
|
+
>
|
|
61
|
+
<MenuItem value="">
|
|
62
|
+
<em>Select an option</em>
|
|
63
|
+
</MenuItem>
|
|
64
|
+
<MenuItem value="homeowner">Homeowner</MenuItem>
|
|
65
|
+
<MenuItem value="contractor">Contractor</MenuItem>
|
|
66
|
+
<MenuItem value="design-professional">Design Professional</MenuItem>
|
|
67
|
+
<MenuItem value="real-estate-investor">
|
|
68
|
+
Real Estate Investor
|
|
69
|
+
</MenuItem>
|
|
70
|
+
<MenuItem value="other">Other</MenuItem>
|
|
71
|
+
</Select>
|
|
72
|
+
</FormControl>
|
|
73
|
+
|
|
74
|
+
<FormControl
|
|
75
|
+
style={{
|
|
76
|
+
marginTop: '10px'
|
|
77
|
+
}}
|
|
78
|
+
variant="outlined"
|
|
79
|
+
fullWidth
|
|
80
|
+
margin="normal"
|
|
81
|
+
>
|
|
82
|
+
<InputLabel>What are you designing today?</InputLabel>
|
|
83
|
+
<Select
|
|
84
|
+
name="designType"
|
|
85
|
+
value={form.designType}
|
|
86
|
+
onChange={handleChange}
|
|
87
|
+
label="What are you designing today?"
|
|
88
|
+
>
|
|
89
|
+
<MenuItem value="">
|
|
90
|
+
<em>Select an option</em>
|
|
91
|
+
</MenuItem>
|
|
92
|
+
<MenuItem value="kitchen">Kitchen</MenuItem>
|
|
93
|
+
<MenuItem value="bathroom">Bathroom</MenuItem>
|
|
94
|
+
<MenuItem value="laundry-room">Laundry Room</MenuItem>
|
|
95
|
+
<MenuItem value="tv-room">TV Room</MenuItem>
|
|
96
|
+
<MenuItem value="bar-room">Bar Room</MenuItem>
|
|
97
|
+
<MenuItem value="office">Office</MenuItem>
|
|
98
|
+
<MenuItem value="mudroom">Mudroom</MenuItem>
|
|
99
|
+
<MenuItem value="pantry">Pantry</MenuItem>
|
|
100
|
+
<MenuItem value="closet">Closet</MenuItem>
|
|
101
|
+
<MenuItem value="garage">Garage</MenuItem>
|
|
102
|
+
<MenuItem value="outdoor-cabinetry">Outdoor Cabinetry</MenuItem>
|
|
103
|
+
<MenuItem value="other">Other</MenuItem>
|
|
104
|
+
</Select>
|
|
105
|
+
</FormControl>
|
|
106
|
+
|
|
107
|
+
<FormControl
|
|
108
|
+
style={{
|
|
109
|
+
marginTop: '10px'
|
|
110
|
+
}}
|
|
111
|
+
variant="outlined"
|
|
112
|
+
fullWidth
|
|
113
|
+
margin="normal"
|
|
114
|
+
>
|
|
115
|
+
<InputLabel>When do you plan to start your project?</InputLabel>
|
|
116
|
+
<Select
|
|
117
|
+
name="startTime"
|
|
118
|
+
value={form.startTime}
|
|
119
|
+
onChange={handleChange}
|
|
120
|
+
label="When do you plan to start your project?"
|
|
121
|
+
>
|
|
122
|
+
<MenuItem value="">
|
|
123
|
+
<em>Select an option</em>
|
|
124
|
+
</MenuItem>
|
|
125
|
+
<MenuItem value="asap">As soon as possible</MenuItem>
|
|
126
|
+
<MenuItem value="1-2-months">1–2 months</MenuItem>
|
|
127
|
+
<MenuItem value="2-4-months">2–4 months</MenuItem>
|
|
128
|
+
<MenuItem value="4-plus-months">4+ months</MenuItem>
|
|
129
|
+
<MenuItem value="other">Other</MenuItem>
|
|
130
|
+
</Select>
|
|
131
|
+
</FormControl>
|
|
132
|
+
|
|
133
|
+
<Box display="flex" justifyContent="flex-end" mt={2}>
|
|
134
|
+
<S.Button onClick={() => onSkip(form)} disabled={isLoading}>
|
|
135
|
+
Skip
|
|
136
|
+
</S.Button>
|
|
137
|
+
<S.Button onClick={() => onComplete(form)} disabled={isLoading}>
|
|
138
|
+
Complete
|
|
139
|
+
</S.Button>
|
|
140
|
+
</Box>
|
|
141
|
+
</form>
|
|
142
|
+
</Box>
|
|
143
|
+
);
|
|
144
|
+
};
|
|
145
|
+
|
|
146
|
+
export default FullPictureForm;
|
|
@@ -0,0 +1,495 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import * as S from './styles';
|
|
3
|
+
import {
|
|
4
|
+
DEFAULT_FONT_FAMILY,
|
|
5
|
+
PROJECT_NAME_LENGTH_LIMIT,
|
|
6
|
+
TEXT_COLOR_NEUTRAL_1,
|
|
7
|
+
TEXT_COLOR_NEUTRAL_0,
|
|
8
|
+
TEXT_COLOR_NEUTRAL_2,
|
|
9
|
+
LOCAL_STORAGE_CUSTOMER_INFO,
|
|
10
|
+
CLIENTS_NAME
|
|
11
|
+
} from '../../../../constants';
|
|
12
|
+
import { emailValidation } from '../../../../utils/email-validator';
|
|
13
|
+
import Dialog from '@material-ui/core/Dialog';
|
|
14
|
+
import CircularProgress from '@material-ui/core/CircularProgress';
|
|
15
|
+
import styled from 'styled-components';
|
|
16
|
+
import SnackBar from '../../../atoms/Snackbar/index';
|
|
17
|
+
import { phoneValidation } from '../../../../utils/phone-validator';
|
|
18
|
+
import ls from 'localstorage-slim';
|
|
19
|
+
import FullPictureForm from '../../../../../src/components/toolbar/popup/savedesign/FullPictureForm';
|
|
20
|
+
|
|
21
|
+
const StyledDialog = styled(Dialog)`
|
|
22
|
+
.MuiDialog-paperWidthSm {
|
|
23
|
+
border-radius: 10px;
|
|
24
|
+
width: 480px;
|
|
25
|
+
padding: 32px;
|
|
26
|
+
}
|
|
27
|
+
`;
|
|
28
|
+
|
|
29
|
+
class SaveDesignPopup extends React.Component {
|
|
30
|
+
constructor(props) {
|
|
31
|
+
super(props);
|
|
32
|
+
let customerInfo = {};
|
|
33
|
+
try {
|
|
34
|
+
customerInfo = ls.get(LOCAL_STORAGE_CUSTOMER_INFO);
|
|
35
|
+
} catch (e) {
|
|
36
|
+
customerInfo = {};
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
const email = props.match.params.token
|
|
40
|
+
? sessionStorage.getItem('email')
|
|
41
|
+
: customerInfo?.email;
|
|
42
|
+
const firstName = props.match.params.token
|
|
43
|
+
? sessionStorage.getItem('firstName')
|
|
44
|
+
: customerInfo?.firstName;
|
|
45
|
+
const lastName = props.match.params.token
|
|
46
|
+
? sessionStorage.getItem('lastName')
|
|
47
|
+
: customerInfo?.lastName;
|
|
48
|
+
this.state = {
|
|
49
|
+
email: email || '',
|
|
50
|
+
emailfocusOn: false,
|
|
51
|
+
phone: sessionStorage.getItem('phone') || '',
|
|
52
|
+
phonefocusOn: false,
|
|
53
|
+
notes: '',
|
|
54
|
+
notefocusOn: false,
|
|
55
|
+
firstName: firstName || '',
|
|
56
|
+
firstNamefocusOn: false,
|
|
57
|
+
lastNamefocusOn: false,
|
|
58
|
+
lastName: lastName || '',
|
|
59
|
+
projectNamefocusOn: false,
|
|
60
|
+
projectName: 'Untitled',
|
|
61
|
+
|
|
62
|
+
// error handling
|
|
63
|
+
pjNameLimit: false,
|
|
64
|
+
isSnackBarOpen: false,
|
|
65
|
+
snackBarMessage: '',
|
|
66
|
+
isLoading: false,
|
|
67
|
+
showFullForm: false
|
|
68
|
+
};
|
|
69
|
+
|
|
70
|
+
this.timeoutId = null;
|
|
71
|
+
|
|
72
|
+
functionBinder.call(this);
|
|
73
|
+
|
|
74
|
+
function functionBinder() {
|
|
75
|
+
this.closePanel = this.closePanel.bind(this);
|
|
76
|
+
this.projectNameChangeHandler = this.projectNameChangeHandler.bind(this);
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
componentWillReceiveProps(newProps) {
|
|
81
|
+
let customerInfo = {};
|
|
82
|
+
try {
|
|
83
|
+
customerInfo = ls.get(LOCAL_STORAGE_CUSTOMER_INFO);
|
|
84
|
+
} catch (e) {
|
|
85
|
+
customerInfo = {};
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
const email = customerInfo?.email || sessionStorage.getItem('email');
|
|
89
|
+
const phone = sessionStorage.getItem('phone');
|
|
90
|
+
const firstName =
|
|
91
|
+
customerInfo?.firstName || sessionStorage.getItem('firstName');
|
|
92
|
+
const lastName =
|
|
93
|
+
customerInfo?.lastName || sessionStorage.getItem('lastName');
|
|
94
|
+
let projectName = sessionStorage.getItem('projectTitle');
|
|
95
|
+
if (newProps.state.scene.title !== '') {
|
|
96
|
+
projectName =
|
|
97
|
+
newProps.state.scene.title || sessionStorage.getItem('projectTitle');
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
if (newProps.visible !== this.props.visible && newProps.visible) {
|
|
101
|
+
if (email !== null && email !== 'temp_xxx@yyy.com') {
|
|
102
|
+
this.setState({ email: email });
|
|
103
|
+
}
|
|
104
|
+
if (phone !== null) {
|
|
105
|
+
this.setState({ phone: phone });
|
|
106
|
+
}
|
|
107
|
+
if (firstName !== null) {
|
|
108
|
+
this.setState({ firstName: firstName });
|
|
109
|
+
}
|
|
110
|
+
if (lastName !== null) {
|
|
111
|
+
this.setState({ lastName: lastName });
|
|
112
|
+
}
|
|
113
|
+
if (projectName !== null) {
|
|
114
|
+
this.setState({ projectName });
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
closePanel() {
|
|
120
|
+
this.props.handleSaveDesign(false);
|
|
121
|
+
setTimeout(() => {
|
|
122
|
+
this.setState({
|
|
123
|
+
firstName: '',
|
|
124
|
+
lastName: '',
|
|
125
|
+
email: '',
|
|
126
|
+
projectName: '',
|
|
127
|
+
notes: '',
|
|
128
|
+
phone: '',
|
|
129
|
+
showFullForm: false
|
|
130
|
+
});
|
|
131
|
+
}, 500);
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
projectNameChangeHandler(e) {
|
|
135
|
+
if (e.target.value.length >= PROJECT_NAME_LENGTH_LIMIT) {
|
|
136
|
+
this.setState({ pjNameLimit: true });
|
|
137
|
+
clearTimeout(this.timeoutId);
|
|
138
|
+
this.timeoutId = setTimeout(
|
|
139
|
+
() => this.setState({ pjNameLimit: false }),
|
|
140
|
+
2000
|
|
141
|
+
);
|
|
142
|
+
} else {
|
|
143
|
+
this.setState({ projectName: e.target.value });
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
submitFinalData = async payload => {
|
|
148
|
+
this.setState({ isLoading: true });
|
|
149
|
+
const result = await this.props.saveProject(payload);
|
|
150
|
+
if (result?.success) {
|
|
151
|
+
this.closePanel(); // Reset state, close modal
|
|
152
|
+
}
|
|
153
|
+
this.setState({ isLoading: false });
|
|
154
|
+
};
|
|
155
|
+
|
|
156
|
+
render() {
|
|
157
|
+
let { visible } = this.props;
|
|
158
|
+
let {
|
|
159
|
+
email,
|
|
160
|
+
emailfocusOn,
|
|
161
|
+
phone,
|
|
162
|
+
phonefocusOn,
|
|
163
|
+
notes,
|
|
164
|
+
firstName,
|
|
165
|
+
firstNamefocusOn,
|
|
166
|
+
lastName,
|
|
167
|
+
lastNamefocusOn,
|
|
168
|
+
projectName,
|
|
169
|
+
projectNamefocusOn,
|
|
170
|
+
notefocusOn,
|
|
171
|
+
isLoading
|
|
172
|
+
} = this.state;
|
|
173
|
+
|
|
174
|
+
const initialFullFormValues = {
|
|
175
|
+
userType: sessionStorage.getItem('user_type') || '',
|
|
176
|
+
designType: sessionStorage.getItem('project_type') || '',
|
|
177
|
+
startTime: sessionStorage.getItem('project_timeline') || ''
|
|
178
|
+
};
|
|
179
|
+
|
|
180
|
+
const visualizerName = sessionStorage.getItem('visualizerName');
|
|
181
|
+
|
|
182
|
+
if (this.state.showFullForm) {
|
|
183
|
+
return (
|
|
184
|
+
<StyledDialog
|
|
185
|
+
open={visible}
|
|
186
|
+
onClose={!isLoading ? this.closePanel.bind(this) : undefined}
|
|
187
|
+
>
|
|
188
|
+
<SnackBar
|
|
189
|
+
isOpen={this.state.isSnackBarOpen}
|
|
190
|
+
message={this.state.snackBarMessage}
|
|
191
|
+
handleClose={() =>
|
|
192
|
+
this.setState({ isSnackBarOpen: false, snackBarMessage: '' })
|
|
193
|
+
}
|
|
194
|
+
/>
|
|
195
|
+
<S.DialogTitle>Give Us the Full Picture</S.DialogTitle>
|
|
196
|
+
<S.DialogContent>
|
|
197
|
+
<div>
|
|
198
|
+
<b>Thanks for saving your project!</b>
|
|
199
|
+
</div>
|
|
200
|
+
<br />
|
|
201
|
+
<div>
|
|
202
|
+
Sharing a few details helps us guide you based on your goals and
|
|
203
|
+
experience.
|
|
204
|
+
</div>
|
|
205
|
+
</S.DialogContent>
|
|
206
|
+
<S.DialogContentSelection>
|
|
207
|
+
<FullPictureForm
|
|
208
|
+
isLoading={isLoading}
|
|
209
|
+
initialValues={initialFullFormValues}
|
|
210
|
+
onComplete={extraFormData => {
|
|
211
|
+
sessionStorage.setItem('user_type', extraFormData.userType);
|
|
212
|
+
sessionStorage.setItem(
|
|
213
|
+
'project_type',
|
|
214
|
+
extraFormData.designType
|
|
215
|
+
);
|
|
216
|
+
sessionStorage.setItem(
|
|
217
|
+
'project_timeline',
|
|
218
|
+
extraFormData.startTime
|
|
219
|
+
);
|
|
220
|
+
|
|
221
|
+
const payload = {
|
|
222
|
+
...this.state,
|
|
223
|
+
user_type: extraFormData.userType,
|
|
224
|
+
project_type: extraFormData.designType,
|
|
225
|
+
project_timeline: extraFormData.startTime,
|
|
226
|
+
...extraFormData
|
|
227
|
+
};
|
|
228
|
+
this.submitFinalData(payload);
|
|
229
|
+
}}
|
|
230
|
+
onSkip={extraFormData => {
|
|
231
|
+
const payload = {
|
|
232
|
+
...this.state,
|
|
233
|
+
user_type: extraFormData.userType,
|
|
234
|
+
project_type: extraFormData.designType,
|
|
235
|
+
project_timeline: extraFormData.startTime,
|
|
236
|
+
...extraFormData
|
|
237
|
+
};
|
|
238
|
+
this.submitFinalData(payload);
|
|
239
|
+
}}
|
|
240
|
+
/>
|
|
241
|
+
</S.DialogContentSelection>
|
|
242
|
+
</StyledDialog>
|
|
243
|
+
);
|
|
244
|
+
}
|
|
245
|
+
|
|
246
|
+
return (
|
|
247
|
+
<StyledDialog
|
|
248
|
+
open={visible}
|
|
249
|
+
onClose={!isLoading ? this.closePanel.bind(this) : undefined}
|
|
250
|
+
>
|
|
251
|
+
<SnackBar
|
|
252
|
+
isOpen={this.state.isSnackBarOpen}
|
|
253
|
+
message={this.state.snackBarMessage}
|
|
254
|
+
handleClose={() =>
|
|
255
|
+
this.setState({ isSnackBarOpen: false, snackBarMessage: '' })
|
|
256
|
+
}
|
|
257
|
+
/>
|
|
258
|
+
<S.DialogTitle>Save your project</S.DialogTitle>
|
|
259
|
+
<S.DialogContent>
|
|
260
|
+
Save your project in order to request Designer Assistance and/or Add
|
|
261
|
+
to Cart, and to be able to access it later via the email link.
|
|
262
|
+
</S.DialogContent>
|
|
263
|
+
<S.DialogContentSelection>
|
|
264
|
+
<div
|
|
265
|
+
style={{
|
|
266
|
+
display: 'flex',
|
|
267
|
+
alignItems: 'center',
|
|
268
|
+
gap: '1rem'
|
|
269
|
+
}}
|
|
270
|
+
>
|
|
271
|
+
<S.StyledInputWrapper>
|
|
272
|
+
<S.StyledInput
|
|
273
|
+
id="first_name_input"
|
|
274
|
+
value={firstName}
|
|
275
|
+
onChange={e => this.setState({ firstName: e.target.value })}
|
|
276
|
+
onFocus={e => this.setState({ firstNamefocusOn: true })}
|
|
277
|
+
onBlur={e => this.setState({ firstNamefocusOn: false })}
|
|
278
|
+
placeholder={
|
|
279
|
+
firstNamefocusOn ? 'Enter first name' : 'First name'
|
|
280
|
+
}
|
|
281
|
+
required
|
|
282
|
+
></S.StyledInput>
|
|
283
|
+
{(firstNamefocusOn || !!firstName.length) && (
|
|
284
|
+
<S.StyledInputHeadLabel
|
|
285
|
+
style={{ color: !firstNamefocusOn && TEXT_COLOR_NEUTRAL_2 }}
|
|
286
|
+
>
|
|
287
|
+
First Name
|
|
288
|
+
</S.StyledInputHeadLabel>
|
|
289
|
+
)}
|
|
290
|
+
{!!firstName.length && (
|
|
291
|
+
<S.PlusImage
|
|
292
|
+
maskImage="/assets/img/svg/bottombar/arrow-plus.svg"
|
|
293
|
+
onClick={() => this.setState({ firstName: '' })}
|
|
294
|
+
/>
|
|
295
|
+
)}
|
|
296
|
+
</S.StyledInputWrapper>
|
|
297
|
+
<S.StyledInputWrapper>
|
|
298
|
+
<S.StyledInput
|
|
299
|
+
value={lastName}
|
|
300
|
+
onChange={e => this.setState({ lastName: e.target.value })}
|
|
301
|
+
onFocus={e => this.setState({ lastNamefocusOn: true })}
|
|
302
|
+
onBlur={e => this.setState({ lastNamefocusOn: false })}
|
|
303
|
+
placeholder={lastNamefocusOn ? 'Enter last name' : 'Last name'}
|
|
304
|
+
required
|
|
305
|
+
/>
|
|
306
|
+
{(lastNamefocusOn || !!lastName.length) && (
|
|
307
|
+
<S.StyledInputHeadLabel
|
|
308
|
+
style={{ color: !lastNamefocusOn && TEXT_COLOR_NEUTRAL_2 }}
|
|
309
|
+
>
|
|
310
|
+
Last Name
|
|
311
|
+
</S.StyledInputHeadLabel>
|
|
312
|
+
)}
|
|
313
|
+
{!!lastName.length && (
|
|
314
|
+
<S.PlusImage
|
|
315
|
+
maskImage="/assets/img/svg/bottombar/arrow-plus.svg"
|
|
316
|
+
onClick={() => this.setState({ lastName: '' })}
|
|
317
|
+
/>
|
|
318
|
+
)}
|
|
319
|
+
</S.StyledInputWrapper>
|
|
320
|
+
</div>
|
|
321
|
+
<S.StyledInputWrapper>
|
|
322
|
+
<S.StyledInput
|
|
323
|
+
value={email}
|
|
324
|
+
onChange={e => this.setState({ email: e.target.value })}
|
|
325
|
+
onFocus={e => this.setState({ emailfocusOn: true })}
|
|
326
|
+
onBlur={e => this.setState({ emailfocusOn: false })}
|
|
327
|
+
placeholder={
|
|
328
|
+
emailfocusOn ? 'Enter email address' : 'Email Address'
|
|
329
|
+
}
|
|
330
|
+
required
|
|
331
|
+
/>
|
|
332
|
+
{(emailfocusOn || !!email.length) && (
|
|
333
|
+
<S.StyledInputHeadLabel
|
|
334
|
+
style={{ color: !emailfocusOn && TEXT_COLOR_NEUTRAL_2 }}
|
|
335
|
+
>
|
|
336
|
+
Email Address
|
|
337
|
+
</S.StyledInputHeadLabel>
|
|
338
|
+
)}
|
|
339
|
+
{!!email.length && (
|
|
340
|
+
<S.PlusImage
|
|
341
|
+
maskImage="/assets/img/svg/bottombar/arrow-plus.svg"
|
|
342
|
+
onClick={() => this.setState({ email: '' })}
|
|
343
|
+
/>
|
|
344
|
+
)}
|
|
345
|
+
</S.StyledInputWrapper>
|
|
346
|
+
<S.StyledInputWrapper>
|
|
347
|
+
<S.StyledInput
|
|
348
|
+
value={phone}
|
|
349
|
+
onChange={e => {
|
|
350
|
+
this.setState({ phone: e.target.value });
|
|
351
|
+
}}
|
|
352
|
+
onFocus={e => this.setState({ phonefocusOn: true })}
|
|
353
|
+
onBlur={e => this.setState({ phonefocusOn: false })}
|
|
354
|
+
maxLength={50}
|
|
355
|
+
placeholder={phonefocusOn ? 'Enter phone number' : 'Phone Number'}
|
|
356
|
+
required
|
|
357
|
+
/>
|
|
358
|
+
{(phonefocusOn || !!phone.length) && (
|
|
359
|
+
<S.StyledInputHeadLabel
|
|
360
|
+
style={{ color: !phonefocusOn && TEXT_COLOR_NEUTRAL_2 }}
|
|
361
|
+
>
|
|
362
|
+
Phone Number
|
|
363
|
+
</S.StyledInputHeadLabel>
|
|
364
|
+
)}
|
|
365
|
+
{!!phone.length && (
|
|
366
|
+
<S.PlusImage
|
|
367
|
+
maskImage="/assets/img/svg/bottombar/arrow-plus.svg"
|
|
368
|
+
onClick={() => this.setState({ phone: '' })}
|
|
369
|
+
/>
|
|
370
|
+
)}
|
|
371
|
+
</S.StyledInputWrapper>
|
|
372
|
+
<S.StyledInputWrapper>
|
|
373
|
+
<S.StyledInput
|
|
374
|
+
style={{ fontWeight: 700, color: TEXT_COLOR_NEUTRAL_0 }}
|
|
375
|
+
value={projectName}
|
|
376
|
+
onChange={e => this.setState({ projectName: e.target.value })}
|
|
377
|
+
onFocus={e => this.setState({ projectNamefocusOn: true })}
|
|
378
|
+
onBlur={e => this.setState({ projectNamefocusOn: false })}
|
|
379
|
+
placeholder={
|
|
380
|
+
projectNamefocusOn ? 'Enter project name' : 'Project Name'
|
|
381
|
+
}
|
|
382
|
+
required
|
|
383
|
+
/>
|
|
384
|
+
{(projectNamefocusOn || !!projectName.length) && (
|
|
385
|
+
<S.StyledInputHeadLabel
|
|
386
|
+
style={{ color: !projectNamefocusOn && TEXT_COLOR_NEUTRAL_2 }}
|
|
387
|
+
>
|
|
388
|
+
Project Name
|
|
389
|
+
</S.StyledInputHeadLabel>
|
|
390
|
+
)}
|
|
391
|
+
{!!projectName.length && (
|
|
392
|
+
<S.PlusImage
|
|
393
|
+
maskImage="/assets/img/svg/bottombar/arrow-plus.svg"
|
|
394
|
+
onClick={() => this.setState({ projectName: '' })}
|
|
395
|
+
/>
|
|
396
|
+
)}
|
|
397
|
+
</S.StyledInputWrapper>
|
|
398
|
+
<div style={{ width: '100%', marginTop: 10, display: 'none' }}>
|
|
399
|
+
<S.StyledInputWrapper>
|
|
400
|
+
<S.DialogTextArea
|
|
401
|
+
value={notes}
|
|
402
|
+
maxLength={200}
|
|
403
|
+
onFocus={e => this.setState({ notefocusOn: true })}
|
|
404
|
+
onBlur={e => this.setState({ notefocusOn: false })}
|
|
405
|
+
placeholder={notefocusOn ? 'Input' : 'Notes (optional)'}
|
|
406
|
+
onChange={e => this.setState({ notes: e.target.value })}
|
|
407
|
+
/>
|
|
408
|
+
{(notefocusOn || !!notes.length) && (
|
|
409
|
+
<S.StyledInputHeadLabel
|
|
410
|
+
style={{
|
|
411
|
+
color: !notefocusOn && TEXT_COLOR_NEUTRAL_2,
|
|
412
|
+
left: 7
|
|
413
|
+
}}
|
|
414
|
+
>
|
|
415
|
+
Notes (optional)
|
|
416
|
+
</S.StyledInputHeadLabel>
|
|
417
|
+
)}
|
|
418
|
+
</S.StyledInputWrapper>
|
|
419
|
+
<span
|
|
420
|
+
style={{
|
|
421
|
+
fontFamily: DEFAULT_FONT_FAMILY,
|
|
422
|
+
fontSize: 13,
|
|
423
|
+
color: TEXT_COLOR_NEUTRAL_1,
|
|
424
|
+
float: 'right',
|
|
425
|
+
lineHeight: '18px',
|
|
426
|
+
fontWeight: 400
|
|
427
|
+
}}
|
|
428
|
+
>
|
|
429
|
+
{notes.length}/200 characters
|
|
430
|
+
</span>
|
|
431
|
+
</div>
|
|
432
|
+
<span
|
|
433
|
+
style={{
|
|
434
|
+
fontFamily: DEFAULT_FONT_FAMILY,
|
|
435
|
+
fontSize: 12,
|
|
436
|
+
color: TEXT_COLOR_NEUTRAL_1,
|
|
437
|
+
lineHeight: '16px',
|
|
438
|
+
marginTop: 10
|
|
439
|
+
}}
|
|
440
|
+
>
|
|
441
|
+
{`By entering your email, you agree to receive marketing
|
|
442
|
+
communications from ${CLIENTS_NAME[visualizerName]}. We respect your privacy and
|
|
443
|
+
will never share your information with third parties. You can
|
|
444
|
+
unsubscribe at any time.`}
|
|
445
|
+
</span>
|
|
446
|
+
</S.DialogContentSelection>
|
|
447
|
+
<S.DialogAction>
|
|
448
|
+
<S.Button onClick={() => this.closePanel()}>Cancel</S.Button>
|
|
449
|
+
<S.Button
|
|
450
|
+
style={{
|
|
451
|
+
marginRight: 0
|
|
452
|
+
}}
|
|
453
|
+
onClick={() => {
|
|
454
|
+
const { firstName, lastName, email, projectName, phone } =
|
|
455
|
+
this.state;
|
|
456
|
+
if (
|
|
457
|
+
firstName === '' ||
|
|
458
|
+
lastName === '' ||
|
|
459
|
+
email === '' ||
|
|
460
|
+
projectName === '' ||
|
|
461
|
+
!emailValidation(email) ||
|
|
462
|
+
phone === '' ||
|
|
463
|
+
!phoneValidation(phone) ||
|
|
464
|
+
projectName.trim() === '' ||
|
|
465
|
+
firstName.trim() === '' ||
|
|
466
|
+
lastName.trim() === ''
|
|
467
|
+
) {
|
|
468
|
+
let msg;
|
|
469
|
+
if (firstName === '' || firstName.trim() === '')
|
|
470
|
+
msg = 'Type your first name';
|
|
471
|
+
else if (lastName === '' || lastName.trim() === '')
|
|
472
|
+
msg = 'Type your last name';
|
|
473
|
+
else if (email === '') msg = 'Type your email address';
|
|
474
|
+
else if (phone === '') msg = 'Type your phone number';
|
|
475
|
+
else if (projectName === '' || projectName.trim() === '')
|
|
476
|
+
msg = 'Type your project name';
|
|
477
|
+
else if (!emailValidation(email))
|
|
478
|
+
msg = 'Type your valid email address';
|
|
479
|
+
else if (!phoneValidation(phone)) msg = 'Type your valid phone';
|
|
480
|
+
this.setState({ isSnackBarOpen: true, snackBarMessage: msg });
|
|
481
|
+
return;
|
|
482
|
+
}
|
|
483
|
+
|
|
484
|
+
this.setState({ showFullForm: true });
|
|
485
|
+
}}
|
|
486
|
+
>
|
|
487
|
+
{isLoading ? <CircularProgress size={20} /> : 'Save'}
|
|
488
|
+
</S.Button>
|
|
489
|
+
</S.DialogAction>
|
|
490
|
+
</StyledDialog>
|
|
491
|
+
);
|
|
492
|
+
}
|
|
493
|
+
}
|
|
494
|
+
|
|
495
|
+
export default SaveDesignPopup;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
.savedesign-row {
|
|
2
|
+
position: relative;
|
|
3
|
+
padding-top: 20px;
|
|
4
|
+
width: 360px;
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
.savedesign-warning {
|
|
8
|
+
word-break: keep-all;
|
|
9
|
+
margin-top: 3px;
|
|
10
|
+
color: #ff7373;
|
|
11
|
+
font-size: 11px;
|
|
12
|
+
padding-right: 3px;
|
|
13
|
+
position: absolute;
|
|
14
|
+
right: 0px;
|
|
15
|
+
top: 40px;
|
|
16
|
+
}
|