FEATURE: Add contentCSSClass for sidebar section-link (#18555)

In some cases, like in the chat plugin for muted channels,
we want to change the style of the sidebar content text.
This adds a new contentCSSClass function to the
BaseCustomSidebarSectionLink class and uses it in both
sections and section-link to add the CSS class if it is
provided.
This commit is contained in:
Martin Brennan 2022-10-12 12:42:15 +10:00 committed by GitHub
parent e5b306b13e
commit 84f2529138
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 11 additions and 5 deletions

View File

@ -33,7 +33,7 @@
@prefixBadge={{@prefixBadge}}
/>
<span class="sidebar-section-link-content-text">
<span class={{concat-class "sidebar-section-link-content-text" @contentCSSClass}}>
{{@content}}
</span>

View File

@ -28,6 +28,7 @@
@model={{link.model}}
@models={{link.models}}
@title={{link.title}}
@contentCSSClass={{link.contentCSSClass}}
@prefixColor={{link.prefixColor}}
@prefixBadge={{link.prefixBadge}}
@prefixType={{link.prefixType}}

View File

@ -45,6 +45,11 @@ export default class BaseCustomSidebarSectionLink {
this._notImplemented();
}
/**
* @returns {string} CSS class for the content text
*/
get contentCSSClass() {}
/**
* @returns {string} Prefix type for the link. Accepted value: icon, image, text
*/
@ -68,22 +73,22 @@ export default class BaseCustomSidebarSectionLink {
/**
* @returns {string} CSS class for prefix
*/
get PrefixCSSClass() {}
get prefixCSSClass() {}
/**
* @returns {string} Suffix type for the link. Accepted value: icon
*/
get SuffixType() {}
get suffixType() {}
/**
* @returns {string} Suffix value for the link. Accepted value: icon name
*/
get SuffixValue() {}
get suffixValue() {}
/**
* @returns {string} CSS class for suffix
*/
get SuffixCSSClass() {}
get suffixCSSClass() {}
/**
* @returns {string} Type of the hover button. Accepted value: icon