-
Notifications
You must be signed in to change notification settings - Fork 300
Expand file tree
/
Copy pathInvitationResponseButtons.vue
More file actions
128 lines (112 loc) · 2.27 KB
/
InvitationResponseButtons.vue
File metadata and controls
128 lines (112 loc) · 2.27 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
<!--
- SPDX-FileCopyrightText: 2021 Nextcloud GmbH and Nextcloud contributors
- SPDX-License-Identifier: AGPL-3.0-or-later
-->
<template>
<div
class="invitation-response-buttons"
:class="{ 'invitation-response-buttons--grow': growHorizontally }">
<NcButton
v-if="!isAccepted"
variant="primary"
class="invitation-response-buttons__button"
@click="accept">
{{ t('calendar', 'Accept') }}
</NcButton>
<NcButton
v-if="!isDeclined"
variant="error"
class="invitation-response-buttons__button"
@click="decline">
{{ t('calendar', 'Decline') }}
</NcButton>
<template v-if="!isTentative">
<NcButton
v-if="!narrow"
class="invitation-response-buttons__button"
@click="tentative">
{{ t('calendar', 'Tentative') }}
</NcButton>
<Actions v-else>
<ActionButton
@click="tentative">
<template #icon>
<CalendarQuestionIcon :size="20" />
</template>
{{ t('calendar', 'Tentative') }}
</ActionButton>
</Actions>
</template>
</div>
</template>
<script>
import {
NcActionButton as ActionButton,
NcActions as Actions,
NcButton,
} from '@nextcloud/vue'
import CalendarQuestionIcon from 'vue-material-design-icons/CalendarQuestionOutline.vue'
export default {
name: 'InvitationResponseButtons',
components: {
Actions,
ActionButton,
NcButton,
CalendarQuestionIcon,
},
props: {
attendee: {
type: Object,
required: true,
},
calendarId: {
type: String,
required: true,
},
narrow: {
type: Boolean,
default: false,
},
growHorizontally: {
type: Boolean,
default: false,
},
},
computed: {
isAccepted() {
return this.attendee.participationStatus === 'ACCEPTED'
},
isDeclined() {
return this.attendee.participationStatus === 'DECLINED'
},
isTentative() {
return this.attendee.participationStatus === 'TENTATIVE'
},
},
methods: {
accept() {
this.$emit('respond', 'ACCEPTED')
},
decline() {
this.$emit('respond', 'DECLINED')
},
tentative() {
this.$emit('respond', 'TENTATIVE')
},
},
}
</script>
<style lang="scss" scoped>
.invitation-response-buttons {
display: flex;
justify-content: flex-end;
gap: 5px;
margin-bottom: 8px;
&--grow {
width: 100%;
.invitation-response-buttons__button {
flex: 1 auto;
}
}
}
</style>