@stokr/components-library 2.3.58-beta.10 → 2.3.58-beta.12
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/dist/components/AdminDashboard/Table/ReactTable.js +12 -3
- package/dist/components/AdminDashboard/Table/Table.styles.js +1 -1
- package/dist/components/Footer/FooterLayout.js +1 -1
- package/dist/components/Footer/FooterMenu.stories.js +1 -1
- package/dist/components/headerHo/HeaderHo.js +16 -2
- package/dist/styles/colors.js +2 -1
- package/package.json +1 -1
|
@@ -33,6 +33,10 @@ function ReactTable(props) {
|
|
|
33
33
|
customRowHoverContent,
|
|
34
34
|
customRowStyles,
|
|
35
35
|
customTableStyles,
|
|
36
|
+
tableWrapStyles,
|
|
37
|
+
getRowDataCy,
|
|
38
|
+
// Function to generate data-cy attribute: (rowData, rowIndex) => string
|
|
39
|
+
|
|
36
40
|
//instead of passing the subData, we pass a function that will calculate the subData
|
|
37
41
|
//subData must be part of the data array (an array or whatever)
|
|
38
42
|
//calculateSubData is a function that receives the row and returns the subData
|
|
@@ -81,7 +85,9 @@ function ReactTable(props) {
|
|
|
81
85
|
}
|
|
82
86
|
return cell.render('Cell');
|
|
83
87
|
};
|
|
84
|
-
return /*#__PURE__*/_react.default.createElement(_Table.Styles, null, /*#__PURE__*/_react.default.createElement(_Table.TableWrap,
|
|
88
|
+
return /*#__PURE__*/_react.default.createElement(_Table.Styles, null, /*#__PURE__*/_react.default.createElement(_Table.TableWrap, {
|
|
89
|
+
tableWrapStyles: tableWrapStyles
|
|
90
|
+
}, /*#__PURE__*/_react.default.createElement(_Table.StyledReactTable, _extends({}, getTableProps(), {
|
|
85
91
|
customTableStyles: customTableStyles
|
|
86
92
|
}), /*#__PURE__*/_react.default.createElement("thead", null, headerGroups.map(headerGroup => /*#__PURE__*/_react.default.createElement(_Table.StyledReactTable.Tr, headerGroup.getHeaderGroupProps(), headerGroup.headers.map(column => {
|
|
87
93
|
const cellStyles = customThStyles ? customThStyles(column) : {};
|
|
@@ -98,7 +104,9 @@ function ReactTable(props) {
|
|
|
98
104
|
prepareRow(row);
|
|
99
105
|
return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, {
|
|
100
106
|
key: row.id
|
|
101
|
-
}, /*#__PURE__*/_react.default.createElement(_Table.StyledReactTable.Tr, _extends({}, row.getRowProps(
|
|
107
|
+
}, /*#__PURE__*/_react.default.createElement(_Table.StyledReactTable.Tr, _extends({}, row.getRowProps({
|
|
108
|
+
'data-cy': getRowDataCy ? getRowDataCy(row.original, i) : undefined
|
|
109
|
+
}), {
|
|
102
110
|
customRowHoverStyles: customRowHoverStyles,
|
|
103
111
|
customRowStyles: customRowStyles,
|
|
104
112
|
rowIndex: i,
|
|
@@ -151,7 +159,8 @@ ReactTable.propTypes = {
|
|
|
151
159
|
customRowHoverStyles: _propTypes.default.func,
|
|
152
160
|
customRowHoverContent: _propTypes.default.func,
|
|
153
161
|
customRowStyles: _propTypes.default.func,
|
|
154
|
-
customTableStyles: _propTypes.default.func
|
|
162
|
+
customTableStyles: _propTypes.default.func,
|
|
163
|
+
getRowDataCy: _propTypes.default.func // (rowData, rowIndex) => string
|
|
155
164
|
};
|
|
156
165
|
ReactTable.defaultProps = {
|
|
157
166
|
blue: false,
|
|
@@ -69,7 +69,7 @@ const StyledTd = exports.StyledTd = _styledComponents.default.td.withConfig({
|
|
|
69
69
|
const StyledTr = exports.StyledTr = _styledComponents.default.tr.withConfig({
|
|
70
70
|
displayName: "Tablestyles__StyledTr",
|
|
71
71
|
componentId: "sc-pdcd6r-14"
|
|
72
|
-
})(["", " ", ""], props => props.customRowStyles && (0, _styledComponents.css)(["", ""], props.customRowStyles(props.rowIndex, props.rowData)), props => props.customRowHoverStyles && (0, _styledComponents.css)(["&:hover{", "}"], props.customRowHoverStyles(props.rowIndex, props.rowData)));
|
|
72
|
+
})(["", " ", ""], props => props.customRowStyles && (0, _styledComponents.css)(["", ""], props.customRowStyles(props.rowIndex, props.rowData)), props => props.customRowHoverStyles && (0, _styledComponents.css)(["&:hover,&:focus,&:active{", "}"], props.customRowHoverStyles(props.rowIndex, props.rowData)));
|
|
73
73
|
const StyledReactTable = exports.StyledReactTable = _styledComponents.default.table.withConfig({
|
|
74
74
|
displayName: "Tablestyles__StyledReactTable",
|
|
75
75
|
componentId: "sc-pdcd6r-15"
|
|
@@ -480,14 +480,22 @@ class HeaderHoClass extends _react.Component {
|
|
|
480
480
|
this.switchOpenModal('signUp', 'confirm');
|
|
481
481
|
this.setIsActionLoading(undefined);
|
|
482
482
|
} catch (error) {
|
|
483
|
+
var _error$response;
|
|
483
484
|
console.log(error);
|
|
485
|
+
let errorMessage = 'Oops, something went wrong';
|
|
486
|
+
if ((error === null || error === void 0 || (_error$response = error.response) === null || _error$response === void 0 ? void 0 : _error$response.status) === 429) {
|
|
487
|
+
var _error$response$data;
|
|
488
|
+
errorMessage = (_error$response$data = error.response.data) === null || _error$response$data === void 0 ? void 0 : _error$response$data.message;
|
|
489
|
+
}
|
|
484
490
|
this.setIsActionLoading(undefined);
|
|
485
491
|
if ((error === null || error === void 0 ? void 0 : error.code) === 'auth/email-already-in-use') {
|
|
486
492
|
this.setPopupError('register', 'This email address is already taken', 'email');
|
|
487
493
|
} else if ((error === null || error === void 0 ? void 0 : error.code) === 'auth/weak-password') {
|
|
488
494
|
this.setPopupError('register', 'The password is too weak. Please try again.', 'password');
|
|
495
|
+
} else if ((error === null || error === void 0 ? void 0 : error.code) === 'auth/error-code:-47') {
|
|
496
|
+
this.setPopupError('register', 'Too many signup attempts. Please try again later.');
|
|
489
497
|
} else {
|
|
490
|
-
this.setPopupError('register',
|
|
498
|
+
this.setPopupError('register', errorMessage);
|
|
491
499
|
}
|
|
492
500
|
}
|
|
493
501
|
}
|
|
@@ -573,8 +581,14 @@ class HeaderHoClass extends _react.Component {
|
|
|
573
581
|
this.setPopupSuccess('forgot', "We sent a message to ".concat(email, " (you might need to check your junk or spam folder) \u2014 tap the link inside to create a new password."));
|
|
574
582
|
this.setIsActionLoading(undefined);
|
|
575
583
|
} catch (error) {
|
|
584
|
+
var _error$response2;
|
|
576
585
|
console.log(error);
|
|
577
|
-
|
|
586
|
+
let errorMessage = "Too many requests. Please try again later.";
|
|
587
|
+
if ((error === null || error === void 0 || (_error$response2 = error.response) === null || _error$response2 === void 0 ? void 0 : _error$response2.status) === 429) {
|
|
588
|
+
var _error$response$data2;
|
|
589
|
+
errorMessage = (_error$response$data2 = error.response.data) === null || _error$response$data2 === void 0 ? void 0 : _error$response$data2.message;
|
|
590
|
+
}
|
|
591
|
+
this.setPopupError('forgot', errorMessage);
|
|
578
592
|
this.setIsActionLoading(undefined);
|
|
579
593
|
}
|
|
580
594
|
}
|
package/dist/styles/colors.js
CHANGED