2018-03-12 14:35:31 +01:00
|
|
|
<template>
|
2020-04-25 14:02:56 +02:00
|
|
|
<div class="notification">
|
|
|
|
<favourite
|
|
|
|
v-if="message.type === 'favourite'"
|
|
|
|
:message="message"
|
|
|
|
:filter="filter"
|
|
|
|
:focused="focused"
|
|
|
|
:overlaid="overlaid"
|
|
|
|
@focusNext="$emit('focusNext')"
|
|
|
|
@focusPrev="$emit('focusPrev')"
|
|
|
|
@focusRight="$emit('focusRight')"
|
|
|
|
@select="$emit('selectNotification')"
|
|
|
|
>
|
|
|
|
</favourite>
|
|
|
|
<follow
|
|
|
|
v-else-if="message.type === 'follow'"
|
|
|
|
:message="message"
|
|
|
|
:focused="focused"
|
|
|
|
:overlaid="overlaid"
|
|
|
|
@focusNext="$emit('focusNext')"
|
|
|
|
@focusPrev="$emit('focusPrev')"
|
|
|
|
@focusRight="$emit('focusRight')"
|
|
|
|
@select="$emit('selectNotification')"
|
|
|
|
>
|
|
|
|
</follow>
|
|
|
|
<mention
|
|
|
|
v-else-if="message.type === 'mention'"
|
|
|
|
:message="message"
|
|
|
|
:filter="filter"
|
|
|
|
:focused="focused"
|
|
|
|
:overlaid="overlaid"
|
|
|
|
v-on:update="updateToot"
|
|
|
|
v-on:delete="deleteToot"
|
|
|
|
@focusNext="$emit('focusNext')"
|
|
|
|
@focusPrev="$emit('focusPrev')"
|
|
|
|
@focusRight="$emit('focusRight')"
|
|
|
|
@select="$emit('selectNotification')"
|
|
|
|
>
|
|
|
|
</mention>
|
2020-05-23 15:41:17 +02:00
|
|
|
<quote
|
|
|
|
v-else-if="message.type === 'reblog' && message.status.quote"
|
|
|
|
:message="message"
|
|
|
|
:filter="filter"
|
|
|
|
:focused="focused"
|
|
|
|
:overlaid="overlaid"
|
|
|
|
@focusNext="$emit('focusNext')"
|
|
|
|
@focusPrev="$emit('focusPrev')"
|
|
|
|
@focusRight="$emit('focusRight')"
|
|
|
|
@select="$emit('selectNotification')"
|
|
|
|
>
|
|
|
|
</quote>
|
2020-04-25 14:02:56 +02:00
|
|
|
<reblog
|
2020-05-23 15:41:17 +02:00
|
|
|
v-else-if="message.type === 'reblog' && !message.status.quote"
|
2020-04-25 14:02:56 +02:00
|
|
|
:message="message"
|
|
|
|
:filter="filter"
|
|
|
|
:focused="focused"
|
|
|
|
:overlaid="overlaid"
|
|
|
|
@focusNext="$emit('focusNext')"
|
|
|
|
@focusPrev="$emit('focusPrev')"
|
|
|
|
@focusRight="$emit('focusRight')"
|
|
|
|
@select="$emit('selectNotification')"
|
|
|
|
>
|
|
|
|
</reblog>
|
|
|
|
<reaction
|
|
|
|
v-else-if="message.type === 'emoji_reaction'"
|
|
|
|
:message="message"
|
|
|
|
:filter="filter"
|
|
|
|
:focused="focused"
|
|
|
|
:overlaid="overlaid"
|
|
|
|
@focusNext="$emit('focusNext')"
|
|
|
|
@focusPrev="$emit('focusPrev')"
|
|
|
|
@focusRight="$emit('focusRight')"
|
|
|
|
@select="$emit('selectNotification')"
|
|
|
|
>
|
|
|
|
</reaction>
|
|
|
|
</div>
|
2018-03-12 14:35:31 +01:00
|
|
|
</template>
|
|
|
|
|
|
|
|
<script>
|
|
|
|
import Favourite from './Notification/Favourite'
|
|
|
|
import Follow from './Notification/Follow'
|
|
|
|
import Mention from './Notification/Mention'
|
2020-05-23 15:41:17 +02:00
|
|
|
import Quote from './Notification/Quote'
|
2018-03-12 14:35:31 +01:00
|
|
|
import Reblog from './Notification/Reblog'
|
2020-04-25 14:02:56 +02:00
|
|
|
import Reaction from './Notification/Reaction'
|
2018-03-12 14:35:31 +01:00
|
|
|
|
|
|
|
export default {
|
|
|
|
name: 'notification',
|
2018-07-09 17:50:20 +02:00
|
|
|
props: {
|
|
|
|
message: {
|
|
|
|
type: Object,
|
|
|
|
default: {}
|
|
|
|
},
|
|
|
|
filter: {
|
|
|
|
type: String,
|
|
|
|
default: ''
|
2018-08-22 02:20:42 +02:00
|
|
|
},
|
|
|
|
focused: {
|
|
|
|
type: Boolean,
|
|
|
|
defalt: false
|
2018-08-23 17:14:37 +02:00
|
|
|
},
|
|
|
|
overlaid: {
|
|
|
|
type: Boolean,
|
|
|
|
default: false
|
2018-07-09 17:50:20 +02:00
|
|
|
}
|
|
|
|
},
|
2020-05-23 15:41:17 +02:00
|
|
|
components: { Favourite, Follow, Mention, Quote, Reblog, Reaction },
|
2019-03-14 17:02:10 +01:00
|
|
|
methods: {
|
2020-04-25 14:02:56 +02:00
|
|
|
updateToot(message) {
|
2019-03-14 17:02:10 +01:00
|
|
|
return this.$emit('update', message)
|
|
|
|
},
|
2020-04-25 14:02:56 +02:00
|
|
|
deleteToot(message) {
|
2019-03-14 17:02:10 +01:00
|
|
|
return this.$emit('delete', message)
|
|
|
|
}
|
|
|
|
}
|
2018-03-12 14:35:31 +01:00
|
|
|
}
|
|
|
|
</script>
|