@learningpool/ui 1.7.3 → 1.7.4

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.
@@ -20,6 +20,7 @@ var AppHub = function (props) {
20
20
  var isPageLayout = props.isPageLayout, localization = props.localization, customLinkBgColor = props.customLinkBgColor, data = props.data;
21
21
  var messages = __assign(__assign({}, defaultMessages), localization);
22
22
  var renderRow = function (rowData, rowIndex) {
23
+ var _a, _b;
23
24
  var type = rowData.type, items = rowData.items, title = rowData.title, addButton = rowData.addButton;
24
25
  switch (type) {
25
26
  case Constants.DataRowType.Product: {
@@ -37,10 +38,10 @@ var AppHub = function (props) {
37
38
  // @ts-ignore
38
39
  , __assign({
39
40
  // @ts-ignore
40
- component: isPageLayout ? 'h2' : 'div' }, { children: title })), _jsxs(Grid, __assign({ container: true, spacing: { xs: 2, md: 3 } }, { children: [addButton && addButton.order === Constants.AddButtonOrder.Start && (_jsx(Grid, __assign({ xs: 6, sm: 4, md: 2 }, { children: _jsx(AppHubCustom, { isAddButton: true, customName: messages['add-custom-link'], customLinkBgColor: customLinkBgColor, url: addButton.url }) }))), items.map(function (_a, index) {
41
+ component: isPageLayout ? 'h2' : 'div' }, { children: title })), _jsxs(Grid, __assign({ container: true, spacing: { xs: 2, md: 3 } }, { children: [addButton && addButton.order === Constants.AddButtonOrder.Start && (_jsx(Grid, __assign({ xs: 6, sm: 4, md: 2 }, { children: _jsx(AppHubCustom, { isAddButton: true, customName: (_a = addButton.title) !== null && _a !== void 0 ? _a : messages['add-item'], customLinkBgColor: customLinkBgColor, url: addButton.url }) }))), items.map(function (_a, index) {
41
42
  var customName = _a.customName, url = _a.url, icon = _a.icon;
42
43
  return (_jsx(Grid, __assign({ xs: 6, sm: 4, md: 2 }, { children: url && (_jsx(AppHubCustom, { customName: customName, customLinkBgColor: customLinkBgColor, url: url, icon: icon })) }), "".concat(customName, "_").concat(rowIndex, "_").concat(index)));
43
- }), addButton && addButton.order === Constants.AddButtonOrder.End && (_jsx(Grid, __assign({ xs: 6, sm: 4, md: 2 }, { children: _jsx(AppHubCustom, { isAddButton: true, customName: messages['add-custom-link'], customLinkBgColor: customLinkBgColor, url: addButton.url }) })))] }))] }, "row_".concat(rowIndex)));
44
+ }), addButton && addButton.order === Constants.AddButtonOrder.End && (_jsx(Grid, __assign({ xs: 6, sm: 4, md: 2 }, { children: _jsx(AppHubCustom, { isAddButton: true, customName: (_b = addButton.title) !== null && _b !== void 0 ? _b : messages['add-item'], customLinkBgColor: customLinkBgColor, url: addButton.url }) })))] }))] }, "row_".concat(rowIndex)));
44
45
  }
45
46
  default: {
46
47
  console.log('no items');
@@ -21,7 +21,8 @@ export var LogoVariants = {
21
21
  };
22
22
  var AppHubCustom = function (props) {
23
23
  var shortName = props.shortName, customName = props.customName, url = props.url, isAddButton = props.isAddButton, customLinkBgColor = props.customLinkBgColor, icon = props.icon;
24
- return (_jsx(StyledPaper, __assign({ elevation: 0 }, { children: _jsx(StyledLink, __assign({ href: url, target: '_blank', underline: 'none' }, { children: _jsxs(StyledBoxWrap, { children: [!isAddButton && (_jsx(StyledAvatar, { children: icon !== null && icon !== void 0 ? icon : (customName ? handleAvatarInitials(customName) : null), customLinkBgColor: customLinkBgColor })), isAddButton && _jsx(StyledAddCircleOutlineIcon, {}), _jsx(StyledTypography
24
+ var addIcon = icon !== null && icon !== void 0 ? icon : _jsx(StyledAddCircleOutlineIcon, {});
25
+ return (_jsx(StyledPaper, __assign({ elevation: 0 }, { children: _jsx(StyledLink, __assign({ href: url, target: !isAddButton ? '_blank' : '_self', underline: 'none' }, { children: _jsxs(StyledBoxWrap, { children: [!isAddButton && (_jsx(StyledAvatar, { children: icon !== null && icon !== void 0 ? icon : (customName ? handleAvatarInitials(customName) : null), customLinkBgColor: customLinkBgColor })), isAddButton && addIcon, _jsx(StyledTypography
25
26
  // @ts-ignore
26
27
  , __assign({
27
28
  // @ts-ignore
package/lang/en-us.d.ts CHANGED
@@ -2,7 +2,7 @@ export const defaultMessages: {
2
2
  'app-switcher': string;
3
3
  'your-apps': string;
4
4
  'custom-apps': string;
5
- 'add-custom-link': string;
5
+ 'add-item': string;
6
6
  'lp-apps': string;
7
7
  questions: string;
8
8
  'back-to': string;
package/lang/en-us.js CHANGED
@@ -3,7 +3,7 @@ export var defaultMessages = {
3
3
  'app-switcher': 'App Switcher',
4
4
  'your-apps': 'Your Apps',
5
5
  'custom-apps': 'Explore Custom Apps',
6
- 'add-custom-link': 'Add Custom Link',
6
+ 'add-item': 'Add item',
7
7
  'lp-apps': 'Explore Learning Pool Apps',
8
8
  questions: 'Questions',
9
9
  'back-to': 'Back',
package/package.json CHANGED
@@ -9,7 +9,7 @@
9
9
  "components",
10
10
  "ui"
11
11
  ],
12
- "version": "1.7.3",
12
+ "version": "1.7.4",
13
13
  "private": false,
14
14
  "main": "index.js",
15
15
  "module": "index.js",
@@ -9,4 +9,5 @@ export interface IApplicationHubRowProps {
9
9
  title: string;
10
10
  type?: any;
11
11
  addButton?: any;
12
+ customName?: string;
12
13
  }