@selfcommunity/react-ui 0.7.41 → 0.7.42-alpha.0
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/lib/cjs/components/Category/Category.js +1 -3
- package/lib/cjs/constants/Category.d.ts +1 -2
- package/lib/cjs/constants/Category.js +2 -3
- package/lib/esm/components/Category/Category.js +2 -4
- package/lib/esm/constants/Category.d.ts +1 -2
- package/lib/esm/constants/Category.js +1 -2
- package/lib/umd/react-ui.js +1 -1
- package/package.json +7 -7
|
@@ -77,9 +77,7 @@ function Category(inProps) {
|
|
|
77
77
|
}
|
|
78
78
|
// RENDER
|
|
79
79
|
if (!autoHide) {
|
|
80
|
-
return (react_1.default.createElement(Root, Object.assign({ elevation: elevation, className: (0, classnames_1.default)(classes.root, className), ButtonBaseProps: _ButtonBaseProps, image: react_1.default.createElement(material_1.Avatar, { alt: scCategory.name, src: scCategory.image_medium, variant: "square", className: classes.categoryImage }), primary: isMobile
|
|
81
|
-
? (0, string_1.formatCroppedName)(scCategory.name, Category_1.CATEGORY_NAME_MAX_LENGTH_MOBILE)
|
|
82
|
-
: (0, string_1.formatCroppedName)(scCategory.name, Category_1.CATEGORY_NAME_MAX_LENGTH_DESKTOP), secondary: showFollowers ? `${intl.formatMessage(messages.categoryFollowers, { total: scCategory.followers_counter })}` : scCategory.slogan, actions: react_1.default.createElement(CategoryFollowButton_1.default, Object.assign({ category: scCategory }, categoryFollowButtonProps)) }, rest)));
|
|
80
|
+
return (react_1.default.createElement(Root, Object.assign({ elevation: elevation, className: (0, classnames_1.default)(classes.root, className), ButtonBaseProps: _ButtonBaseProps, image: react_1.default.createElement(material_1.Avatar, { alt: scCategory.name, src: scCategory.image_medium, variant: "square", className: classes.categoryImage }), primary: isMobile ? scCategory.name : (0, string_1.formatCroppedName)(scCategory.name, Category_1.CATEGORY_NAME_MAX_LENGTH_DESKTOP), secondary: showFollowers ? `${intl.formatMessage(messages.categoryFollowers, { total: scCategory.followers_counter })}` : scCategory.slogan, actions: react_1.default.createElement(CategoryFollowButton_1.default, Object.assign({ category: scCategory }, categoryFollowButtonProps)) }, rest)));
|
|
83
81
|
}
|
|
84
82
|
return null;
|
|
85
83
|
}
|
|
@@ -1,2 +1 @@
|
|
|
1
|
-
export declare const
|
|
2
|
-
export declare const CATEGORY_NAME_MAX_LENGTH_DESKTOP = 20;
|
|
1
|
+
export declare const CATEGORY_NAME_MAX_LENGTH_DESKTOP = 30;
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.CATEGORY_NAME_MAX_LENGTH_DESKTOP =
|
|
4
|
-
exports.
|
|
5
|
-
exports.CATEGORY_NAME_MAX_LENGTH_DESKTOP = 20;
|
|
3
|
+
exports.CATEGORY_NAME_MAX_LENGTH_DESKTOP = void 0;
|
|
4
|
+
exports.CATEGORY_NAME_MAX_LENGTH_DESKTOP = 30;
|
|
@@ -11,7 +11,7 @@ import { useThemeProps } from '@mui/system';
|
|
|
11
11
|
import BaseItemButton from '../../shared/BaseItemButton';
|
|
12
12
|
import { PREFIX } from './constants';
|
|
13
13
|
import { formatCroppedName } from '../../utils/string';
|
|
14
|
-
import { CATEGORY_NAME_MAX_LENGTH_DESKTOP
|
|
14
|
+
import { CATEGORY_NAME_MAX_LENGTH_DESKTOP } from '../../constants/Category';
|
|
15
15
|
const messages = defineMessages({
|
|
16
16
|
categoryFollowers: {
|
|
17
17
|
id: 'ui.category.categoryFollowers',
|
|
@@ -75,9 +75,7 @@ export default function Category(inProps) {
|
|
|
75
75
|
}
|
|
76
76
|
// RENDER
|
|
77
77
|
if (!autoHide) {
|
|
78
|
-
return (React.createElement(Root, Object.assign({ elevation: elevation, className: classNames(classes.root, className), ButtonBaseProps: _ButtonBaseProps, image: React.createElement(Avatar, { alt: scCategory.name, src: scCategory.image_medium, variant: "square", className: classes.categoryImage }), primary: isMobile
|
|
79
|
-
? formatCroppedName(scCategory.name, CATEGORY_NAME_MAX_LENGTH_MOBILE)
|
|
80
|
-
: formatCroppedName(scCategory.name, CATEGORY_NAME_MAX_LENGTH_DESKTOP), secondary: showFollowers ? `${intl.formatMessage(messages.categoryFollowers, { total: scCategory.followers_counter })}` : scCategory.slogan, actions: React.createElement(CategoryFollowButton, Object.assign({ category: scCategory }, categoryFollowButtonProps)) }, rest)));
|
|
78
|
+
return (React.createElement(Root, Object.assign({ elevation: elevation, className: classNames(classes.root, className), ButtonBaseProps: _ButtonBaseProps, image: React.createElement(Avatar, { alt: scCategory.name, src: scCategory.image_medium, variant: "square", className: classes.categoryImage }), primary: isMobile ? scCategory.name : formatCroppedName(scCategory.name, CATEGORY_NAME_MAX_LENGTH_DESKTOP), secondary: showFollowers ? `${intl.formatMessage(messages.categoryFollowers, { total: scCategory.followers_counter })}` : scCategory.slogan, actions: React.createElement(CategoryFollowButton, Object.assign({ category: scCategory }, categoryFollowButtonProps)) }, rest)));
|
|
81
79
|
}
|
|
82
80
|
return null;
|
|
83
81
|
}
|
|
@@ -1,2 +1 @@
|
|
|
1
|
-
export declare const
|
|
2
|
-
export declare const CATEGORY_NAME_MAX_LENGTH_DESKTOP = 20;
|
|
1
|
+
export declare const CATEGORY_NAME_MAX_LENGTH_DESKTOP = 30;
|
|
@@ -1,2 +1 @@
|
|
|
1
|
-
export const
|
|
2
|
-
export const CATEGORY_NAME_MAX_LENGTH_DESKTOP = 20;
|
|
1
|
+
export const CATEGORY_NAME_MAX_LENGTH_DESKTOP = 30;
|