From 1582e24550f32d888e4b637a3e78721b9418f561 Mon Sep 17 00:00:00 2001 From: DorraJaouad Date: Tue, 5 Sep 2023 12:19:30 +0200 Subject: [PATCH 1/4] Add a welcome window to set username for guests Signed-off-by: DorraJaouad --- src/components/ChatView.vue | 9 ++ src/components/GuestWelcomeWindow.vue | 149 ++++++++++++++++++++++++++ src/components/LobbyScreen.vue | 8 ++ src/components/SetGuestUsername.vue | 15 ++- 4 files changed, 178 insertions(+), 3 deletions(-) create mode 100644 src/components/GuestWelcomeWindow.vue diff --git a/src/components/ChatView.vue b/src/components/ChatView.vue index 23274d1c832..6452746c172 100644 --- a/src/components/ChatView.vue +++ b/src/components/ChatView.vue @@ -23,6 +23,7 @@ @dragover.prevent="handleDragOver" @dragleave.prevent="handleDragLeave" @drop.prevent="handleDropFiles"> +
@@ -70,6 +71,7 @@ import ChevronDoubleDown from 'vue-material-design-icons/ChevronDoubleDown.vue' import NcButton from '@nextcloud/vue/dist/Components/NcButton.js' +import GuestWelcomeWindow from './GuestWelcomeWindow.vue' import MessagesList from './MessagesList/MessagesList.vue' import NewMessage from './NewMessage/NewMessage.vue' import TransitionWrapper from './TransitionWrapper.vue' @@ -87,6 +89,7 @@ export default { MessagesList, NewMessage, TransitionWrapper, + GuestWelcomeWindow, }, props: { @@ -109,6 +112,12 @@ export default { isGuest() { return this.$store.getters.getActorType() === 'guests' }, + + isGuestAndhasNotUserName() { + const userName = localStorage.getItem('nick') + return !userName && this.isGuest + }, + dropHintText() { if (this.isGuest) { return t('spreed', 'You need to be logged in to upload files') diff --git a/src/components/GuestWelcomeWindow.vue b/src/components/GuestWelcomeWindow.vue new file mode 100644 index 00000000000..dcf617d0c7c --- /dev/null +++ b/src/components/GuestWelcomeWindow.vue @@ -0,0 +1,149 @@ + + + + + + + diff --git a/src/components/LobbyScreen.vue b/src/components/LobbyScreen.vue index d7c79ff5895..8203ed0dd80 100644 --- a/src/components/LobbyScreen.vue +++ b/src/components/LobbyScreen.vue @@ -20,6 +20,7 @@