DEV: add CSS class for composer action

This CSS class can be used to style specific composer actions
This commit is contained in:
Sam Saffron 2020-07-27 16:50:43 +10:00
parent 179335b5e3
commit de5ef5d895
No known key found for this signature in database
GPG Key ID: B9606168D2FFD9F5

View File

@ -33,6 +33,7 @@ export default Component.extend(KeyEnterEscape, {
"composer.creatingPrivateMessage:private-message", "composer.creatingPrivateMessage:private-message",
"composeState", "composeState",
"composer.loading", "composer.loading",
"prefixedComposerAction",
"composer.canEditTitle:edit-title", "composer.canEditTitle:edit-title",
"composer.createdPost:created-post", "composer.createdPost:created-post",
"composer.creatingTopic:topic", "composer.creatingTopic:topic",
@ -42,6 +43,11 @@ export default Component.extend(KeyEnterEscape, {
"currentUserPrimaryGroupClass" "currentUserPrimaryGroupClass"
], ],
@discourseComputed("composer.action")
prefixedComposerAction(action) {
return `composer-action-${action}`;
},
@discourseComputed("currentUser.primary_group_name") @discourseComputed("currentUser.primary_group_name")
currentUserPrimaryGroupClass(primaryGroupName) { currentUserPrimaryGroupClass(primaryGroupName) {
return primaryGroupName && `group-${primaryGroupName}`; return primaryGroupName && `group-${primaryGroupName}`;