Sharkey/src/client/app/mobile/views/pages/user/home.vue

107 lines
2.3 KiB
Vue
Raw Normal View History

2018-02-15 01:33:34 -08:00
<template>
2018-02-22 00:32:58 -08:00
<div class="root home">
2018-09-17 14:29:47 -07:00
<mk-note-detail v-for="n in user.pinnedNotes" :key="n.id" :note="n" :compact="true"/>
2018-04-07 10:30:37 -07:00
<section class="recent-notes">
<h2><fa :icon="['far', 'comments']"/>{{ $t('recent-notes') }}</h2>
2018-02-15 01:33:34 -08:00
<div>
2018-04-07 10:30:37 -07:00
<x-notes :user="user"/>
2018-02-15 01:33:34 -08:00
</div>
</section>
<section class="images">
<h2><fa icon="image"/>{{ $t('images') }}</h2>
2018-02-15 01:33:34 -08:00
<div>
2018-02-22 00:32:58 -08:00
<x-photos :user="user"/>
2018-02-15 01:33:34 -08:00
</div>
</section>
<section class="activity">
<h2><fa icon="chart-bar"/>{{ $t('activity') }}</h2>
2018-02-15 01:33:34 -08:00
<div>
2018-11-13 06:06:31 -08:00
<x-activity :user="user"/>
2018-02-15 01:33:34 -08:00
</div>
</section>
<section class="frequently-replied-users">
<h2><fa icon="users"/>{{ $t('frequently-replied-users') }}</h2>
2018-02-15 01:33:34 -08:00
<div>
2018-02-22 00:32:58 -08:00
<x-friends :user="user"/>
2018-02-15 01:33:34 -08:00
</div>
</section>
2018-05-26 21:49:09 -07:00
<section class="followers-you-know" v-if="$store.getters.isSignedIn && $store.state.i.id !== user.id">
<h2><fa icon="users"/>{{ $t('followers-you-know') }}</h2>
2018-02-15 01:33:34 -08:00
<div>
2018-02-22 00:32:58 -08:00
<x-followers-you-know :user="user"/>
2018-02-15 01:33:34 -08:00
</div>
</section>
<p v-if="user.host === null">{{ $t('last-used-at') }}: <b><mk-time :time="user.lastUsedAt"/></b></p>
2018-02-15 01:33:34 -08:00
</div>
</template>
<script lang="ts">
import Vue from 'vue';
import i18n from '../../../../i18n';
2018-04-07 10:30:37 -07:00
import XNotes from './home.notes.vue';
2018-02-22 00:32:58 -08:00
import XPhotos from './home.photos.vue';
import XFriends from './home.friends.vue';
import XFollowersYouKnow from './home.followers-you-know.vue';
2018-02-15 01:33:34 -08:00
export default Vue.extend({
i18n: i18n('mobile/views/pages/user/home.vue'),
2018-02-22 00:32:58 -08:00
components: {
2018-04-07 10:30:37 -07:00
XNotes,
2018-02-22 00:32:58 -08:00
XPhotos,
XFriends,
2018-11-13 06:06:31 -08:00
XFollowersYouKnow,
XActivity: () => import('../../components/activity.vue').then(m => m.default)
2018-02-22 00:32:58 -08:00
},
2018-02-15 01:33:34 -08:00
props: ['user']
});
</script>
<style lang="stylus" scoped>
2018-09-27 19:43:15 -07:00
.root.home
2018-02-15 01:33:34 -08:00
max-width 600px
margin 0 auto
2018-04-07 10:30:37 -07:00
> .mk-note-detail
2018-02-15 01:33:34 -08:00
margin 0 0 8px 0
@media (min-width 500px)
margin 0 0 16px 0
2018-02-15 01:33:34 -08:00
> section
2018-09-27 19:43:15 -07:00
background var(--face)
2018-02-15 01:33:34 -08:00
border-radius 8px
2018-04-27 05:33:18 -07:00
box-shadow 0 4px 16px rgba(#000, 0.1)
2018-02-15 01:33:34 -08:00
&:not(:last-child)
margin-bottom 8px
2018-04-27 05:33:18 -07:00
@media (min-width 500px)
margin-bottom 16px
2018-02-15 01:33:34 -08:00
> h2
margin 0
padding 8px 10px
font-size 15px
font-weight normal
2018-09-27 19:43:15 -07:00
color var(--text)
background var(--faceHeader)
2018-02-15 01:33:34 -08:00
border-radius 8px 8px 0 0
2018-04-27 18:59:37 -07:00
@media (min-width 500px)
padding 10px 16px
2018-02-15 01:33:34 -08:00
> i
margin-right 6px
> .activity
> div
padding 8px
> p
display block
margin 16px
text-align center
2018-09-27 19:43:15 -07:00
color var(--text)
2018-02-15 01:33:34 -08:00
</style>