Repository navigation
Expand file tree
/
Copy pathLobbyScreen.vue
More file actions
130 lines (109 loc) · 2.62 KB
/
Copy pathLobbyScreen.vue
File metadata and controls
130 lines (109 loc) · 2.62 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
129
130
<!--
- SPDX-FileCopyrightText: 2020 Nextcloud GmbH and Nextcloud contributors
- SPDX-License-Identifier: AGPL-3.0-or-later
-->
<template>
<div class="lobby">
<div class="lobby__header">
<IconRoomServiceOutline :size="64" />
<h2>{{ currentConversationName }}</h2>
<p class="lobby__timer">
{{ t('spreed', 'You are currently waiting in the lobby') }}
</p>
<p
v-if="lobbyTimer"
class="lobby__countdown">
{{ message }}
<span
v-if="relativeDate"
class="lobby__countdown relative-timestamp"
:title="startTime">
- {{ relativeDate }}
</span>
</p>
<div class="lobby__description">
<NcRichText
:text="conversation.description"
dir="auto"
autolink
useExtendedMarkdown />
</div>
</div>
<MediaSettings :isDialog="false" />
</div>
</template>
<script>
import { t } from '@nextcloud/l10n'
import NcRichText from '@nextcloud/vue/components/NcRichText'
import IconRoomServiceOutline from 'vue-material-design-icons/RoomServiceOutline.vue'
import MediaSettings from '../components/MediaSettings/MediaSettings.vue'
import { useGetToken } from '../composables/useGetToken.ts'
import { formatDateTime, futureRelativeTime, ONE_DAY_IN_MS } from '../utils/formattedTime.ts'
export default {
name: 'LobbyScreen',
components: {
NcRichText,
IconRoomServiceOutline,
MediaSettings,
},
setup() {
return {
token: useGetToken(),
}
},
computed: {
conversation() {
return this.$store.getters.conversation(this.token)
},
currentConversationName() {
return this.conversation ? this.conversation.displayName : ''
},
lobbyTimer() {
return this.conversation.lobbyTimer * 1000
},
relativeDate() {
if (Math.abs(Date.now() - this.lobbyTimer) > ONE_DAY_IN_MS) {
// No relative time
return ''
}
if (Math.abs(Date.now() - this.lobbyTimer) < 45000) {
return t('spreed', 'The meeting will start soon')
}
return futureRelativeTime(this.lobbyTimer)
},
startTime() {
return formatDateTime(this.lobbyTimer, 'longDateWithTime')
},
message() {
return t('spreed', 'This meeting is scheduled for {startTime}', { startTime: this.startTime })
},
},
methods: {
t,
},
}
</script>
<style lang="scss" scoped>
@use '../assets/variables.scss' as *;
@use '../assets/markdown.scss' as *;
.lobby {
display: flex;
flex-direction: column;
margin: auto;
&__header {
display: flex;
flex-direction: column;
align-items: center;
text-align: center;
}
&__countdown,
&__description {
margin-top: 25px;
max-width: $messages-list-max-width;
}
:deep(.rich-text--wrapper) {
text-align: start;
@include markdown;
}
}
</style>