forked from AkkomaGang/akkoma-fe
Extract user card from user content.
This commit is contained in:
parent
dcb9a5fa17
commit
83a376a254
3 changed files with 49 additions and 34 deletions
43
src/components/user_card_content/user_card_content.vue
Normal file
43
src/components/user_card_content/user_card_content.vue
Normal file
|
@ -0,0 +1,43 @@
|
||||||
|
<template>
|
||||||
|
<div>
|
||||||
|
<div class="panel-heading text-center" v-bind:style="style">
|
||||||
|
<div class='user-info'>
|
||||||
|
<img :src="user.profile_image_url">
|
||||||
|
<span class="glyphicon glyphicon-user"></span>
|
||||||
|
<div class='user-name'>{{user.name}}</div>
|
||||||
|
<div class='user-screen-name'>@{{user.screen_name}}</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="panel-body">
|
||||||
|
<div class="user-counts">
|
||||||
|
<div class="user-count">
|
||||||
|
<h5>Statuses</h5>
|
||||||
|
<span>{{user.statuses_count}}</span>
|
||||||
|
</div>
|
||||||
|
<div class="user-count">
|
||||||
|
<h5>Following</h5>
|
||||||
|
<span>{{user.friends_count}}</span>
|
||||||
|
</div>
|
||||||
|
<div class="user-count">
|
||||||
|
<h5>Followers</h5>
|
||||||
|
<span>{{user.followers_count}}</span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<p>{{user.description}}</p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
export default {
|
||||||
|
props: [ 'user' ],
|
||||||
|
computed: {
|
||||||
|
style () {
|
||||||
|
return {
|
||||||
|
color: `#${this.user.profile_link_color}`,
|
||||||
|
'background-image': `url(${this.user.cover_photo})`
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
|
@ -1,19 +1,15 @@
|
||||||
import LoginForm from '../login_form/login_form.vue'
|
import LoginForm from '../login_form/login_form.vue'
|
||||||
import PostStatusForm from '../post_status_form/post_status_form.vue'
|
import PostStatusForm from '../post_status_form/post_status_form.vue'
|
||||||
|
import UserCardContent from '../user_card_content/user_card_content.vue'
|
||||||
|
|
||||||
const UserPanel = {
|
const UserPanel = {
|
||||||
computed: {
|
computed: {
|
||||||
user () { return this.$store.state.users.currentUser },
|
user () { return this.$store.state.users.currentUser }
|
||||||
style () {
|
|
||||||
return {
|
|
||||||
color: `#${this.user.profile_link_color}`,
|
|
||||||
'background-image': `url(${this.user.cover_photo})`
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
components: {
|
components: {
|
||||||
LoginForm,
|
LoginForm,
|
||||||
PostStatusForm
|
PostStatusForm,
|
||||||
|
UserCardContent
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,32 +1,8 @@
|
||||||
<template>
|
<template>
|
||||||
<div class="user-panel">
|
<div class="user-panel">
|
||||||
<div v-if='user' class="panel panel-default">
|
<div v-if='user' class="panel panel-default">
|
||||||
<!-- Default panel contents -->
|
|
||||||
<div class="panel-heading text-center" v-bind:style="style">
|
<user-card-content :user="user"></user-card-content>
|
||||||
<div class='user-info'>
|
|
||||||
<img :src="user.profile_image_url">
|
|
||||||
<span class="glyphicon glyphicon-user"></span>
|
|
||||||
<div class='user-name'>{{user.name}}</div>
|
|
||||||
<div class='user-screen-name'>@{{user.screen_name}}</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div class="panel-body">
|
|
||||||
<div class="user-counts">
|
|
||||||
<div class="user-count">
|
|
||||||
<h5>Statuses</h5>
|
|
||||||
<span>{{user.statuses_count}}</span>
|
|
||||||
</div>
|
|
||||||
<div class="user-count">
|
|
||||||
<h5>Following</h5>
|
|
||||||
<span>{{user.friends_count}}</span>
|
|
||||||
</div>
|
|
||||||
<div class="user-count">
|
|
||||||
<h5>Followers</h5>
|
|
||||||
<span>{{user.followers_count}}</span>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<p>{{user.description}}</p>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="panel-footer">
|
<div class="panel-footer">
|
||||||
<post-status-form v-if='user'></post-status-form>
|
<post-status-form v-if='user'></post-status-form>
|
||||||
|
|
Loading…
Reference in a new issue