aboutsummaryrefslogtreecommitdiff
path: root/src/components/follow_button
diff options
context:
space:
mode:
authorMaksim Pechnikov <parallel588@gmail.com>2019-10-08 10:21:40 +0300
committerMaksim Pechnikov <parallel588@gmail.com>2019-10-08 10:21:40 +0300
commit9c305c5f93b2ffee0a98ff8cc6770df052d4b71e (patch)
treea99d9ed2ab174eea4533146b8f97c6bde9170eae /src/components/follow_button
parent188b6f56ed2f983d8f0fba4dc8f7327ebbee321d (diff)
Revert "added acccount_actions component"
This reverts commit 188b6f56ed2f983d8f0fba4dc8f7327ebbee321d.
Diffstat (limited to 'src/components/follow_button')
-rw-r--r--src/components/follow_button/follow_button.js58
-rw-r--r--src/components/follow_button/follow_button.vue13
2 files changed, 0 insertions, 71 deletions
diff --git a/src/components/follow_button/follow_button.js b/src/components/follow_button/follow_button.js
deleted file mode 100644
index 9d2834ab..00000000
--- a/src/components/follow_button/follow_button.js
+++ /dev/null
@@ -1,58 +0,0 @@
-import { requestFollow, requestUnfollow } from '../../services/follow_manipulate/follow_manipulate'
-export default {
- props: ['user'],
- data () {
- return {
- inProgress: false
- }
- },
- computed: {
- isPressed () {
- return this.inProgress || this.user.following
- },
- title () {
- if (this.inProgress || this.user.following) {
- return 'user_card.follow_unfollow'
- } else if (this.user.requested) {
- return 'user_card.follow_again'
- } else {
- return ''
- }
- },
- label () {
- if (this.inProgress) {
- return 'user_card.follow_progress'
- } else if (this.user.following) {
- return 'user_card.following'
- } else if (this.user.requested) {
- return 'user_card.follow_sent'
- } else {
- return 'user_card.follow'
- }
- }
- },
- methods: {
- doClick () {
- if (this.user.following) {
- this.unfollowUser()
- } else {
- this.followUser()
- }
- },
- followUser () {
- const store = this.$store
- this.inProgress = true
- requestFollow(this.user, store).then(() => {
- this.inProgress = false
- })
- },
- unfollowUser () {
- const store = this.$store
- this.inProgress = true
- requestUnfollow(this.user, store).then(() => {
- this.inProgress = false
- store.commit('removeStatus', { timeline: 'friends', userId: this.user.id })
- })
- }
- }
-}
diff --git a/src/components/follow_button/follow_button.vue b/src/components/follow_button/follow_button.vue
deleted file mode 100644
index 61aa75a0..00000000
--- a/src/components/follow_button/follow_button.vue
+++ /dev/null
@@ -1,13 +0,0 @@
-<template>
- <button
- class="btn btn-default btn-block follow-button"
- :class="{ pressed: isPressed }"
- :disabled="inProgress"
- :title="$t(title)"
- @click="doClick"
- >
- {{ $t(label) }}
- </button>
-</template>
-
-<script src="./follow_button.js"></script>