mirror of
https://github.com/styppo/hamstr.git
synced 2024-10-18 13:33:22 +00:00
Add 'under construction' hint to Notifications page
This commit is contained in:
parent
289c37f91e
commit
81b360ba42
@ -1,8 +1,22 @@
|
|||||||
<template>
|
<template>
|
||||||
<PageHeader back-button />
|
<PageHeader back-button>
|
||||||
|
<template #addon>
|
||||||
|
<div class="under-construction">
|
||||||
|
<q-icon name="warning" size="xs"/> Under construction
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
</PageHeader>
|
||||||
|
|
||||||
<div class="notifications">
|
<div class="notifications">
|
||||||
<template v-for="(note, i) in notifications">
|
<template v-for="(note, i) in posts">
|
||||||
<ListPost v-if="defer(i)" :key="note.id" :note="note" class="list-post" clickable actions />
|
<ListPost
|
||||||
|
v-if="defer(i)"
|
||||||
|
:key="note.id"
|
||||||
|
:note="note"
|
||||||
|
class="list-post"
|
||||||
|
clickable
|
||||||
|
actions
|
||||||
|
/>
|
||||||
</template>
|
</template>
|
||||||
<ListPlaceholder :count="notifications?.length" :loading="loading" />
|
<ListPlaceholder :count="notifications?.length" :loading="loading" />
|
||||||
</div>
|
</div>
|
||||||
@ -11,12 +25,11 @@
|
|||||||
<script>
|
<script>
|
||||||
import PageHeader from 'components/PageHeader.vue'
|
import PageHeader from 'components/PageHeader.vue'
|
||||||
import ListPost from 'components/Post/ListPost.vue'
|
import ListPost from 'components/Post/ListPost.vue'
|
||||||
import {useNostrStore} from 'src/nostr/NostrStore'
|
|
||||||
import {useAppStore} from 'stores/App'
|
|
||||||
import {NoteOrder} from 'src/nostr/store/NoteStore'
|
|
||||||
import Defer from 'src/utils/Defer'
|
|
||||||
import {useSettingsStore} from 'stores/Settings'
|
|
||||||
import ListPlaceholder from 'components/ListPlaceholder.vue'
|
import ListPlaceholder from 'components/ListPlaceholder.vue'
|
||||||
|
import {useAppStore} from 'stores/App'
|
||||||
|
import {useNostrStore} from 'src/nostr/NostrStore'
|
||||||
|
import {useSettingsStore} from 'stores/Settings'
|
||||||
|
import Defer from 'src/utils/Defer'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'Notifications',
|
name: 'Notifications',
|
||||||
@ -31,21 +44,29 @@ export default {
|
|||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
notifications: [],
|
|
||||||
stream: null,
|
stream: null,
|
||||||
loading: true,
|
loading: true,
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
computed: {
|
||||||
|
notifications() {
|
||||||
|
return this.nostr.getNotifications(this.app.myPubkey)
|
||||||
|
},
|
||||||
|
posts() {
|
||||||
|
return this.notifications?.filter(note => note && !note.isReaction())
|
||||||
|
}
|
||||||
|
},
|
||||||
methods: {
|
methods: {
|
||||||
},
|
},
|
||||||
mounted() {
|
mounted() {
|
||||||
this.stream = this.nostr.streamNotifications(this.app.myPubkey)
|
// this.stream = this.nostr.streamNotifications(this.app.myPubkey)
|
||||||
this.stream.on('init', events => {
|
// this.stream.on('init', events => {
|
||||||
events.sort(NoteOrder.CREATION_DATE_DESC)
|
// events.sort(NoteOrder.CREATION_DATE_DESC)
|
||||||
this.notifications = events
|
// this.notifications = this.nostr.getNotifications(this.app.myPubkey)
|
||||||
this.loading = false
|
// this.loading = false
|
||||||
})
|
// })
|
||||||
this.stream.on('update', event => this.notifications.unshift(event))
|
//this.stream.on('update', event => this.notifications.unshift(event))
|
||||||
|
this.loading = false
|
||||||
},
|
},
|
||||||
unmounted() {
|
unmounted() {
|
||||||
if (this.stream) this.stream.close()
|
if (this.stream) this.stream.close()
|
||||||
@ -56,10 +77,11 @@ export default {
|
|||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
@import "assets/theme/colors.scss";
|
@import "assets/theme/colors.scss";
|
||||||
|
|
||||||
.notifications {
|
.under-construction {
|
||||||
//border-top: $border-dark;
|
color: $color-light-gray;
|
||||||
.list-post:first-child {
|
font-size: .95rem;
|
||||||
border-top: $border-dark;
|
i {
|
||||||
|
vertical-align: top;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
Loading…
Reference in New Issue
Block a user