2018-03-12 14:35:31 +01:00
|
|
|
<template>
|
2020-04-25 14:02:56 +02:00
|
|
|
<div class="notification">
|
2022-05-22 09:21:59 +02:00
|
|
|
<StatusReaction
|
2020-04-25 14:02:56 +02:00
|
|
|
v-if="message.type === 'favourite'"
|
|
|
|
:message="message"
|
2021-05-22 07:33:57 +02:00
|
|
|
:filters="filters"
|
2020-04-25 14:02:56 +02:00
|
|
|
:focused="focused"
|
|
|
|
:overlaid="overlaid"
|
2022-08-14 15:19:27 +02:00
|
|
|
reaction-type="favourite"
|
|
|
|
@focus-right="$emit('focusRight')"
|
2020-04-25 14:02:56 +02:00
|
|
|
@select="$emit('selectNotification')"
|
|
|
|
>
|
2022-05-22 09:21:59 +02:00
|
|
|
</StatusReaction>
|
2020-04-25 14:02:56 +02:00
|
|
|
<follow
|
|
|
|
v-else-if="message.type === 'follow'"
|
|
|
|
:message="message"
|
|
|
|
:focused="focused"
|
|
|
|
:overlaid="overlaid"
|
2022-08-14 15:19:27 +02:00
|
|
|
@focus-right="$emit('focusRight')"
|
2020-04-25 14:02:56 +02:00
|
|
|
@select="$emit('selectNotification')"
|
|
|
|
>
|
|
|
|
</follow>
|
2020-05-23 15:57:55 +02:00
|
|
|
<FollowRequest
|
|
|
|
v-else-if="message.type === 'follow_request'"
|
|
|
|
:message="message"
|
|
|
|
:focused="focused"
|
|
|
|
:overlaid="overlaid"
|
2022-08-14 15:19:27 +02:00
|
|
|
@focus-right="$emit('focusRight')"
|
2020-05-23 15:57:55 +02:00
|
|
|
@select="$emit('selectNotification')"
|
|
|
|
>
|
|
|
|
</FollowRequest>
|
2020-04-25 14:02:56 +02:00
|
|
|
<mention
|
|
|
|
v-else-if="message.type === 'mention'"
|
|
|
|
:message="message"
|
2021-05-22 07:33:57 +02:00
|
|
|
:filters="filters"
|
2020-04-25 14:02:56 +02:00
|
|
|
:focused="focused"
|
|
|
|
:overlaid="overlaid"
|
2022-08-14 15:19:27 +02:00
|
|
|
@update="updateToot"
|
|
|
|
@delete="deleteToot"
|
|
|
|
@focus-right="$emit('focusRight')"
|
2020-04-25 14:02:56 +02:00
|
|
|
@select="$emit('selectNotification')"
|
|
|
|
>
|
|
|
|
</mention>
|
2022-05-22 09:21:59 +02:00
|
|
|
<StatusReaction
|
2022-05-22 09:34:46 +02:00
|
|
|
v-else-if="message.type === 'reblog' && message.status?.quote"
|
2020-05-23 15:41:17 +02:00
|
|
|
:message="message"
|
2021-05-22 07:33:57 +02:00
|
|
|
:filters="filters"
|
2020-05-23 15:41:17 +02:00
|
|
|
:focused="focused"
|
|
|
|
:overlaid="overlaid"
|
2022-08-14 15:19:27 +02:00
|
|
|
reaction-type="quote"
|
|
|
|
@focus-right="$emit('focusRight')"
|
2020-05-23 15:41:17 +02:00
|
|
|
@select="$emit('selectNotification')"
|
|
|
|
>
|
2022-05-22 09:21:59 +02:00
|
|
|
</StatusReaction>
|
|
|
|
<StatusReaction
|
2022-05-22 09:34:46 +02:00
|
|
|
v-else-if="message.type === 'reblog' && !message.status?.quote"
|
2020-04-25 14:02:56 +02:00
|
|
|
:message="message"
|
2021-05-22 07:33:57 +02:00
|
|
|
:filters="filters"
|
2020-04-25 14:02:56 +02:00
|
|
|
:focused="focused"
|
|
|
|
:overlaid="overlaid"
|
2022-08-14 15:19:27 +02:00
|
|
|
reaction-type="reblog"
|
|
|
|
@focus-right="$emit('focusRight')"
|
2020-04-25 14:02:56 +02:00
|
|
|
@select="$emit('selectNotification')"
|
|
|
|
>
|
2022-05-22 09:21:59 +02:00
|
|
|
</StatusReaction>
|
2021-03-02 02:59:41 +01:00
|
|
|
<status
|
|
|
|
v-else-if="message.type === 'status'"
|
|
|
|
:message="message"
|
2021-05-22 07:33:57 +02:00
|
|
|
:filters="filters"
|
2021-03-02 02:59:41 +01:00
|
|
|
:focused="focused"
|
|
|
|
:overlaid="overlaid"
|
2022-08-14 15:19:27 +02:00
|
|
|
@focus-right="$emit('focusRight')"
|
2021-03-02 02:59:41 +01:00
|
|
|
@select="$emit('selectNotification')"
|
|
|
|
>
|
|
|
|
</status>
|
2022-05-22 09:21:59 +02:00
|
|
|
<StatusReaction
|
2021-03-23 16:46:31 +01:00
|
|
|
v-else-if="message.type === 'poll_vote'"
|
2021-03-19 17:16:24 +01:00
|
|
|
:message="message"
|
2021-05-22 07:33:57 +02:00
|
|
|
:filters="filters"
|
2021-03-19 17:16:24 +01:00
|
|
|
:focused="focused"
|
|
|
|
:overlaid="overlaid"
|
2022-08-14 15:19:27 +02:00
|
|
|
reaction-type="poll-vote"
|
|
|
|
@focus-right="$emit('focusRight')"
|
2021-03-19 17:16:24 +01:00
|
|
|
@select="$emit('selectNotification')"
|
|
|
|
>
|
2022-05-22 09:21:59 +02:00
|
|
|
</StatusReaction>
|
|
|
|
<StatusReaction
|
2021-03-23 17:14:54 +01:00
|
|
|
v-else-if="message.type === 'poll_expired'"
|
|
|
|
:message="message"
|
2021-05-22 07:33:57 +02:00
|
|
|
:filters="filters"
|
2021-03-23 17:14:54 +01:00
|
|
|
:focused="focused"
|
|
|
|
:overlaid="overlaid"
|
2022-08-14 15:19:27 +02:00
|
|
|
reaction-type="poll-expired"
|
|
|
|
@focus-right="$emit('focusRight')"
|
2021-03-23 17:14:54 +01:00
|
|
|
@select="$emit('selectNotification')"
|
|
|
|
>
|
2022-05-22 09:21:59 +02:00
|
|
|
</StatusReaction>
|
2022-08-14 15:05:01 +02:00
|
|
|
<StatusReaction
|
|
|
|
v-else-if="message.type === 'emoji_reaction'"
|
|
|
|
:message="message"
|
|
|
|
:filters="filters"
|
|
|
|
:focused="focused"
|
|
|
|
:overlaid="overlaid"
|
2022-08-14 15:19:27 +02:00
|
|
|
reaction-type="emoji-reaction"
|
|
|
|
@focus-right="$emit('focusRight')"
|
2022-08-14 15:05:01 +02:00
|
|
|
@select="$emit('selectNotification')"
|
|
|
|
>
|
|
|
|
</StatusReaction>
|
2020-04-25 14:02:56 +02:00
|
|
|
</div>
|
2018-03-12 14:35:31 +01:00
|
|
|
</template>
|
|
|
|
|
2022-05-22 09:34:46 +02:00
|
|
|
<script lang="ts">
|
|
|
|
import { defineComponent, PropType } from 'vue'
|
|
|
|
import { Entity } from 'megalodon'
|
|
|
|
import StatusReaction from './Notification/StatusReaction.vue'
|
|
|
|
import Follow from './Notification/Follow.vue'
|
|
|
|
import FollowRequest from './Notification/FollowRequest.vue'
|
|
|
|
import Mention from './Notification/Mention.vue'
|
|
|
|
import Status from './Notification/Status.vue'
|
2018-03-12 14:35:31 +01:00
|
|
|
|
2022-05-22 09:34:46 +02:00
|
|
|
export default defineComponent({
|
2022-08-14 15:19:27 +02:00
|
|
|
name: 'Notification',
|
|
|
|
components: {
|
|
|
|
StatusReaction,
|
|
|
|
Follow,
|
|
|
|
FollowRequest,
|
|
|
|
Mention,
|
|
|
|
Status
|
|
|
|
},
|
2018-07-09 17:50:20 +02:00
|
|
|
props: {
|
|
|
|
message: {
|
2022-05-22 09:34:46 +02:00
|
|
|
type: Object as PropType<Entity.Notification>,
|
2022-08-14 15:19:27 +02:00
|
|
|
default: () => ({})
|
2018-07-09 17:50:20 +02:00
|
|
|
},
|
2021-05-22 07:33:57 +02:00
|
|
|
filters: {
|
2022-05-22 09:34:46 +02:00
|
|
|
type: Array as PropType<Array<Entity.Filter>>,
|
2022-08-14 15:19:27 +02:00
|
|
|
default: () => []
|
2018-08-22 02:20:42 +02:00
|
|
|
},
|
|
|
|
focused: {
|
|
|
|
type: Boolean,
|
2022-08-14 15:19:27 +02:00
|
|
|
defalt: () => false
|
2018-08-23 17:14:37 +02:00
|
|
|
},
|
|
|
|
overlaid: {
|
|
|
|
type: Boolean,
|
2022-08-14 15:19:27 +02:00
|
|
|
default: () => false
|
2022-05-22 09:21:59 +02:00
|
|
|
}
|
2022-04-18 15:41:52 +02:00
|
|
|
},
|
2022-08-14 15:19:27 +02:00
|
|
|
emits: ['focusRight', 'selectNotification', 'update', 'delete'],
|
2022-05-22 09:34:46 +02:00
|
|
|
setup(_props, ctx) {
|
|
|
|
const updateToot = (message: Entity.Status) => {
|
|
|
|
return ctx.emit('update', message)
|
|
|
|
}
|
|
|
|
const deleteToot = (message: Entity.Status) => {
|
|
|
|
return ctx.emit('delete', message)
|
|
|
|
}
|
|
|
|
|
|
|
|
return {
|
|
|
|
updateToot,
|
|
|
|
deleteToot
|
2022-05-22 09:21:59 +02:00
|
|
|
}
|
|
|
|
}
|
2022-05-22 09:34:46 +02:00
|
|
|
})
|
2018-03-12 14:35:31 +01:00
|
|
|
</script>
|