diff --git a/src/components/ArticleActions.vue b/src/components/ArticleActions.vue index ed5b00da..eea3b7c2 100644 --- a/src/components/ArticleActions.vue +++ b/src/components/ArticleActions.vue @@ -1,40 +1,29 @@ @@ -56,7 +45,27 @@ export default { canModify: { type: Boolean, required: true } }, computed: { - ...mapGetters(["profile", "isAuthenticated"]) + ...mapGetters(["profile", "isAuthenticated"]), + editArticleLink() { + return { name: "article-edit", params: { slug: this.article.slug } }; + }, + toggleFavoriteButtonClasses() { + return { + "btn-primary": this.article.favorited, + "btn-outline-primary": !this.article.favorited + }; + }, + followUserLabel() { + return `${this.profile.following ? "Unfollow" : "Follow"} ${ + this.article.author.username + }`; + }, + favoriteArticleLabel() { + return this.article.favorited ? "Unfavorite Article" : "Favorite Article"; + }, + favoriteCounter() { + return `(${this.article.favoritesCount})`; + } }, methods: { toggleFavorite() {