Files
habitica/website/client/src/components/header/notifications/itemReceived.vue
Sabe Jones ede036e94b Universal routing for migrations (#14772)
* refactor(notifs): universal routing for migrations

* fix(lint): remove whitespace

* chore(content): update migration for new scheme

* fix(migration): account for cake

* chore(images): update sprite CSS

---------

Co-authored-by: SabreCat <sabe@habitica.com>
2023-07-31 12:07:46 -05:00

59 lines
1.3 KiB
Vue

<template>
<base-notification
:can-remove="canRemove"
:has-icon="true"
:notification="notification"
:read-after-click="true"
@click="action"
>
<div
slot="content"
>
<strong> {{ notification.data.title }} </strong>
<span> {{ notification.data.text }} </span>
</div>
<div
slot="icon"
class="mt-3"
:class="notification.data.icon"
></div>
</base-notification>
</template>
<script>
import BaseNotification from './base';
export default {
components: {
BaseNotification,
},
props: {
notification: {
type: Object,
default (data) {
return data;
},
},
canRemove: {
type: Boolean,
default: true,
},
},
methods: {
action () {
if (!this.notification || !this.notification.data) {
return;
}
if (this.notification.data.destination.indexOf('backgrounds') !== -1) {
this.$store.state.avatarEditorOptions.editingUser = true;
this.$store.state.avatarEditorOptions.startingPage = 'backgrounds';
this.$store.state.avatarEditorOptions.subpage = '2023';
this.$root.$emit('bv::show::modal', 'avatar-modal');
} else {
this.$router.push(this.notification.data.destination || '/inventory/items');
}
},
},
};
</script>