From a6fb9d6cf35ac8bf4edd3d4577ce2b3ba56b520a Mon Sep 17 00:00:00 2001 From: Kevin Peters Date: Sun, 19 May 2019 15:43:32 +0200 Subject: [PATCH] Uninline the elements #113 (#117) --- src/components/ArticleActions.vue | 49 ++++++++++++++++++------------- 1 file changed, 29 insertions(+), 20 deletions(-) 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() {