@aclymatepackages/modules 4.1.4 → 4.1.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -27,11 +27,12 @@ function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e =
27
27
  const CompanyOnboardingInput = _ref => {
28
28
  let {
29
29
  appCheckToken,
30
- companyName,
30
+ companyName = "",
31
31
  header,
32
32
  onFormComplete,
33
33
  PlacesAutocomplete,
34
- theme
34
+ theme,
35
+ websiteInput
35
36
  } = _ref;
36
37
  const [inputData, setInputData] = (0, _react.useState)({
37
38
  name: companyName
@@ -42,9 +43,20 @@ const CompanyOnboardingInput = _ref => {
42
43
  industry,
43
44
  employeeCount,
44
45
  isRemote,
45
- name
46
+ name,
47
+ username,
48
+ email
46
49
  } = inputData;
47
50
  const PlacesAutocompleteComponent = PlacesAutocomplete || _PlacesAutocomplete.default;
51
+ const userInfoArray = websiteInput ? [{
52
+ label: "What is your name?",
53
+ value: username,
54
+ editData: editInputData("username")
55
+ }, {
56
+ label: "What is your email address?",
57
+ value: email,
58
+ editData: editInputData("email")
59
+ }] : [];
48
60
  const nonPeopleDataLabsCompanyInputs = [{
49
61
  label: "How many employees work for your company?",
50
62
  value: employeeCount,
@@ -77,8 +89,8 @@ const CompanyOnboardingInput = _ref => {
77
89
  setValue: editInputData("isRemote"),
78
90
  lightBackground: true
79
91
  }),
80
- onNextStep: () => onFormComplete(inputData)
81
- }];
92
+ onNextStep: !websiteInput && (() => onFormComplete(inputData))
93
+ }, ...userInfoArray];
82
94
  const formInputArray = nonPeopleDataLabsCompanyInputs.map(input => _objectSpread(_objectSpread({}, input), {}, {
83
95
  form: "onboarding"
84
96
  }));
@@ -95,7 +107,7 @@ const CompanyOnboardingInput = _ref => {
95
107
  setValue: editInputData("name"),
96
108
  variant: "standard",
97
109
  label: "What is your company's name?"
98
- })), /*#__PURE__*/_react.default.createElement(_material.Grid, {
110
+ })), name && /*#__PURE__*/_react.default.createElement(_material.Grid, {
99
111
  item: true,
100
112
  xs: 12
101
113
  }, /*#__PURE__*/_react.default.createElement(_multiPartForm.MultiPartFormLayout, {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aclymatepackages/modules",
3
- "version": "4.1.4",
3
+ "version": "4.1.6",
4
4
  "description": "Aclymate modules",
5
5
  "author": "William Loopesko",
6
6
  "main": "dist/index.js",
@@ -16,8 +16,8 @@
16
16
  "@aclymatepackages/multi-part-form": "^2.0.1",
17
17
  "@aclymatepackages/other-helpers": "^1.0.9",
18
18
  "@aclymatepackages/reg-exp": "^1.0.0",
19
- "@aclymatepackages/subcategories": "^4.0.4",
20
- "@aclymatepackages/themes": "^4.0.0",
19
+ "@aclymatepackages/subcategories": "^4.1.2",
20
+ "@aclymatepackages/themes": "^4.1.0",
21
21
  "@babel/preset-react": "^7.16.7",
22
22
  "@emotion/react": "^11.11.1",
23
23
  "@emotion/styled": "^11.11.0",
@@ -14,22 +14,39 @@ import PlacesAutocompleteModule from "./PlacesAutocomplete";
14
14
 
15
15
  const CompanyOnboardingInput = ({
16
16
  appCheckToken,
17
- companyName,
17
+ companyName = "",
18
18
  header,
19
19
  onFormComplete,
20
20
  PlacesAutocomplete,
21
21
  theme,
22
+ websiteInput,
22
23
  }) => {
23
24
  const [inputData, setInputData] = useState({ name: companyName });
24
25
 
25
26
  const editInputData = (field) => (value) =>
26
27
  editObjectData(setInputData, field, value);
27
28
 
28
- const { location, industry, employeeCount, isRemote, name } = inputData;
29
+ const { location, industry, employeeCount, isRemote, name, username, email } =
30
+ inputData;
29
31
 
30
32
  const PlacesAutocompleteComponent =
31
33
  PlacesAutocomplete || PlacesAutocompleteModule;
32
34
 
35
+ const userInfoArray = websiteInput
36
+ ? [
37
+ {
38
+ label: "What is your name?",
39
+ value: username,
40
+ editData: editInputData("username"),
41
+ },
42
+ {
43
+ label: "What is your email address?",
44
+ value: email,
45
+ editData: editInputData("email"),
46
+ },
47
+ ]
48
+ : [];
49
+
33
50
  const nonPeopleDataLabsCompanyInputs = [
34
51
  {
35
52
  label: "How many employees work for your company?",
@@ -76,8 +93,9 @@ const CompanyOnboardingInput = ({
76
93
  lightBackground
77
94
  />
78
95
  ),
79
- onNextStep: () => onFormComplete(inputData),
96
+ onNextStep: !websiteInput && (() => onFormComplete(inputData)),
80
97
  },
98
+ ...userInfoArray,
81
99
  ];
82
100
 
83
101
  const formInputArray = nonPeopleDataLabsCompanyInputs.map((input) => ({
@@ -97,17 +115,19 @@ const CompanyOnboardingInput = ({
97
115
  label="What is your company's name?"
98
116
  />
99
117
  </Grid>
100
- <Grid item xs={12}>
101
- <MultiPartFormLayout
102
- forms={[{ name: "onboarding", label: "Onboarding" }]}
103
- rows={formInputArray}
104
- confirmClose={false}
105
- theme={theme || mainTheme}
106
- styleProps={{ padding: 0 }}
107
- p={0}
108
- noGutter
109
- />
110
- </Grid>
118
+ {name && (
119
+ <Grid item xs={12}>
120
+ <MultiPartFormLayout
121
+ forms={[{ name: "onboarding", label: "Onboarding" }]}
122
+ rows={formInputArray}
123
+ confirmClose={false}
124
+ theme={theme || mainTheme}
125
+ styleProps={{ padding: 0 }}
126
+ p={0}
127
+ noGutter
128
+ />
129
+ </Grid>
130
+ )}
111
131
  </Grid>
112
132
  </Container>
113
133
  );