UX: Composer actions menu header should display the icon of selected action (#12449)

See a video of the change in the PR: https://github.com/discourse/discourse/pull/12449.
This commit is contained in:
Osama Sayegh
2021-03-19 17:48:43 +03:00
committed by GitHub
parent 5b02aad9c1
commit c9923a3e3e
6 changed files with 120 additions and 18 deletions

View File

@@ -37,11 +37,19 @@ export default DropdownSelectBoxComponent.extend({
showFullTitle: false,
},
iconForComposerAction: computed("action", function () {
iconForComposerAction: computed("action", "whisper", "noBump", function () {
if (this.isEditing) {
return "pencil-alt";
} else if (this.action === CREATE_TOPIC) {
return "plus";
} else if (this.action === PRIVATE_MESSAGE) {
return "envelope";
} else if (this.action === CREATE_SHARED_DRAFT) {
return "far-clipboard";
} else if (this.whisper) {
return "far-eye-slash";
} else if (this.noBump) {
return "anchor";
} else {
return "share";
}