2018-03-12 14:35:31 +01:00
|
|
|
<template>
|
2018-08-22 02:20:42 +02:00
|
|
|
<div class="notification">
|
|
|
|
<favourite v-if="message.type === 'favourite'"
|
|
|
|
:message="message"
|
|
|
|
:filter="filter"
|
|
|
|
:focused="focused"
|
2018-08-23 17:14:37 +02:00
|
|
|
:overlaid="overlaid"
|
2018-08-22 02:20:42 +02:00
|
|
|
@focusNext="$emit('focusNext')"
|
|
|
|
@focusPrev="$emit('focusPrev')"
|
2018-11-28 15:12:16 +01:00
|
|
|
@focusRight="$emit('focusRight')"
|
2018-08-22 02:20:42 +02:00
|
|
|
@select="$emit('selectNotification')"
|
|
|
|
>
|
|
|
|
</favourite>
|
|
|
|
<follow v-else-if="message.type === 'follow'"
|
|
|
|
:message="message"
|
|
|
|
:focused="focused"
|
2018-08-23 17:14:37 +02:00
|
|
|
:overlaid="overlaid"
|
2018-08-22 02:20:42 +02:00
|
|
|
@focusNext="$emit('focusNext')"
|
|
|
|
@focusPrev="$emit('focusPrev')"
|
2018-11-29 15:34:03 +01:00
|
|
|
@focusRight="$emit('focusRight')"
|
2018-08-22 02:20:42 +02:00
|
|
|
@select="$emit('selectNotification')"
|
|
|
|
>
|
|
|
|
</follow>
|
|
|
|
<mention v-else-if="message.type === 'mention'"
|
|
|
|
:message="message"
|
|
|
|
:filter="filter"
|
|
|
|
:focused="focused"
|
2018-08-23 17:14:37 +02:00
|
|
|
:overlaid="overlaid"
|
2019-03-14 17:02:10 +01:00
|
|
|
v-on:update="updateToot"
|
|
|
|
v-on:delete="deleteToot"
|
2018-08-22 02:20:42 +02:00
|
|
|
@focusNext="$emit('focusNext')"
|
|
|
|
@focusPrev="$emit('focusPrev')"
|
2018-11-28 15:12:16 +01:00
|
|
|
@focusRight="$emit('focusRight')"
|
2018-08-22 02:20:42 +02:00
|
|
|
@select="$emit('selectNotification')"
|
|
|
|
>
|
|
|
|
</mention>
|
|
|
|
<reblog v-else-if="message.type == 'reblog'"
|
|
|
|
:message="message"
|
|
|
|
:filter="filter"
|
|
|
|
:focused="focused"
|
2018-08-23 17:14:37 +02:00
|
|
|
:overlaid="overlaid"
|
2018-08-22 02:20:42 +02:00
|
|
|
@focusNext="$emit('focusNext')"
|
|
|
|
@focusPrev="$emit('focusPrev')"
|
2018-11-28 15:12:16 +01:00
|
|
|
@focusRight="$emit('focusRight')"
|
2018-08-22 02:20:42 +02:00
|
|
|
@select="$emit('selectNotification')"
|
|
|
|
>
|
|
|
|
</reblog>
|
2018-03-12 14:35:31 +01:00
|
|
|
</div>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<script>
|
|
|
|
import Favourite from './Notification/Favourite'
|
|
|
|
import Follow from './Notification/Follow'
|
|
|
|
import Mention from './Notification/Mention'
|
|
|
|
import Reblog from './Notification/Reblog'
|
|
|
|
|
|
|
|
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
|
|
|
}
|
|
|
|
},
|
2019-03-14 17:02:10 +01:00
|
|
|
components: { Favourite, Follow, Mention, Reblog },
|
|
|
|
methods: {
|
|
|
|
updateToot (message) {
|
|
|
|
return this.$emit('update', message)
|
|
|
|
},
|
|
|
|
deleteToot (message) {
|
|
|
|
return this.$emit('delete', message)
|
|
|
|
}
|
|
|
|
}
|
2018-03-12 14:35:31 +01:00
|
|
|
}
|
|
|
|
</script>
|