-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
DEV: Added compatibility with the Glimmer Post Menu (#219)
- Loading branch information
Showing
4 changed files
with
1,094 additions
and
59 deletions.
There are no files selected for viewing
31 changes: 31 additions & 0 deletions
31
assets/javascripts/discourse/components/post-voting-answer-button.gjs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
import Component from "@glimmer/component"; | ||
import { inject as service } from "@ember/service"; | ||
import DButton from "discourse/components/d-button"; | ||
import concatClass from "discourse/helpers/concat-class"; | ||
|
||
export default class PostVotingAnswerButton extends Component { | ||
static shouldRender(args) { | ||
return args.state.canCreatePost && args.post.post_number === 1; | ||
} | ||
|
||
@service site; | ||
|
||
get showLabel() { | ||
return this.site.desktopView; | ||
} | ||
|
||
<template> | ||
<DButton | ||
class={{concatClass | ||
"post-action-menu__post-voting-answer" | ||
"reply" | ||
(if this.showLabel "create fade-out") | ||
}} | ||
...attributes | ||
@action={{@buttonActions.replyToPost}} | ||
@icon="reply" | ||
@label={{if this.showLabel "post_voting.topic.answer.label"}} | ||
@title="post_voting.topic.answer.help" | ||
/> | ||
</template> | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.