diff options
| author | syuilo <syuilotan@yahoo.co.jp> | 2018-06-02 16:13:32 +0900 |
|---|---|---|
| committer | syuilo <syuilotan@yahoo.co.jp> | 2018-06-02 16:13:32 +0900 |
| commit | 897f7a031d624d8ca37b8efcab573d002c80dbe8 (patch) | |
| tree | 217fa4ae7600979d6b504d0969e5fa6f636551dd /src/client/app/mobile/views | |
| parent | wip (diff) | |
| download | misskey-897f7a031d624d8ca37b8efcab573d002c80dbe8.tar.gz misskey-897f7a031d624d8ca37b8efcab573d002c80dbe8.tar.bz2 misskey-897f7a031d624d8ca37b8efcab573d002c80dbe8.zip | |
wip
Diffstat (limited to 'src/client/app/mobile/views')
4 files changed, 83 insertions, 4 deletions
diff --git a/src/client/app/mobile/views/components/notification-preview.vue b/src/client/app/mobile/views/components/notification-preview.vue index 6046f77242..5e2306932b 100644 --- a/src/client/app/mobile/views/components/notification-preview.vue +++ b/src/client/app/mobile/views/components/notification-preview.vue @@ -31,7 +31,7 @@ </div> </template> - <template v-if="notification.type == 'reciveFollowRequest'"> + <template v-if="notification.type == 'receiveFollowRequest'"> <mk-avatar class="avatar" :user="notification.user"/> <div class="text"> <p>%fa:user-clock%{{ notification.user | userName }}</p> @@ -125,7 +125,7 @@ export default Vue.extend({ .text p i color #53c7ce - &.reciveFollowRequest + &.receiveFollowRequest .text p i color #888 diff --git a/src/client/app/mobile/views/components/notification.vue b/src/client/app/mobile/views/components/notification.vue index 8109bef38e..9228950209 100644 --- a/src/client/app/mobile/views/components/notification.vue +++ b/src/client/app/mobile/views/components/notification.vue @@ -40,7 +40,7 @@ </div> </div> - <div class="notification followRequest" v-if="notification.type == 'reciveFollowRequest'"> + <div class="notification followRequest" v-if="notification.type == 'receiveFollowRequest'"> <mk-avatar class="avatar" :user="notification.user"/> <div> <header> @@ -167,7 +167,7 @@ root(isDark) > div > header i color #53c7ce - &.reciveFollowRequest + &.receiveFollowRequest > div > header i color #888 diff --git a/src/client/app/mobile/views/components/ui.nav.vue b/src/client/app/mobile/views/components/ui.nav.vue index 11a8f7ab97..80f60e4232 100644 --- a/src/client/app/mobile/views/components/ui.nav.vue +++ b/src/client/app/mobile/views/components/ui.nav.vue @@ -18,6 +18,7 @@ <li><router-link to="/" :data-active="$route.name == 'index'">%fa:home%%i18n:@timeline%%fa:angle-right%</router-link></li> <li><router-link to="/i/notifications" :data-active="$route.name == 'notifications'">%fa:R bell%%i18n:@notifications%<template v-if="hasUnreadNotification">%fa:circle%</template>%fa:angle-right%</router-link></li> <li><router-link to="/i/messaging" :data-active="$route.name == 'messaging'">%fa:R comments%%i18n:@messaging%<template v-if="hasUnreadMessagingMessage">%fa:circle%</template>%fa:angle-right%</router-link></li> + <li v-if="$store.getters.isSignedIn && $store.state.i.isLocked"><router-link to="/i/received-follow-requests" :data-active="$route.name == 'received-follow-requests'">%fa:R envelope%%i18n:@follow-requests%<template v-if="$store.getters.isSignedIn && $store.state.i.pendingReceivedFollowRequestsCount">%fa:circle%</template>%fa:angle-right%</router-link></li> <li><router-link to="/othello" :data-active="$route.name == 'othello'">%fa:gamepad%%i18n:@game%<template v-if="hasGameInvitation">%fa:circle%</template>%fa:angle-right%</router-link></li> </ul> <ul> diff --git a/src/client/app/mobile/views/pages/received-follow-requests.vue b/src/client/app/mobile/views/pages/received-follow-requests.vue new file mode 100644 index 0000000000..bf26a84ff9 --- /dev/null +++ b/src/client/app/mobile/views/pages/received-follow-requests.vue @@ -0,0 +1,78 @@ +<template> +<mk-ui> + <span slot="header">%fa:envelope R%%i18n:@title%</span> + + <main> + <div v-for="req in requests"> + <router-link :key="req.id" :to="req.follower | userPage">{{ req.follower | userName }}</router-link> + <span> + <a @click="accept(req.follower)">%i18n:@accept%</a>|<a @click="reject(req.follower)">%i18n:@reject%</a> + </span> + </div> + </main> +</mk-ui> +</template> + +<script lang="ts"> +import Vue from 'vue'; +import Progress from '../../../common/scripts/loading'; + +export default Vue.extend({ + data() { + return { + fetching: true, + requests: [] + }; + }, + mounted() { + document.title = 'Misskey | %i18n:@title%'; + + Progress.start(); + + (this as any).api('following/requests/list').then(requests => { + this.fetching = false; + this.requests = requests; + + Progress.done(); + }); + }, + methods: { + accept(user) { + (this as any).api('following/requests/accept', { userId: user.id }).then(() => { + this.requests = this.requests.filter(r => r.follower.id != user.id); + }); + }, + reject(user) { + (this as any).api('following/requests/reject', { userId: user.id }).then(() => { + this.requests = this.requests.filter(r => r.follower.id != user.id); + }); + } + } +}); +</script> + +<style lang="stylus" scoped> +@import '~const.styl' + +main + width 100% + max-width 680px + margin 0 auto + padding 8px + + @media (min-width 500px) + padding 16px + + @media (min-width 600px) + padding 32px + + > div + display flex + padding 16px + border solid 1px isDark ? #1c2023 : #eee + border-radius 4px + + > span + margin 0 0 0 auto + +</style> |