mirror of
https://akkoma.dev/AkkomaGang/akkoma-fe.git
synced 2024-11-09 10:13:42 +00:00
Add UserPanel.
This commit is contained in:
parent
7ba40ff7e2
commit
a7ea9c5195
2 changed files with 57 additions and 0 deletions
18
src/components/user_panel/user_panel.js
Normal file
18
src/components/user_panel/user_panel.js
Normal file
|
@ -0,0 +1,18 @@
|
|||
import LoginForm from '../login_form/login_form.vue'
|
||||
|
||||
const UserPanel = {
|
||||
computed: {
|
||||
user () { return this.$store.state.users.currentUser },
|
||||
style () {
|
||||
return {
|
||||
color: `#${this.user.profile_link_color}`,
|
||||
'background-image': `url(${this.user.cover_photo})`
|
||||
}
|
||||
}
|
||||
},
|
||||
components: {
|
||||
LoginForm
|
||||
}
|
||||
}
|
||||
|
||||
export default UserPanel
|
39
src/components/user_panel/user_panel.vue
Normal file
39
src/components/user_panel/user_panel.vue
Normal file
|
@ -0,0 +1,39 @@
|
|||
<template>
|
||||
<div class="user-panel">
|
||||
<div v-if='user' class="panel panel-default" v-bind:style="style">
|
||||
<!-- Default panel contents -->
|
||||
<div class="panel-heading text-center">
|
||||
<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">
|
||||
<post-status-form></post-status-form>
|
||||
</div>
|
||||
</div>
|
||||
<login-form v-if='!user'></login-form>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script src="./user_panel.js"></script>
|
Loading…
Reference in a new issue