Skip to content

Commit

Permalink
Merge pull request #14237 from nextcloud/fix/noid/dragover
Browse files Browse the repository at this point in the history
  • Loading branch information
Antreesy authored Jan 28, 2025
2 parents 456277e + 35c0da1 commit db91e82
Showing 1 changed file with 39 additions and 33 deletions.
72 changes: 39 additions & 33 deletions src/components/ChatView.vue
Original file line number Diff line number Diff line change
Expand Up @@ -9,26 +9,24 @@
@dragleave.prevent="handleDragLeave"
@drop.prevent="handleDropFiles">
<GuestWelcomeWindow v-if="isGuestWithoutDisplayName" :token="token" />
<TransitionWrapper name="slide-up" mode="out-in">
<div v-show="isDraggingOver"
class="dragover">
<div class="drop-hint">
<div class="drop-hint__icon"
:class="{
'icon-upload' : !isGuest && !isReadOnly,
'icon-user' : isGuest,
'icon-error' : isReadOnly}" />
<h2 class="drop-hint__text">
{{ dropHintText }}
</h2>
</div>
</div>
</TransitionWrapper>
<MessagesList role="region"
:aria-label="t('spreed', 'Conversation messages')"
:token="token"
:is-chat-scrolled-to-bottom.sync="isChatScrolledToBottom"
:is-visible="isVisible" />
<div class="messages-list-dragover-wrapper">
<TransitionWrapper name="slide-up" mode="out-in">
<NcEmptyContent v-show="isDraggingOver"
:name="dropHintText"
class="dragover">
<template #icon>
<IconTrayArrowUp v-if="!isGuest && !isReadOnly" />
<IconAccount v-else-if="isGuest" />
<IconAlertOctagon v-else-if="isReadOnly" />
</template>
</NcEmptyContent>
</TransitionWrapper>
<MessagesList role="region"
:aria-label="t('spreed', 'Conversation messages')"
:token="token"
:is-chat-scrolled-to-bottom.sync="isChatScrolledToBottom"
:is-visible="isVisible" />
</div>

<div class="scroll-to-bottom">
<TransitionWrapper name="fade">
Expand All @@ -39,7 +37,7 @@
class="scroll-to-bottom__button"
@click="scrollToBottom">
<template #icon>
<ChevronDoubleDown :size="20" />
<IconChevronDoubleDown :size="20" />
</template>
</NcButton>
</TransitionWrapper>
Expand All @@ -57,11 +55,15 @@
</template>

<script>
import ChevronDoubleDown from 'vue-material-design-icons/ChevronDoubleDown.vue'
import IconAccount from 'vue-material-design-icons/Account.vue'
import IconAlertOctagon from 'vue-material-design-icons/AlertOctagon.vue'
import IconChevronDoubleDown from 'vue-material-design-icons/ChevronDoubleDown.vue'
import IconTrayArrowUp from 'vue-material-design-icons/TrayArrowUp.vue'

import { t } from '@nextcloud/l10n'

import NcButton from '@nextcloud/vue/dist/Components/NcButton.js'
import NcEmptyContent from '@nextcloud/vue/dist/Components/NcEmptyContent.js'

import GuestWelcomeWindow from './GuestWelcomeWindow.vue'
import MessagesList from './MessagesList/MessagesList.vue'
Expand All @@ -80,12 +82,17 @@ export default {

components: {
NcButton,
ChevronDoubleDown,
NcEmptyContent,
MessagesList,
NewMessage,
NewMessageUploadEditor,
TransitionWrapper,
GuestWelcomeWindow,
// icons
IconAccount,
IconAlertOctagon,
IconChevronDoubleDown,
IconTrayArrowUp,
},

props: {
Expand Down Expand Up @@ -216,9 +223,17 @@ export default {
min-height: 0;
}

.messages-list-dragover-wrapper {
position: relative;
width: 100%;
height: 100%;
display: flex;
min-height: 0;
}

.dragover {
position: absolute;
inset: 10%;
inset: 5%;
background: var(--color-primary-element-light);
z-index: 11;
display: flex;
Expand All @@ -228,15 +243,6 @@ export default {
pointer-events: none;
}

.drop-hint {
margin: auto;
&__icon {
background-size: 48px;
height: 48px;
margin-bottom: 16px;
}
}

.scroll-to-bottom {
position: relative;
height: 0;
Expand Down

0 comments on commit db91e82

Please sign in to comment.