1
1
mirror of https://github.com/kokonect-link/cherrypick synced 2024-11-01 23:55:58 +09:00

Improve following/followers view

Closes #2235
This commit is contained in:
syuilo 2018-09-13 02:08:17 +09:00
parent b4a30e2a25
commit 8a8c079b2f
No known key found for this signature in database
GPG Key ID: BDC4C49D06AB9D69
2 changed files with 74 additions and 80 deletions

View File

@ -1,17 +1,16 @@
<template> <template>
<div class="root item"> <div class="zvdbznxvfixtmujpsigoccczftvpiwqh">
<mk-avatar class="avatar" :user="user"/> <div class="banner" :style="bannerStyle"></div>
<div class="main"> <mk-avatar class="avatar" :user="user" :disable-preview="true"/>
<header> <div class="body">
<router-link class="name" :to="user | userPage" v-user-preview="user.id">{{ user | userName }}</router-link> <router-link :to="user | userPage" class="name">{{ user | userName }}</router-link>
<span class="username">@{{ user | acct }}</span> <span class="username">@{{ user | acct }}</span>
</header> <div class="description">
<div class="body"> <misskey-flavored-markdown v-if="user.description" :text="user.description" :i="$store.state.i"/>
<p class="followed" v-if="user.isFollowed">%i18n:@followed%</p>
<div class="description">{{ user.description }}</div>
</div> </div>
<p class="followed" v-if="user.isFollowed">%i18n:@followed%</p>
<mk-follow-button :user="user" :size="'big'"/>
</div> </div>
<mk-follow-button :user="user"/>
</div> </div>
</template> </template>
@ -19,76 +18,69 @@
import Vue from 'vue'; import Vue from 'vue';
export default Vue.extend({ export default Vue.extend({
props: ['user'] props: ['user'],
computed: {
bannerStyle(): any {
if (this.user.bannerUrl == null) return {};
return {
backgroundColor: this.user.bannerColor && this.user.bannerColor.length == 3 ? `rgb(${ this.user.bannerColor.join(',') })` : null,
backgroundImage: `url(${ this.user.bannerUrl })`
};
}
},
}); });
</script> </script>
<style lang="stylus" scoped> <style lang="stylus" scoped>
.root.item .zvdbznxvfixtmujpsigoccczftvpiwqh
padding 16px $bg = #fff
font-size 16px
&:after margin 16px auto
content "" max-width calc(100% - 32px)
display block font-size 16px
clear both text-align center
background $bg
box-shadow 0 2px 4px rgba(0, 0, 0, 0.1)
> .banner
height 100px
background-color #f9f4f4
background-position center
background-size cover
> .avatar > .avatar
display block display block
float left margin -40px auto 0 auto
margin 0 16px 0 0 width 80px
width 58px height 80px
height 58px border-radius 100%
border-radius 8px border solid 4px $bg
> .main > .body
float left padding 4px 32px 32px 32px
width calc(100% - 74px)
> header @media (max-width 400px)
margin-bottom 2px padding 4px 16px 16px 16px
> .name > .name
display inline font-size 20px
margin 0 font-weight bold
padding 0
color #777
font-size 1em
font-weight 700
text-align left
text-decoration none
&:hover > .username
text-decoration underline display block
opacity 0.7
> .username > .description
text-align left margin 16px 0
margin 0 0 0 8px
color #ccc
> .body > .followed
> .followed margin 0 0 16px 0
display inline-block padding 0
margin 0 0 4px 0 line-height 24px
padding 2px 8px font-size 0.8em
vertical-align top color #71afc7
font-size 10px background #eefaff
color #71afc7 border-radius 4px
background #eefaff
border-radius 4px
> .description
cursor default
display block
margin 0
padding 0
overflow-wrap break-word
font-size 1.1em
color #717171
> .mk-follow-button
position absolute
top 16px
right 16px
</style> </style>

View File

@ -33,7 +33,7 @@ export default Vue.extend({
props: ['fetch', 'count', 'youKnowCount'], props: ['fetch', 'count', 'youKnowCount'],
data() { data() {
return { return {
limit: 30, limit: 20,
mode: 'all', mode: 'all',
fetching: true, fetching: true,
moreFetching: false, moreFetching: false,
@ -73,10 +73,14 @@ export default Vue.extend({
.mk-users-list .mk-users-list
height 100% height 100%
background #fff overflow auto
background #eee
> nav > nav
z-index 1 z-index 10
position sticky
top 0
background #fff
box-shadow 0 1px 0 rgba(#000, 0.1) box-shadow 0 1px 0 rgba(#000, 0.1)
> div > div
@ -114,16 +118,14 @@ export default Vue.extend({
background #eee background #eee
border-radius 20px border-radius 20px
> .users > button
height calc(100% - 54px) display block
overflow auto width calc(100% - 32px)
margin 16px
padding 16px
> * &:hover
border-bottom solid 1px rgba(#000, 0.05) background rgba(#000, 0.1)
> *
max-width 600px
margin 0 auto
> .no > .no
margin 0 margin 0