paricafe/src/client/app/desktop/views/pages/user/user.vue

159 lines
3.6 KiB
Vue
Raw Normal View History

2018-02-14 09:32:13 -06:00
<template>
<mk-ui>
2018-06-20 11:46:35 -05:00
<div class="zwwan0di1v4356rmdbjmwnn32tptpdp2" v-if="!fetching" :data-darkmode="$store.state.device.darkmode">
2018-06-20 11:58:47 -05:00
<div class="is-suspended" v-if="user.isSuspended">%fa:exclamation-triangle% %i18n:@is-suspended%</div>
<div class="is-remote" v-if="user.host != null">%fa:exclamation-triangle% %i18n:@is-remote%<a :href="user.url || user.uri" target="_blank">%i18n:@view-remote%</a></div>
2018-06-20 11:46:35 -05:00
<main>
<div class="main">
<x-header :user="user"/>
<mk-note-detail v-if="user.pinnedNote" :note="user.pinnedNote" :compact="true"/>
<x-timeline class="timeline" ref="tl" :user="user"/>
</div>
<div class="side">
<x-profile :user="user"/>
2018-06-23 08:55:32 -05:00
<a-twitter :user="user" v-if="user.host === null && user.twitter"/>
2018-06-20 11:46:35 -05:00
<mk-calendar @chosen="warp" :start="new Date(user.createdAt)"/>
<mk-activity :user="user"/>
<x-photos :user="user"/>
<x-friends :user="user"/>
<x-followers-you-know v-if="$store.getters.isSignedIn && $store.state.i.id != user.id" :user="user"/>
<div class="nav"><mk-nav/></div>
<p v-if="user.host === null">%i18n:@last-used-at%: <b><mk-time :time="user.lastUsedAt"/></b></p>
</div>
</main>
2018-02-14 09:32:13 -06:00
</div>
</mk-ui>
</template>
<script lang="ts">
import Vue from 'vue';
2018-04-01 23:44:32 -05:00
import parseAcct from '../../../../../../acct/parse';
2018-04-05 11:36:34 -05:00
import getUserName from '../../../../../../renderers/get-user-name';
2018-02-18 23:29:42 -06:00
import Progress from '../../../../common/scripts/loading';
2018-02-20 10:39:51 -06:00
import XHeader from './user.header.vue';
2018-06-20 05:55:34 -05:00
import XTimeline from './user.timeline.vue';
import XProfile from './user.profile.vue';
import XPhotos from './user.photos.vue';
import XFollowersYouKnow from './user.followers-you-know.vue';
import XFriends from './user.friends.vue';
2018-06-23 08:55:32 -05:00
import XTwitter from './user.twitter.vue';
2018-02-14 09:32:13 -06:00
export default Vue.extend({
2018-02-18 23:29:42 -06:00
components: {
2018-02-20 10:39:51 -06:00
XHeader,
2018-06-20 05:55:34 -05:00
XTimeline,
XProfile,
XPhotos,
XFollowersYouKnow,
2018-06-23 08:55:32 -05:00
XFriends,
XTwitter
2018-02-14 09:32:13 -06:00
},
data() {
return {
fetching: true,
user: null
};
},
2018-02-20 07:53:34 -06:00
watch: {
$route: 'fetch'
},
2018-02-22 06:15:24 -06:00
created() {
this.fetch();
},
2018-02-20 07:53:34 -06:00
methods: {
fetch() {
this.fetching = true;
Progress.start();
2018-03-27 02:51:12 -05:00
(this as any).api('users/show', parseAcct(this.$route.params.user)).then(user => {
2018-02-20 07:53:34 -06:00
this.user = user;
this.fetching = false;
Progress.done();
2018-04-09 04:52:29 -05:00
document.title = getUserName(this.user) + ' | Misskey';
2018-02-20 07:53:34 -06:00
});
2018-06-20 05:55:34 -05:00
},
warp(date) {
(this.$refs.tl as any).warp(date);
2018-02-20 07:53:34 -06:00
}
2018-02-14 09:32:13 -06:00
}
});
</script>
2018-06-20 05:55:34 -05:00
<style lang="stylus" scoped>
2018-06-20 11:46:35 -05:00
root(isDark)
2018-06-20 05:55:34 -05:00
width 980px
padding 16px
margin 0 auto
2018-06-20 11:46:35 -05:00
> .is-suspended
> .is-remote
margin-bottom 16px
padding 14px 16px
font-size 14px
border-radius 6px
2018-06-20 05:55:34 -05:00
2018-06-20 11:46:35 -05:00
&.is-suspended
color isDark ? #ffb4b4 : #570808
background isDark ? #611d1d : #ffdbdb
border solid 1px isDark ? #d64a4a : #e09696
2018-06-20 05:55:34 -05:00
2018-06-20 11:46:35 -05:00
&.is-remote
color isDark ? #ffbd3e : #573c08
background isDark ? #42321c : #fff0db
border solid 1px isDark ? #90733c : #dcbb7b
2018-06-20 05:55:34 -05:00
2018-06-20 11:46:35 -05:00
> a
font-weight bold
2018-06-20 05:55:34 -05:00
2018-06-20 11:46:35 -05:00
> main
display flex
justify-content center
2018-06-20 05:55:34 -05:00
2018-06-20 11:46:35 -05:00
> .main
> .side
> *:not(:last-child)
margin-bottom 16px
2018-06-20 05:55:34 -05:00
2018-06-20 11:46:35 -05:00
> .main
flex 1
2018-06-22 04:47:23 -05:00
min-width 0 // SEE: http://kudakurage.hatenadiary.com/entry/2016/04/01/232722
2018-06-20 11:46:35 -05:00
margin-right 16px
2018-06-20 05:55:34 -05:00
2018-06-20 11:46:35 -05:00
> .timeline
border 1px solid rgba(#000, 0.075)
border-radius 6px
2018-06-20 05:55:34 -05:00
2018-06-20 11:46:35 -05:00
> .side
width 275px
2018-06-22 04:47:23 -05:00
flex-shrink 0
2018-06-20 11:46:35 -05:00
> p
display block
margin 0
padding 0 12px
text-align center
font-size 0.8em
color #aaa
> .nav
padding 16px
font-size 12px
color #aaa
background #fff
border solid 1px rgba(#000, 0.075)
border-radius 6px
a
color #999
i
color #ccc
.zwwan0di1v4356rmdbjmwnn32tptpdp2[data-darkmode]
root(true)
.zwwan0di1v4356rmdbjmwnn32tptpdp2:not([data-darkmode])
root(false)
2018-06-20 05:55:34 -05:00
</style>