summaryrefslogtreecommitdiff
path: root/src/client
diff options
context:
space:
mode:
authorsyuilo <syuilotan@yahoo.co.jp>2019-02-18 04:45:16 +0900
committersyuilo <syuilotan@yahoo.co.jp>2019-02-18 04:45:16 +0900
commita766a57af9a707ef22892058b3e5e0d07f19951f (patch)
treea1583d71bb822df50e90c3eefff5e104fa52ee61 /src/client
parentUpdate CircleCI configuration (#4297) (diff)
downloadmisskey-a766a57af9a707ef22892058b3e5e0d07f19951f.tar.gz
misskey-a766a57af9a707ef22892058b3e5e0d07f19951f.tar.bz2
misskey-a766a57af9a707ef22892058b3e5e0d07f19951f.zip
誰もフォローしていない状態でホームTLを表示したときにexploreページへ誘導するように
Diffstat (limited to 'src/client')
-rw-r--r--src/client/app/desktop/views/components/friends-maker.vue166
-rw-r--r--src/client/app/desktop/views/components/index.ts2
-rw-r--r--src/client/app/desktop/views/home/timeline.core.vue20
-rw-r--r--src/client/app/mobile/views/components/friends-maker.vue130
-rw-r--r--src/client/app/mobile/views/components/index.ts2
-rw-r--r--src/client/app/mobile/views/components/ui-container.vue3
-rw-r--r--src/client/app/mobile/views/pages/home.timeline.vue20
7 files changed, 36 insertions, 307 deletions
diff --git a/src/client/app/desktop/views/components/friends-maker.vue b/src/client/app/desktop/views/components/friends-maker.vue
deleted file mode 100644
index db29fe2fb7..0000000000
--- a/src/client/app/desktop/views/components/friends-maker.vue
+++ /dev/null
@@ -1,166 +0,0 @@
-<template>
-<div class="mk-friends-maker">
- <p class="title">{{ $t('title') }}</p>
- <div class="users" v-if="!fetching && users.length > 0">
- <div class="user" v-for="user in users" :key="user.id">
- <mk-avatar class="avatar" :user="user" target="_blank"/>
- <div class="body">
- <router-link class="name" :to="user | userPage" v-user-preview="user.id">
- <mk-user-name :user="user"/>
- </router-link>
- <p class="username">@{{ user | acct }}</p>
- </div>
- </div>
- </div>
- <p class="empty" v-if="!fetching && users.length == 0">{{ $t('empty') }}</p>
- <p class="fetching" v-if="fetching"><fa icon="spinner" pulse fixed-width/>{{ $t('fetching') }}<mk-ellipsis/></p>
- <a class="refresh" @click="refresh">{{ $t('refresh') }}</a>
- <button class="close" @click="destroyDom()" :title="$t('title')"><fa icon="times"/></button>
-</div>
-</template>
-
-<script lang="ts">
-import Vue from 'vue';
-import i18n from '../../../i18n';
-
-export default Vue.extend({
- i18n: i18n('desktop/views/components/friends-maker.vue'),
- data() {
- return {
- users: [],
- fetching: true,
- limit: 6,
- page: 0
- };
- },
- mounted() {
- this.fetch();
- },
- methods: {
- fetch() {
- this.fetching = true;
- this.users = [];
-
- this.$root.api('users/recommendation', {
- limit: this.limit,
- offset: this.limit * this.page
- }).then(users => {
- this.users = users;
- this.fetching = false;
- });
- },
- refresh() {
- if (this.users.length < this.limit) {
- this.page = 0;
- } else {
- this.page++;
- }
- this.fetch();
- }
- }
-});
-</script>
-
-<style lang="stylus" scoped>
-.mk-friends-maker
- padding 24px
-
- > .title
- margin 0 0 12px 0
- font-size 1em
- font-weight bold
- color #888
-
- > .users
- &:after
- content ""
- display block
- clear both
-
- > .user
- padding 16px
- width 238px
- float left
-
- &:after
- content ""
- display block
- clear both
-
- > .avatar
- display block
- float left
- margin 0 12px 0 0
- width 42px
- height 42px
- border-radius 8px
-
- > .body
- float left
- width calc(100% - 54px)
-
- > .name
- margin 0
- font-size 16px
- line-height 24px
- color #555
-
- > .username
- margin 0
- font-size 15px
- line-height 16px
- color #ccc
-
- > .mk-follow-button
- position absolute
- top 16px
- right 16px
-
- > .empty
- margin 0
- padding 16px
- text-align center
- color var(--text)
-
- > .fetching
- margin 0
- padding 16px
- text-align center
- color var(--text)
-
- > [data-icon]
- margin-right 4px
-
- > .refresh
- display block
- margin 0 8px 0 0
- text-align right
- font-size 0.9em
- color #999
-
- > .close
- cursor pointer
- display block
- position absolute
- top 6px
- right 6px
- z-index 1
- margin 0
- padding 0
- font-size 1.2em
- color #999
- border none
- outline none
- background transparent
-
- &:hover
- color #555
-
- &:active
- color #222
-
- > [data-icon]
- box-sizing initial
- padding 14px
-
-</style>
diff --git a/src/client/app/desktop/views/components/index.ts b/src/client/app/desktop/views/components/index.ts
index c31690028e..3840328ec4 100644
--- a/src/client/app/desktop/views/components/index.ts
+++ b/src/client/app/desktop/views/components/index.ts
@@ -15,7 +15,6 @@ import notePreview from './note-preview.vue';
import noteDetail from './note-detail.vue';
import calendar from './calendar.vue';
import activity from './activity.vue';
-import friendsMaker from './friends-maker.vue';
import userCard from './user-card.vue';
import userListTimeline from './user-list-timeline.vue';
import uiContainer from './ui-container.vue';
@@ -35,7 +34,6 @@ Vue.component('mk-note-preview', notePreview);
Vue.component('mk-note-detail', noteDetail);
Vue.component('mk-calendar', calendar);
Vue.component('mk-activity', activity);
-Vue.component('mk-friends-maker', friendsMaker);
Vue.component('mk-user-card', userCard);
Vue.component('mk-user-list-timeline', userListTimeline);
Vue.component('ui-container', uiContainer);
diff --git a/src/client/app/desktop/views/home/timeline.core.vue b/src/client/app/desktop/views/home/timeline.core.vue
index 63bc20dc28..704ca48ae4 100644
--- a/src/client/app/desktop/views/home/timeline.core.vue
+++ b/src/client/app/desktop/views/home/timeline.core.vue
@@ -1,6 +1,9 @@
<template>
-<div class="mk-timeline-core">
- <mk-friends-maker v-if="src == 'home' && alone"/>
+<div class="ibpylqas">
+ <div v-if="src == 'home' && alone" class="explore">
+ <p>{{ $t('@.empty-timeline-info.follow-users-to-make-your-timeline') }}</p>
+ <router-link to="/explore">{{ $t('@.empty-timeline-info.explore') }}</router-link>
+ </div>
<mk-notes ref="timeline" :more="existMore ? more : null">
<p :class="$style.empty" slot="empty">
@@ -171,9 +174,16 @@ export default Vue.extend({
</script>
<style lang="stylus" scoped>
-.mk-timeline-core
- > .mk-friends-maker
- border-bottom solid var(--lineWidth) #eee
+.ibpylqas
+ > .explore
+ padding 16px
+ text-align center
+ color var(--text)
+ border-bottom solid var(--lineWidth) var(--faceDivider)
+ font-size 14px
+
+ > p
+ margin 0 0 8px 0
</style>
diff --git a/src/client/app/mobile/views/components/friends-maker.vue b/src/client/app/mobile/views/components/friends-maker.vue
deleted file mode 100644
index 21bb8dec10..0000000000
--- a/src/client/app/mobile/views/components/friends-maker.vue
+++ /dev/null
@@ -1,130 +0,0 @@
-<template>
-<div class="mk-friends-maker">
- <p class="title">{{ $t('title') }}:</p>
- <div class="users" v-if="!fetching && users.length > 0">
- <mk-user-card v-for="user in users" :key="user.id" :user="user"/>
- </div>
- <p class="empty" v-if="!fetching && users.length == 0">{{ $t('empty') }}</p>
- <p class="fetching" v-if="fetching"><fa icon="spinner" pulse fixed-width/>{{ $t('fetching') }}<mk-ellipsis/></p>
- <a class="refresh" @click="refresh">{{ $t('refresh') }}</a>
- <button class="close" @click="close" :title="$t('title')"><fa icon="times"/></button>
-</div>
-</template>
-
-<script lang="ts">
-import Vue from 'vue';
-import i18n from '../../../i18n';
-export default Vue.extend({
- i18n: i18n('mobile/views/components/friends-maker.vue'),
- data() {
- return {
- users: [],
- fetching: true,
- limit: 6,
- page: 0
- };
- },
- mounted() {
- this.fetch();
- },
- methods: {
- fetch() {
- this.fetching = true;
- this.users = [];
-
- this.$root.api('users/recommendation', {
- limit: this.limit,
- offset: this.limit * this.page
- }).then(users => {
- this.users = users;
- this.fetching = false;
- });
- },
- refresh() {
- if (this.users.length < this.limit) {
- this.page = 0;
- } else {
- this.page++;
- }
- this.fetch();
- },
- close() {
- this.destroyDom();
- }
- }
-});
-</script>
-
-<style lang="stylus" scoped>
-.mk-friends-maker
- background #fff
- border-radius 8px
- box-shadow 0 0 0 1px rgba(#000, 0.2)
-
- > .title
- margin 0
- padding 8px 16px
- font-size 1em
- font-weight bold
- color #888
-
- > .users
- overflow-x scroll
- -webkit-overflow-scrolling touch
- white-space nowrap
- padding 16px
- background #eee
-
- > .mk-user-card
- &:not(:last-child)
- margin-right 16px
-
- > .empty
- margin 0
- padding 16px
- text-align center
- color var(--text)
-
- > .fetching
- margin 0
- padding 16px
- text-align center
- color var(--text)
-
- > [data-icon]
- margin-right 4px
-
- > .refresh
- display block
- margin 0
- padding 8px 16px
- text-align right
- font-size 0.9em
- color #999
-
- > .close
- cursor pointer
- display block
- position absolute
- top 0
- right 0
- z-index 1
- margin 0
- padding 0
- font-size 1.2em
- color #999
- border none
- outline none
- background transparent
-
- &:hover
- color #555
-
- &:active
- color #222
-
- > [data-icon]
- box-sizing initial
- padding 10px
-
-</style>
diff --git a/src/client/app/mobile/views/components/index.ts b/src/client/app/mobile/views/components/index.ts
index 864098640b..6f2640373e 100644
--- a/src/client/app/mobile/views/components/index.ts
+++ b/src/client/app/mobile/views/components/index.ts
@@ -9,7 +9,6 @@ import subNoteContent from './sub-note-content.vue';
import noteCard from './note-card.vue';
import userCard from './user-card.vue';
import noteDetail from './note-detail.vue';
-import friendsMaker from './friends-maker.vue';
import notification from './notification.vue';
import notifications from './notifications.vue';
import notificationPreview from './notification-preview.vue';
@@ -28,7 +27,6 @@ Vue.component('mk-sub-note-content', subNoteContent);
Vue.component('mk-note-card', noteCard);
Vue.component('mk-user-card', userCard);
Vue.component('mk-note-detail', noteDetail);
-Vue.component('mk-friends-maker', friendsMaker);
Vue.component('mk-notification', notification);
Vue.component('mk-notifications', notifications);
Vue.component('mk-notification-preview', notificationPreview);
diff --git a/src/client/app/mobile/views/components/ui-container.vue b/src/client/app/mobile/views/components/ui-container.vue
index b06cc7636a..2f677fa8f4 100644
--- a/src/client/app/mobile/views/components/ui-container.vue
+++ b/src/client/app/mobile/views/components/ui-container.vue
@@ -83,4 +83,7 @@ export default Vue.extend({
font-size 15px
color var(--faceTextButton)
+ > div
+ color var(--text)
+
</style>
diff --git a/src/client/app/mobile/views/pages/home.timeline.vue b/src/client/app/mobile/views/pages/home.timeline.vue
index 50c0ad0e88..b768a9ccc8 100644
--- a/src/client/app/mobile/views/pages/home.timeline.vue
+++ b/src/client/app/mobile/views/pages/home.timeline.vue
@@ -1,6 +1,11 @@
<template>
<div>
- <mk-friends-maker v-if="src == 'home' && alone" style="margin-bottom:8px"/>
+ <ui-container v-if="src == 'home' && alone" :show-header="false" style="margin-bottom:8px;">
+ <div class="zrzngnxs">
+ <p>{{ $t('@.empty-timeline-info.follow-users-to-make-your-timeline') }}</p>
+ <router-link to="/explore">{{ $t('@.empty-timeline-info.explore') }}</router-link>
+ </div>
+ </ui-container>
<mk-notes ref="timeline" :more="existMore ? more : null">
<div slot="empty">
@@ -18,7 +23,7 @@ const fetchLimit = 10;
export default Vue.extend({
i18n: i18n('mobile/views/pages/home.timeline.vue'),
-
+
props: {
src: {
type: String,
@@ -172,3 +177,14 @@ export default Vue.extend({
}
});
</script>
+
+<style lang="stylus" scoped>
+.zrzngnxs
+ padding 16px
+ text-align center
+ font-size 14px
+
+ > p
+ margin 0 0 8px 0
+
+</style>