Very basic user following.
This commit is contained in:
parent
f18f87747f
commit
fc268c48bc
4 changed files with 58 additions and 0 deletions
|
@ -6,6 +6,21 @@
|
|||
<span class="glyphicon glyphicon-user"></span>
|
||||
<div class='user-name'>{{user.name}}</div>
|
||||
<div class='user-screen-name'>@{{user.screen_name}}</div>
|
||||
<div v-if="isOtherUser" class="following-info">
|
||||
<div v-if="user.follows_you" class="following">
|
||||
Follows you!
|
||||
</div>
|
||||
<div class="followed">
|
||||
<span v-if="user.following">
|
||||
Following them!
|
||||
</span>
|
||||
<span v-if="!user.following" >
|
||||
<button @click="followUser">
|
||||
Follow!
|
||||
</button>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="panel-body">
|
||||
|
@ -37,6 +52,15 @@
|
|||
color: `#${this.user.profile_link_color}`,
|
||||
'background-image': `url(${this.user.cover_photo})`
|
||||
}
|
||||
},
|
||||
isOtherUser () {
|
||||
return this.user !== this.$store.state.users.currentUser
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
followUser () {
|
||||
this.$store.state.api.backendInteractor.followUser(this.user.id)
|
||||
.then((x) => console.log)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue