@stokr/components-library 2.3.44-beta.3 → 2.3.45
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 +42 -11
- package/dist/components/AdminDashboard/Table/ReactTable.stories.js +140 -9
- package/dist/components/AdminDashboard/Table/ReactTableWrapper.js +8 -2
- package/dist/components/AdminDashboard/Table/Table.styles.js +14 -2
- package/dist/components/ButtonContainer/ButtonContainer.styles.js +6 -1
- package/dist/components/CryptoAddress/CryptoAddress.js +6 -3
- package/dist/components/CryptoAddress/RadioWrap.js +2 -2
- package/dist/components/HeroBlock/HeroVideoBlock.js +108 -0
- package/dist/components/InfoIcon/InfoIcon.js +4 -2
- package/dist/components/InfoIcon/InfoIcon.styles.js +5 -1
- package/dist/components/Modal/NewVentureModal/NewVentureModal.js +104 -265
- package/dist/components/Modal/NewVentureModal/NewVentureModal.stories.js +3 -2
- package/dist/context/AuthContext.js +159 -107
- package/dist/context/Checkbox/CheckboxContext.js +164 -0
- package/dist/hooks/useNewVentureForm.js +310 -0
- package/dist/index.js +11 -0
- package/package.json +1 -1
|
@@ -37,8 +37,15 @@ function ReactTable(props) {
|
|
|
37
37
|
customTdStyles = props.customTdStyles,
|
|
38
38
|
customThStyles = props.customThStyles,
|
|
39
39
|
customRowHoverStyles = props.customRowHoverStyles,
|
|
40
|
+
customRowHoverContent = props.customRowHoverContent,
|
|
40
41
|
calculateSubData = props.calculateSubData;
|
|
41
42
|
|
|
43
|
+
// State to track which row is being hovered
|
|
44
|
+
var _useState = (0, _react.useState)(null),
|
|
45
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
46
|
+
hoveredRowIndex = _useState2[0],
|
|
47
|
+
setHoveredRowIndex = _useState2[1];
|
|
48
|
+
|
|
42
49
|
// Use the state and functions returned from useTable to build UI
|
|
43
50
|
var _useTable = (0, _reactTable.useTable)({
|
|
44
51
|
columns: columns,
|
|
@@ -59,13 +66,24 @@ function ReactTable(props) {
|
|
|
59
66
|
_useTable$state = _useTable.state,
|
|
60
67
|
pageIndex = _useTable$state.pageIndex,
|
|
61
68
|
pageSize = _useTable$state.pageSize;
|
|
62
|
-
var
|
|
63
|
-
|
|
64
|
-
inputPageSize =
|
|
65
|
-
setInputPageSize =
|
|
69
|
+
var _useState3 = (0, _react.useState)(isSubTable ? 10000 : 10),
|
|
70
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
|
71
|
+
inputPageSize = _useState4[0],
|
|
72
|
+
setInputPageSize = _useState4[1];
|
|
66
73
|
_react.default.useEffect(function () {
|
|
67
74
|
setInputPageSize(pageSize);
|
|
68
75
|
}, [pageSize]);
|
|
76
|
+
|
|
77
|
+
// Function to render cell content with hover support
|
|
78
|
+
var renderCellContent = function renderCellContent(cell, rowIndex, rowData) {
|
|
79
|
+
if (customRowHoverContent && hoveredRowIndex === rowIndex) {
|
|
80
|
+
var hoverContent = customRowHoverContent(cell.column.id, rowIndex, rowData);
|
|
81
|
+
if (hoverContent !== undefined) {
|
|
82
|
+
return hoverContent;
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
return cell.render('Cell');
|
|
86
|
+
};
|
|
69
87
|
return /*#__PURE__*/_react.default.createElement(_Table.Styles, null, /*#__PURE__*/_react.default.createElement(_Table.TableWrap, null, /*#__PURE__*/_react.default.createElement(_Table.StyledReactTable, getTableProps(), /*#__PURE__*/_react.default.createElement("thead", null, headerGroups.map(function (headerGroup) {
|
|
70
88
|
return /*#__PURE__*/_react.default.createElement(_Table.StyledReactTable.Tr, headerGroup.getHeaderGroupProps(), headerGroup.headers.map(function (column) {
|
|
71
89
|
var cellStyles = customThStyles ? customThStyles(column) : {};
|
|
@@ -73,7 +91,10 @@ function ReactTable(props) {
|
|
|
73
91
|
className: column.collapse ? 'collapse' : '',
|
|
74
92
|
style: _objectSpread({}, cellStyles)
|
|
75
93
|
}), {
|
|
76
|
-
blue: blue
|
|
94
|
+
blue: blue,
|
|
95
|
+
width: column.width,
|
|
96
|
+
minWidth: column.minWidth,
|
|
97
|
+
maxWidth: column.maxWidth
|
|
77
98
|
}), column.render('Header'));
|
|
78
99
|
}));
|
|
79
100
|
})), /*#__PURE__*/_react.default.createElement("tbody", getTableBodyProps(), page.map(function (row, i) {
|
|
@@ -81,17 +102,26 @@ function ReactTable(props) {
|
|
|
81
102
|
return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, {
|
|
82
103
|
key: row.id
|
|
83
104
|
}, /*#__PURE__*/_react.default.createElement(_Table.StyledReactTable.Tr, _extends({}, row.getRowProps(), {
|
|
84
|
-
customRowHoverStyles: customRowHoverStyles
|
|
85
|
-
|
|
86
|
-
|
|
105
|
+
customRowHoverStyles: customRowHoverStyles,
|
|
106
|
+
rowIndex: i,
|
|
107
|
+
rowData: row.original,
|
|
108
|
+
onMouseEnter: function onMouseEnter() {
|
|
109
|
+
return setHoveredRowIndex(i);
|
|
110
|
+
},
|
|
111
|
+
onMouseLeave: function onMouseLeave() {
|
|
112
|
+
return setHoveredRowIndex(null);
|
|
113
|
+
}
|
|
87
114
|
}), row.cells.map(function (cell) {
|
|
88
115
|
var cellStyles = customTdStyles ? customTdStyles(i, row.original) : {};
|
|
89
116
|
return /*#__PURE__*/_react.default.createElement(_Table.StyledReactTable.Td, _extends({}, cell.row.getToggleRowExpandedProps(), cell.getCellProps({
|
|
90
117
|
className: cell.column.collapse ? 'collapse' : '',
|
|
91
118
|
style: _objectSpread({}, cellStyles)
|
|
92
119
|
}), {
|
|
93
|
-
blue: blue
|
|
94
|
-
|
|
120
|
+
blue: blue,
|
|
121
|
+
width: cell.column.width,
|
|
122
|
+
minWidth: cell.column.minWidth,
|
|
123
|
+
maxWidth: cell.column.maxWidth
|
|
124
|
+
}), renderCellContent(cell, i, row.original));
|
|
95
125
|
})), withSubTable && row.isExpanded && /*#__PURE__*/_react.default.createElement(_Table.StyledReactTable.Tr, {
|
|
96
126
|
key: "".concat(row.id, "-").concat(i)
|
|
97
127
|
}, /*#__PURE__*/_react.default.createElement(_Table.StyledReactTable.Td, {
|
|
@@ -124,7 +154,8 @@ ReactTable.propTypes = {
|
|
|
124
154
|
noPagination: _propTypes.default.bool,
|
|
125
155
|
withSubTable: _propTypes.default.bool,
|
|
126
156
|
isSubTable: _propTypes.default.bool,
|
|
127
|
-
customRowHoverStyles: _propTypes.default.func
|
|
157
|
+
customRowHoverStyles: _propTypes.default.func,
|
|
158
|
+
customRowHoverContent: _propTypes.default.func
|
|
128
159
|
};
|
|
129
160
|
ReactTable.defaultProps = {
|
|
130
161
|
blue: false,
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.default = exports.WrapperWithSubTable = exports.WithoutPagination = exports.WithSubTable = exports.WithStatusBasedHover = exports.WithRowHover = exports.WithCustomStyling = exports.DefaultWrapper = exports.Default = exports.BlueWrapper = exports.BlueTable = void 0;
|
|
6
|
+
exports.default = exports.WrapperWithSubTable = exports.WithoutPagination = exports.WithSubTable = exports.WithStatusBasedHover = exports.WithRowSpecificHover = exports.WithRowHover = exports.WithHoverStylesAndContent = exports.WithHoverContent = exports.WithFixedColumnWidths = exports.WithCustomStyling = exports.DefaultWrapper = exports.Default = exports.BlueWrapper = exports.BlueTable = void 0;
|
|
7
7
|
var _react = _interopRequireDefault(require("react"));
|
|
8
8
|
var _ReactTable = require("./ReactTable");
|
|
9
9
|
var _ReactTableWrapper = require("./ReactTableWrapper");
|
|
@@ -49,35 +49,54 @@ var _default = {
|
|
|
49
49
|
},
|
|
50
50
|
customRowHoverStyles: {
|
|
51
51
|
control: 'function'
|
|
52
|
+
},
|
|
53
|
+
customRowHoverContent: {
|
|
54
|
+
control: 'function'
|
|
52
55
|
}
|
|
53
56
|
}
|
|
54
57
|
}; // Sample columns and data for demonstration
|
|
55
58
|
exports.default = _default;
|
|
56
59
|
var columns = [{
|
|
57
60
|
Header: 'ID',
|
|
58
|
-
accessor: 'id'
|
|
61
|
+
accessor: 'id',
|
|
62
|
+
width: '10%',
|
|
63
|
+
minWidth: '80px'
|
|
59
64
|
}, {
|
|
60
65
|
Header: 'Name',
|
|
61
|
-
accessor: 'name'
|
|
66
|
+
accessor: 'name',
|
|
67
|
+
width: '30%',
|
|
68
|
+
minWidth: '150px'
|
|
62
69
|
}, {
|
|
63
70
|
Header: 'Status',
|
|
64
|
-
accessor: 'status'
|
|
71
|
+
accessor: 'status',
|
|
72
|
+
width: '20%',
|
|
73
|
+
minWidth: '100px'
|
|
65
74
|
}, {
|
|
66
75
|
Header: '',
|
|
67
|
-
accessor: 'dropdown'
|
|
76
|
+
accessor: 'dropdown',
|
|
77
|
+
width: '40%',
|
|
78
|
+
minWidth: '120px'
|
|
68
79
|
}];
|
|
69
80
|
var columnsWrapper = [{
|
|
70
81
|
label: 'ID',
|
|
71
|
-
key: 'id'
|
|
82
|
+
key: 'id',
|
|
83
|
+
width: '10%',
|
|
84
|
+
minWidth: '80px'
|
|
72
85
|
}, {
|
|
73
86
|
label: 'Name',
|
|
74
|
-
key: 'name'
|
|
87
|
+
key: 'name',
|
|
88
|
+
width: '30%',
|
|
89
|
+
minWidth: '150px'
|
|
75
90
|
}, {
|
|
76
91
|
label: 'Status',
|
|
77
|
-
key: 'status'
|
|
92
|
+
key: 'status',
|
|
93
|
+
width: '20%',
|
|
94
|
+
minWidth: '100px'
|
|
78
95
|
}, {
|
|
79
96
|
label: '',
|
|
80
|
-
key: 'dropdown'
|
|
97
|
+
key: 'dropdown',
|
|
98
|
+
width: '40%',
|
|
99
|
+
minWidth: '120px'
|
|
81
100
|
}];
|
|
82
101
|
var subColumns = [{
|
|
83
102
|
Header: 'Detail ID',
|
|
@@ -160,6 +179,80 @@ var customRowHoverStyles = function customRowHoverStyles(rowIndex, rowData) {
|
|
|
160
179
|
return "\n background-color: #f0f8ff !important;\n transform: scale(1.01);\n transition: all 0.2s ease-in-out;\n box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);\n \n td {\n background-color: #f0f8ff !important;\n border-bottom-color: #0050ca !important;\n }\n ";
|
|
161
180
|
};
|
|
162
181
|
|
|
182
|
+
// Custom row hover content function
|
|
183
|
+
var customRowHoverContent = function customRowHoverContent(columnId, rowIndex, rowData) {
|
|
184
|
+
switch (columnId) {
|
|
185
|
+
case 'name':
|
|
186
|
+
// Show underlined link on hover
|
|
187
|
+
return /*#__PURE__*/_react.default.createElement("a", {
|
|
188
|
+
href: "/user/".concat(rowData.id),
|
|
189
|
+
style: {
|
|
190
|
+
textDecoration: 'underline',
|
|
191
|
+
color: '#0050ca',
|
|
192
|
+
fontWeight: 'bold'
|
|
193
|
+
}
|
|
194
|
+
}, rowData.name);
|
|
195
|
+
case 'dropdown':
|
|
196
|
+
// Show action buttons on hover
|
|
197
|
+
return /*#__PURE__*/_react.default.createElement("div", {
|
|
198
|
+
style: {
|
|
199
|
+
display: 'flex',
|
|
200
|
+
gap: '8px'
|
|
201
|
+
}
|
|
202
|
+
}, /*#__PURE__*/_react.default.createElement("button", {
|
|
203
|
+
style: {
|
|
204
|
+
padding: '4px 8px',
|
|
205
|
+
fontSize: '12px',
|
|
206
|
+
backgroundColor: '#0050ca',
|
|
207
|
+
color: 'white',
|
|
208
|
+
border: 'none',
|
|
209
|
+
borderRadius: '4px',
|
|
210
|
+
cursor: 'pointer'
|
|
211
|
+
},
|
|
212
|
+
onClick: function onClick() {
|
|
213
|
+
return alert("Edit ".concat(rowData.name));
|
|
214
|
+
}
|
|
215
|
+
}, "Edit"), /*#__PURE__*/_react.default.createElement("button", {
|
|
216
|
+
style: {
|
|
217
|
+
padding: '4px 8px',
|
|
218
|
+
fontSize: '12px',
|
|
219
|
+
backgroundColor: '#dc3545',
|
|
220
|
+
color: 'white',
|
|
221
|
+
border: 'none',
|
|
222
|
+
borderRadius: '4px',
|
|
223
|
+
cursor: 'pointer'
|
|
224
|
+
},
|
|
225
|
+
onClick: function onClick() {
|
|
226
|
+
return alert("Delete ".concat(rowData.name));
|
|
227
|
+
}
|
|
228
|
+
}, "Delete"));
|
|
229
|
+
case 'status':
|
|
230
|
+
// Show status with icon on hover
|
|
231
|
+
var statusColors = {
|
|
232
|
+
Active: '#28a745',
|
|
233
|
+
Inactive: '#dc3545',
|
|
234
|
+
Pending: '#ffc107'
|
|
235
|
+
};
|
|
236
|
+
return /*#__PURE__*/_react.default.createElement("div", {
|
|
237
|
+
style: {
|
|
238
|
+
display: 'flex',
|
|
239
|
+
alignItems: 'center',
|
|
240
|
+
gap: '4px'
|
|
241
|
+
}
|
|
242
|
+
}, /*#__PURE__*/_react.default.createElement("span", {
|
|
243
|
+
style: {
|
|
244
|
+
width: '8px',
|
|
245
|
+
height: '8px',
|
|
246
|
+
borderRadius: '50%',
|
|
247
|
+
backgroundColor: statusColors[rowData.status] || '#6c757d'
|
|
248
|
+
}
|
|
249
|
+
}), rowData.status);
|
|
250
|
+
default:
|
|
251
|
+
return undefined;
|
|
252
|
+
// Return undefined to use default content
|
|
253
|
+
}
|
|
254
|
+
};
|
|
255
|
+
|
|
163
256
|
// Status-based hover styles
|
|
164
257
|
var statusBasedHoverStyles = function statusBasedHoverStyles(rowIndex, rowData) {
|
|
165
258
|
switch (rowData.status) {
|
|
@@ -174,6 +267,22 @@ var statusBasedHoverStyles = function statusBasedHoverStyles(rowIndex, rowData)
|
|
|
174
267
|
}
|
|
175
268
|
};
|
|
176
269
|
|
|
270
|
+
// Row-specific hover styles (example: different styles for first and last rows)
|
|
271
|
+
var rowSpecificHoverStyles = function rowSpecificHoverStyles(rowIndex, rowData) {
|
|
272
|
+
// Special styling for first row
|
|
273
|
+
if (rowIndex === 0) {
|
|
274
|
+
return "\n background-color: #e3f2fd !important;\n transform: scale(1.02);\n box-shadow: 0 4px 12px rgba(33, 150, 243, 0.3);\n td {\n background-color: #e3f2fd !important;\n border-bottom-color: #2196f3 !important;\n font-weight: bold;\n }\n ";
|
|
275
|
+
}
|
|
276
|
+
|
|
277
|
+
// Special styling for last row
|
|
278
|
+
if (rowIndex === data.length - 1) {
|
|
279
|
+
return "\n background-color: #f3e5f5 !important;\n transform: scale(1.02);\n box-shadow: 0 4px 12px rgba(156, 39, 176, 0.3);\n td {\n background-color: #f3e5f5 !important;\n border-bottom-color: #9c27b0 !important;\n font-weight: bold;\n }\n ";
|
|
280
|
+
}
|
|
281
|
+
|
|
282
|
+
// Default styling for other rows
|
|
283
|
+
return "\n background-color: #f0f8ff !important;\n transform: scale(1.01);\n box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);\n td {\n background-color: #f0f8ff !important;\n border-bottom-color: #0050ca !important;\n }\n ";
|
|
284
|
+
};
|
|
285
|
+
|
|
177
286
|
// Function to calculate sub data
|
|
178
287
|
var calculateSubData = function calculateSubData(row) {
|
|
179
288
|
return row.original.subData || [];
|
|
@@ -207,11 +316,33 @@ exports.WithRowHover = WithRowHover;
|
|
|
207
316
|
WithRowHover.args = _objectSpread(_objectSpread({}, Default.args), {}, {
|
|
208
317
|
customRowHoverStyles: customRowHoverStyles
|
|
209
318
|
});
|
|
319
|
+
var WithHoverContent = Template.bind({});
|
|
320
|
+
exports.WithHoverContent = WithHoverContent;
|
|
321
|
+
WithHoverContent.args = _objectSpread(_objectSpread({}, Default.args), {}, {
|
|
322
|
+
customRowHoverContent: customRowHoverContent
|
|
323
|
+
});
|
|
324
|
+
var WithHoverStylesAndContent = Template.bind({});
|
|
325
|
+
exports.WithHoverStylesAndContent = WithHoverStylesAndContent;
|
|
326
|
+
WithHoverStylesAndContent.args = _objectSpread(_objectSpread({}, Default.args), {}, {
|
|
327
|
+
customRowHoverStyles: customRowHoverStyles,
|
|
328
|
+
customRowHoverContent: customRowHoverContent
|
|
329
|
+
});
|
|
210
330
|
var WithStatusBasedHover = Template.bind({});
|
|
211
331
|
exports.WithStatusBasedHover = WithStatusBasedHover;
|
|
212
332
|
WithStatusBasedHover.args = _objectSpread(_objectSpread({}, Default.args), {}, {
|
|
213
333
|
customRowHoverStyles: statusBasedHoverStyles
|
|
214
334
|
});
|
|
335
|
+
var WithRowSpecificHover = Template.bind({});
|
|
336
|
+
exports.WithRowSpecificHover = WithRowSpecificHover;
|
|
337
|
+
WithRowSpecificHover.args = _objectSpread(_objectSpread({}, Default.args), {}, {
|
|
338
|
+
customRowHoverStyles: rowSpecificHoverStyles
|
|
339
|
+
});
|
|
340
|
+
var WithFixedColumnWidths = Template.bind({});
|
|
341
|
+
exports.WithFixedColumnWidths = WithFixedColumnWidths;
|
|
342
|
+
WithFixedColumnWidths.args = _objectSpread(_objectSpread({}, Default.args), {}, {
|
|
343
|
+
customRowHoverContent: customRowHoverContent,
|
|
344
|
+
customRowHoverStyles: customRowHoverStyles
|
|
345
|
+
});
|
|
215
346
|
var WithSubTable = Template.bind({});
|
|
216
347
|
exports.WithSubTable = WithSubTable;
|
|
217
348
|
WithSubTable.args = _objectSpread(_objectSpread({}, Default.args), {}, {
|
|
@@ -10,9 +10,15 @@ var _Table = require("./Table.styles");
|
|
|
10
10
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
11
11
|
var _excluded = ["columns", "subColumns"];
|
|
12
12
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
13
|
+
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
13
14
|
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
14
15
|
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
15
16
|
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
17
|
+
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
18
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
19
|
+
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
20
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
21
|
+
function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
16
22
|
//This components is used only to memoize the values before we sent them to the react-table
|
|
17
23
|
var ReactTableWrapper = function ReactTableWrapper(props) {
|
|
18
24
|
var makeNewColumns = function makeNewColumns(data) {
|
|
@@ -38,10 +44,10 @@ var ReactTableWrapper = function ReactTableWrapper(props) {
|
|
|
38
44
|
}
|
|
39
45
|
};
|
|
40
46
|
}
|
|
41
|
-
return {
|
|
47
|
+
return _objectSpread({
|
|
42
48
|
Header: column.label || column.Header,
|
|
43
49
|
accessor: column.key || column.accessor
|
|
44
|
-
};
|
|
50
|
+
}, column);
|
|
45
51
|
});
|
|
46
52
|
};
|
|
47
53
|
var memoizedColumns = _react.default.useMemo(function () {
|
|
@@ -99,17 +99,29 @@ exports.TableWrap = TableWrap;
|
|
|
99
99
|
var StyledTh = _styledComponents.default.th.withConfig({
|
|
100
100
|
displayName: "Tablestyles__StyledTh",
|
|
101
101
|
componentId: "sc-pdcd6r-12"
|
|
102
|
-
})(["text-transform:uppercase;padding:10px;font-size:11px;letter-spacing:1.6px;font-weight:600;background-color:white;color:#000000de;border-bottom:1px solid #e1e1e1;line-height:20px;", ""], function (props) {
|
|
102
|
+
})(["text-transform:uppercase;padding:10px;font-size:11px;letter-spacing:1.6px;font-weight:600;background-color:white;color:#000000de;border-bottom:1px solid #e1e1e1;line-height:20px;", " ", " ", " ", ""], function (props) {
|
|
103
103
|
return props.blue && "\n background-color: #0050ca;\n color: #ffffff;\n border:none;\n ";
|
|
104
|
+
}, function (props) {
|
|
105
|
+
return props.width && "\n width: ".concat(props.width, ";\n min-width: ").concat(props.width, ";\n max-width: ").concat(props.width, ";\n ");
|
|
106
|
+
}, function (props) {
|
|
107
|
+
return props.minWidth && "\n min-width: ".concat(props.minWidth, ";\n ");
|
|
108
|
+
}, function (props) {
|
|
109
|
+
return props.maxWidth && "\n max-width: ".concat(props.maxWidth, ";\n ");
|
|
104
110
|
});
|
|
105
111
|
exports.StyledTh = StyledTh;
|
|
106
112
|
var StyledTd = _styledComponents.default.td.withConfig({
|
|
107
113
|
displayName: "Tablestyles__StyledTd",
|
|
108
114
|
componentId: "sc-pdcd6r-13"
|
|
109
|
-
})(["padding:26px 15px;border-bottom:1px solid #e1e1e1;font-size:14px;", " ", ""], function (props) {
|
|
115
|
+
})(["padding:26px 15px;border-bottom:1px solid #e1e1e1;font-size:14px;", " ", " ", " ", " ", ""], function (props) {
|
|
110
116
|
return props.blue && "\n background-color: #004bb7;\n color: #ffffff;\n ";
|
|
111
117
|
}, function (props) {
|
|
112
118
|
return props.subTable && "\n padding: 0;\n &:last-child {\n border-bottom: 0;\n }\n ";
|
|
119
|
+
}, function (props) {
|
|
120
|
+
return props.width && "\n width: ".concat(props.width, ";\n min-width: ").concat(props.width, ";\n max-width: ").concat(props.width, ";\n ");
|
|
121
|
+
}, function (props) {
|
|
122
|
+
return props.minWidth && "\n min-width: ".concat(props.minWidth, ";\n ");
|
|
123
|
+
}, function (props) {
|
|
124
|
+
return props.maxWidth && "\n max-width: ".concat(props.maxWidth, ";\n ");
|
|
113
125
|
});
|
|
114
126
|
exports.StyledTd = StyledTd;
|
|
115
127
|
var StyledTr = _styledComponents.default.tr.withConfig({
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.default = exports.ButtonContainer = void 0;
|
|
6
|
+
exports.default = exports.ButtonGridContainer = exports.ButtonContainer = void 0;
|
|
7
7
|
var _styledComponents = _interopRequireDefault(require("styled-components"));
|
|
8
8
|
var _Button = _interopRequireDefault(require("../Button/Button.styles"));
|
|
9
9
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
@@ -14,5 +14,10 @@ var ButtonContainer = _styledComponents.default.div.withConfig({
|
|
|
14
14
|
return props.flexColumn && "\n flex-direction:column;\n ";
|
|
15
15
|
}, _Button.default, _Button.default);
|
|
16
16
|
exports.ButtonContainer = ButtonContainer;
|
|
17
|
+
var ButtonGridContainer = _styledComponents.default.div.withConfig({
|
|
18
|
+
displayName: "ButtonContainerstyles__ButtonGridContainer",
|
|
19
|
+
componentId: "sc-1no5512-1"
|
|
20
|
+
})(["display:grid;grid-template-columns:repeat(2,1fr);gap:10px;justify-items:center;align-items:center;", "{min-width:150px;max-width:300px;width:100%;}@media screen and (max-width:767px){grid-template-columns:repeat(1,1fr);", "{max-width:400px;}}"], _Button.default, _Button.default);
|
|
21
|
+
exports.ButtonGridContainer = ButtonGridContainer;
|
|
17
22
|
var _default = ButtonContainer;
|
|
18
23
|
exports.default = _default;
|
|
@@ -47,7 +47,8 @@ var CryptoAddress = function CryptoAddress(_ref) {
|
|
|
47
47
|
infoBoxStyle = _ref.infoBoxStyle,
|
|
48
48
|
wrapperStyle = _ref.wrapperStyle,
|
|
49
49
|
bodyStyle = _ref.bodyStyle,
|
|
50
|
-
containerStyle = _ref.containerStyle
|
|
50
|
+
containerStyle = _ref.containerStyle,
|
|
51
|
+
dataValueStyle = _ref.dataValueStyle;
|
|
51
52
|
var _useState = (0, _react.useState)(false),
|
|
52
53
|
_useState2 = _slicedToArray(_useState, 2),
|
|
53
54
|
copiedAddressToClipboard = _useState2[0],
|
|
@@ -95,7 +96,8 @@ var CryptoAddress = function CryptoAddress(_ref) {
|
|
|
95
96
|
}, /*#__PURE__*/_react.default.createElement(_CryptoAddress.DataBox, {
|
|
96
97
|
style: dataBoxStyle
|
|
97
98
|
}, data.value && /*#__PURE__*/_react.default.createElement(_CryptoAddress.Value, {
|
|
98
|
-
fontSize: fontSize
|
|
99
|
+
fontSize: fontSize,
|
|
100
|
+
style: dataValueStyle
|
|
99
101
|
}, data.unit && "".concat(data.unit, " "), data.shortAddress ? /*#__PURE__*/_react.default.createElement(_reactTippy.Tooltip, {
|
|
100
102
|
position: "top",
|
|
101
103
|
title: data.value,
|
|
@@ -161,7 +163,8 @@ CryptoAddress.propTypes = {
|
|
|
161
163
|
dataBoxStyle: _propTypes.default.object,
|
|
162
164
|
headStyle: _propTypes.default.object,
|
|
163
165
|
infoBoxStyle: _propTypes.default.object,
|
|
164
|
-
wrapperStyle: _propTypes.default.object
|
|
166
|
+
wrapperStyle: _propTypes.default.object,
|
|
167
|
+
dataValueStyle: _propTypes.default.object
|
|
165
168
|
};
|
|
166
169
|
//address not required in IIS, instead wrapping {address &&( .. now doing both which is redundant
|
|
167
170
|
|
|
@@ -16,8 +16,8 @@ var RadioWrap = function RadioWrap(_ref) {
|
|
|
16
16
|
radio = _ref.radio;
|
|
17
17
|
var handleOnClick = function handleOnClick(e) {
|
|
18
18
|
if (radio) {
|
|
19
|
-
radio.handleCheckedAddressRadio(e.target.id);
|
|
20
|
-
radio.handleSelectedCryptoAddress(radio.address);
|
|
19
|
+
radio.handleCheckedAddressRadio && radio.handleCheckedAddressRadio(e.target.id);
|
|
20
|
+
radio.handleSelectedCryptoAddress && radio.handleSelectedCryptoAddress(radio.address);
|
|
21
21
|
}
|
|
22
22
|
};
|
|
23
23
|
return radio ? /*#__PURE__*/_react.default.createElement(_CryptoAddress.Radio, {
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports.default = exports.HeroVideoBlock = void 0;
|
|
8
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
9
|
+
var _reactVisibilitySensor = _interopRequireDefault(require("react-visibility-sensor"));
|
|
10
|
+
var _styledComponents = _interopRequireDefault(require("styled-components"));
|
|
11
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
12
|
+
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
13
|
+
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
14
|
+
var VideoContainer = _styledComponents.default.div.withConfig({
|
|
15
|
+
displayName: "HeroVideoBlock__VideoContainer",
|
|
16
|
+
componentId: "sc-53qnrg-0"
|
|
17
|
+
})(["position:relative;width:100%;height:100%;overflow:hidden;"]);
|
|
18
|
+
var VideoBackground = _styledComponents.default.video.withConfig({
|
|
19
|
+
displayName: "HeroVideoBlock__VideoBackground",
|
|
20
|
+
componentId: "sc-53qnrg-1"
|
|
21
|
+
})(["width:100%;height:100%;object-fit:cover;position:absolute;top:0;left:0;"]);
|
|
22
|
+
var HeroVideoBlock = function HeroVideoBlock() {
|
|
23
|
+
var videoRef = (0, _react.useRef)(null);
|
|
24
|
+
var lastTimeRef = (0, _react.useRef)(0);
|
|
25
|
+
var lastVisibleTime = (0, _react.useRef)(Date.now());
|
|
26
|
+
var playVideo = function playVideo() {
|
|
27
|
+
if (!videoRef.current) return;
|
|
28
|
+
var isMobile = /iPhone|iPad|iPod|Android/i.test(navigator.userAgent);
|
|
29
|
+
|
|
30
|
+
// Store current time before attempting to play
|
|
31
|
+
if (videoRef.current.currentTime > 0) {
|
|
32
|
+
lastTimeRef.current = videoRef.current.currentTime;
|
|
33
|
+
}
|
|
34
|
+
var playPromise = videoRef.current.play();
|
|
35
|
+
if (playPromise !== undefined) {
|
|
36
|
+
playPromise.catch(function (error) {
|
|
37
|
+
console.log('Video play error:', error);
|
|
38
|
+
|
|
39
|
+
// If play fails on mobile, try the reset approach as a fallback
|
|
40
|
+
if (isMobile && videoRef.current) {
|
|
41
|
+
// Only reset if we've been away for a while (more than 2 seconds)
|
|
42
|
+
var resetNeeded = Date.now() - lastVisibleTime.current > 2000;
|
|
43
|
+
if (resetNeeded) {
|
|
44
|
+
// Small adjustment to current time to force refresh
|
|
45
|
+
videoRef.current.currentTime = lastTimeRef.current || 0.1;
|
|
46
|
+
videoRef.current.play().catch(function (e) {
|
|
47
|
+
return console.log('Retry failed:', e);
|
|
48
|
+
});
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
});
|
|
52
|
+
}
|
|
53
|
+
};
|
|
54
|
+
var handleVisibilityChange = function handleVisibilityChange(isVisible) {
|
|
55
|
+
if (isVisible) {
|
|
56
|
+
lastVisibleTime.current = Date.now();
|
|
57
|
+
if (videoRef.current) {
|
|
58
|
+
playVideo();
|
|
59
|
+
}
|
|
60
|
+
} else if (videoRef.current) {
|
|
61
|
+
// Save the current time when leaving
|
|
62
|
+
lastTimeRef.current = videoRef.current.currentTime;
|
|
63
|
+
}
|
|
64
|
+
};
|
|
65
|
+
|
|
66
|
+
// Effect for document visibility (tab switching/browser minimizing)
|
|
67
|
+
(0, _react.useEffect)(function () {
|
|
68
|
+
var handleDocVisibilityChange = function handleDocVisibilityChange() {
|
|
69
|
+
if (document.visibilityState === 'visible') {
|
|
70
|
+
lastVisibleTime.current = Date.now();
|
|
71
|
+
// Small delay to ensure the browser is ready
|
|
72
|
+
setTimeout(function () {
|
|
73
|
+
playVideo();
|
|
74
|
+
}, 300);
|
|
75
|
+
} else if (videoRef.current) {
|
|
76
|
+
// Save the current time when leaving
|
|
77
|
+
lastTimeRef.current = videoRef.current.currentTime;
|
|
78
|
+
}
|
|
79
|
+
};
|
|
80
|
+
document.addEventListener('visibilitychange', handleDocVisibilityChange);
|
|
81
|
+
|
|
82
|
+
// Initial play
|
|
83
|
+
playVideo();
|
|
84
|
+
return function () {
|
|
85
|
+
document.removeEventListener('visibilitychange', handleDocVisibilityChange);
|
|
86
|
+
};
|
|
87
|
+
}, []);
|
|
88
|
+
return /*#__PURE__*/_react.default.createElement(_reactVisibilitySensor.default, {
|
|
89
|
+
onChange: handleVisibilityChange,
|
|
90
|
+
partialVisibility: true
|
|
91
|
+
}, /*#__PURE__*/_react.default.createElement(VideoContainer, null, /*#__PURE__*/_react.default.createElement(VideoBackground, {
|
|
92
|
+
ref: videoRef,
|
|
93
|
+
autoPlay: true,
|
|
94
|
+
muted: true,
|
|
95
|
+
loop: true,
|
|
96
|
+
playsInline: true,
|
|
97
|
+
preload: "metadata",
|
|
98
|
+
"data-vsc-ignore": "true",
|
|
99
|
+
fetchPriority: "high"
|
|
100
|
+
}, /*#__PURE__*/_react.default.createElement("source", {
|
|
101
|
+
src: "https://res.cloudinary.com/stokr/video/upload/f_auto,q_auto:best/v1745923531/Static/Hero_section_video_kuatj1.mp4",
|
|
102
|
+
type: "video/mp4",
|
|
103
|
+
fetchPriority: "high"
|
|
104
|
+
}))));
|
|
105
|
+
};
|
|
106
|
+
exports.HeroVideoBlock = HeroVideoBlock;
|
|
107
|
+
var _default = HeroVideoBlock;
|
|
108
|
+
exports.default = _default;
|
|
@@ -8,7 +8,7 @@ var _react = _interopRequireDefault(require("react"));
|
|
|
8
8
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
9
9
|
var _reactTippy = require("react-tippy");
|
|
10
10
|
var _InfoIcon = require("./InfoIcon.styles");
|
|
11
|
-
var _excluded = ["title", "html", "position", "noMargin", "noMarginLeft", "noMarginRight", "noIcon", "disabled"];
|
|
11
|
+
var _excluded = ["title", "html", "position", "noMargin", "noMarginLeft", "noMarginRight", "noIcon", "disabled", "fullWidth"];
|
|
12
12
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
13
13
|
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
14
14
|
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
@@ -21,11 +21,13 @@ var InfoIcon = function InfoIcon(_ref) {
|
|
|
21
21
|
noMarginRight = _ref.noMarginRight,
|
|
22
22
|
noIcon = _ref.noIcon,
|
|
23
23
|
disabled = _ref.disabled,
|
|
24
|
+
fullWidth = _ref.fullWidth,
|
|
24
25
|
props = _objectWithoutProperties(_ref, _excluded);
|
|
25
26
|
return /*#__PURE__*/_react.default.createElement(_InfoIcon.Container, {
|
|
26
27
|
noMargin: noMargin,
|
|
27
28
|
noMarginLeft: noMarginLeft,
|
|
28
|
-
noMarginRight: noMarginRight
|
|
29
|
+
noMarginRight: noMarginRight,
|
|
30
|
+
fullWidth: fullWidth
|
|
29
31
|
}, /*#__PURE__*/_react.default.createElement(_reactTippy.Tooltip, {
|
|
30
32
|
position: position,
|
|
31
33
|
title: title,
|
|
@@ -10,12 +10,16 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de
|
|
|
10
10
|
var Container = _styledComponents.default.div.withConfig({
|
|
11
11
|
displayName: "InfoIconstyles__Container",
|
|
12
12
|
componentId: "sc-d3sdn3-0"
|
|
13
|
-
})(["display:inline-block;vertical-align:middle;margin:0 12px;font-size:0;line-height:0;", " ", " ", " & > div{position:relative;display:inline-block!important;}"], function (props) {
|
|
13
|
+
})(["display:inline-block;vertical-align:middle;margin:0 12px;font-size:0;line-height:0;", " ", " ", " ", " & > div{position:relative;display:inline-block !important;", "}"], function (props) {
|
|
14
14
|
return props.noMargin && "\n margin: 0;\n ";
|
|
15
15
|
}, function (props) {
|
|
16
16
|
return props.noMarginLeft && "\n margin-left: 0;\n ";
|
|
17
17
|
}, function (props) {
|
|
18
18
|
return props.noMarginRight && "\n margin-right: 0;\n ";
|
|
19
|
+
}, function (props) {
|
|
20
|
+
return props.fullWidth && "\n width: 100%;\n height: 100%;\n ";
|
|
21
|
+
}, function (props) {
|
|
22
|
+
return props.fullWidth && "\n width: 100%;\n height: 100%;\n display: flex !important;\n align-content: center;\n flex-wrap: wrap;\n justify-content: center;\n ";
|
|
19
23
|
});
|
|
20
24
|
exports.Container = Container;
|
|
21
25
|
var Icon = _styledComponents.default.i.attrs({
|