Files
habitica/website/client/components/header/notifications/questInvitation.vue
Brian Fenton 88c625fe80 removing the 24px top margin on .modal-dialog .title (#10377)
* removing the 24px top margin on .modal-dialog .title so boss HP and difficulty line up

* stop overloading title so much and use a properly-scoped style

* removing unnecessary temp vars

* using SCSS color vars as per CR

* using relative font size measurements instead of absolute pixels, and adding popover override CSS to not break quest shop & invite notifications

* removing redundant font declarations
2018-06-15 10:58:28 +02:00

62 lines
1.6 KiB
Vue

<template lang="pug">
base-notification(
:can-remove="canRemove",
:has-icon="false",
:notification="notification",
@click="action",
)
div(slot="content")
.message(v-html="$t('invitedToQuest', {quest: questName})")
quest-info(:quest="questData", :small-version="true")
.notifications-buttons
.btn.btn-small.btn-success(@click.stop="questAccept()") {{ $t('accept') }}
.btn.btn-small.btn-danger(@click.stop="questReject()") {{ $t('reject') }}
</template>
<style lang="scss">
.message {
margin-bottom: 8px;
}
</style>
<script>
import BaseNotification from './base';
import { mapState } from 'client/libs/store';
import quests from 'common/script/content/quests';
import questInfo from 'client/components/shops/quests/questInfo';
export default {
props: ['notification', 'canRemove'],
components: {
BaseNotification,
questInfo,
},
computed: {
...mapState({user: 'user.data'}),
questData () {
return quests.quests[this.notification.data.quest];
},
questName () {
return this.questData.text();
},
},
methods: {
action () {
this.$router.push({ name: 'party' });
},
async questAccept () {
this.user.party.quest = await this.$store.dispatch('quests:sendAction', {
groupId: this.notification.data.partyId,
action: 'quests/accept',
});
},
async questReject () {
this.user.party.quest = await this.$store.dispatch('quests:sendAction', {
groupId: this.notification.data.partyId,
action: 'quests/reject',
});
},
},
};
</script>