Compare commits

...

2 commits

Author SHA1 Message Date
iamsivin
af8fb74032 fixes: ES lint issue 2022-12-26 14:00:05 +05:30
iamsivin
4375b694c4 feat: Uses expanded layout as default if the breakpoint is below 992px 2022-12-26 13:43:35 +05:30
11 changed files with 118 additions and 74 deletions

View file

@ -42,7 +42,6 @@ $resolve-button-width: 13.2rem;
margin-right: var(--space-normal); margin-right: var(--space-normal);
min-width: 0; min-width: 0;
.user--profile__meta { .user--profile__meta {
align-items: flex-start; align-items: flex-start;
display: flex; display: flex;
@ -54,7 +53,6 @@ $resolve-button-width: 13.2rem;
} }
} }
.header-actions-wrap { .header-actions-wrap {
align-items: center; align-items: center;
display: flex; display: flex;
@ -62,6 +60,10 @@ $resolve-button-width: 13.2rem;
flex-grow: 1; flex-grow: 1;
justify-content: flex-end; justify-content: flex-end;
@include breakpoint(640px down) {
margin-top: var(--space-small);
}
&.has-open-sidebar { &.has-open-sidebar {
justify-content: flex-end; justify-content: flex-end;
} }

View file

@ -324,6 +324,7 @@
var(--space-one); var(--space-one);
.is-text { .is-text {
align-items: center;
display: inline-flex; display: inline-flex;
text-align: start; text-align: start;

View file

@ -794,16 +794,16 @@ export default {
.conversations-list-wrap { .conversations-list-wrap {
flex-shrink: 0; flex-shrink: 0;
width: 34rem; flex-basis: 34rem;
overflow: hidden; overflow: hidden;
@include breakpoint(large up) { @include breakpoint(large up) {
width: 36rem; flex-basis: 36rem;
} }
@include breakpoint(xlarge up) { @include breakpoint(xlarge up) {
width: 35rem; flex-basis: 38rem;
} }
@include breakpoint(xxlarge up) { @include breakpoint(xxlarge up) {
width: 38rem; flex-basis: 42rem;
} }
@include breakpoint(xxxlarge up) { @include breakpoint(xxxlarge up) {
flex-basis: 46rem; flex-basis: 46rem;
@ -814,12 +814,9 @@ export default {
} }
&.list--full-width { &.list--full-width {
width: 100%;
@include breakpoint(xxxlarge up) {
flex-basis: 100%; flex-basis: 100%;
} }
} }
}
.filter--actions { .filter--actions {
display: flex; display: flex;
align-items: center; align-items: center;

View file

@ -233,9 +233,6 @@ export default {
width: 40rem; width: 40rem;
} }
} }
.off-canvas-content.is-open-left {
transform: translateX(18.8rem);
}
.secondary-sidebar { .secondary-sidebar {
overflow-y: auto; overflow-y: auto;

View file

@ -376,6 +376,10 @@ export default {
display: flex; display: flex;
flex-direction: column; flex-direction: column;
.ProseMirror-menubar {
min-height: var(--space-two) !important;
}
> .ProseMirror { > .ProseMirror {
padding: 0; padding: 0;
word-break: break-word; word-break: break-word;

View file

@ -166,11 +166,15 @@ export default {
.conversation-sidebar-wrap { .conversation-sidebar-wrap {
height: auto; height: auto;
flex: 0 0; flex: 0 0;
overflow: hidden; z-index: var(--z-index-low);
overflow: auto; overflow: auto;
background: white; background: white;
flex-basis: 28rem; flex-basis: 28rem;
@include breakpoint(768px down) {
flex-basis: fit-content;
}
@include breakpoint(large up) { @include breakpoint(large up) {
flex-basis: 30em; flex-basis: 30em;
} }

View file

@ -1,5 +1,6 @@
<template> <template>
<div class="conv-header"> <div class="conv-header">
<div class="conversation-header--details">
<div class="user"> <div class="user">
<back-button v-if="showBackButton" :back-url="backButtonUrl" /> <back-button v-if="showBackButton" :back-url="backButtonUrl" />
<Thumbnail <Thumbnail
@ -20,7 +21,7 @@
icon="warning" icon="warning"
/> />
</h3> </h3>
<div class="conversation--header--actions"> <div class="conversation--header--actions text-truncate">
<inbox-name <inbox-name
v-if="hasMultipleInboxes" v-if="hasMultipleInboxes"
:inbox="inbox" :inbox="inbox"
@ -50,6 +51,7 @@
<more-actions :conversation-id="currentChat.id" /> <more-actions :conversation-id="currentChat.id" />
</div> </div>
</div> </div>
</div>
</template> </template>
<script> <script>
import { hasPressedAltAndOKey } from 'shared/helpers/KeyboardHelpers'; import { hasPressedAltAndOKey } from 'shared/helpers/KeyboardHelpers';
@ -165,14 +167,26 @@ export default {
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.text-truncate { @import '~dashboard/assets/scss/woot';
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
.conv-header { .conv-header {
flex: 0 0 var(--space-jumbo); flex: 0 0 var(--space-jumbo);
@include breakpoint(640px down) {
flex-direction: row;
}
}
.conversation-header--details {
display: flex;
justify-content: center;
flex-direction: row;
align-items: center;
width: 100%;
@include breakpoint(640px down) {
flex-direction: column;
}
} }
.option__desc { .option__desc {

View file

@ -280,6 +280,7 @@ export default {
.message-text--metadata { .message-text--metadata {
align-items: flex-start; align-items: flex-start;
display: flex; display: flex;
margin-left: var(--space-small);
.time { .time {
margin-right: var(--space-small); margin-right: var(--space-small);

View file

@ -47,6 +47,7 @@ import AccountSelector from 'dashboard/components/layout/sidebarComponents/Accou
import AddLabelModal from 'dashboard/routes/dashboard/settings/labels/AddLabel'; import AddLabelModal from 'dashboard/routes/dashboard/settings/labels/AddLabel';
import NotificationPanel from 'dashboard/routes/dashboard/notifications/components/NotificationPanel'; import NotificationPanel from 'dashboard/routes/dashboard/notifications/components/NotificationPanel';
import uiSettingsMixin from 'dashboard/mixins/uiSettings'; import uiSettingsMixin from 'dashboard/mixins/uiSettings';
import wootConstants from 'dashboard/constants';
export default { export default {
components: { components: {
@ -67,6 +68,7 @@ export default {
showAddLabelModal: false, showAddLabelModal: false,
showShortcutModal: false, showShortcutModal: false,
isNotificationPanel: false, isNotificationPanel: false,
isDesktopView: false,
}; };
}, },
computed: { computed: {
@ -77,14 +79,40 @@ export default {
const { show_secondary_sidebar: showSecondarySidebar } = this.uiSettings; const { show_secondary_sidebar: showSecondarySidebar } = this.uiSettings;
return showSecondarySidebar; return showSecondarySidebar;
}, },
previouslyUsedDisplayType() {
const {
previously_used_conversation_display_type: conversationDisplayType,
} = this.uiSettings;
return conversationDisplayType;
},
},
watch: {
isDesktopView() {
const { LAYOUT_TYPES } = wootConstants;
this.updateUISettings({
conversation_display_type: !this.isDesktopView
? LAYOUT_TYPES.EXPANDED
: this.previouslyUsedDisplayType,
});
},
}, },
mounted() { mounted() {
window.addEventListener('resize', this.handleResize);
this.handleResize();
bus.$on(BUS_EVENTS.TOGGLE_SIDEMENU, this.toggleSidebar); bus.$on(BUS_EVENTS.TOGGLE_SIDEMENU, this.toggleSidebar);
}, },
beforeDestroy() { beforeDestroy() {
bus.$off(BUS_EVENTS.TOGGLE_SIDEMENU, this.toggleSidebar); bus.$off(BUS_EVENTS.TOGGLE_SIDEMENU, this.toggleSidebar);
window.removeEventListener('resize', this.handleResize);
}, },
methods: { methods: {
handleResize() {
if (window.innerWidth <= 992) {
this.isDesktopView = false;
} else {
this.isDesktopView = true;
}
},
toggleSidebar() { toggleSidebar() {
this.updateUISettings({ this.updateUISettings({
show_secondary_sidebar: !this.isSidebarOpen, show_secondary_sidebar: !this.isSidebarOpen,

View file

@ -133,7 +133,10 @@ export default {
conversationDisplayType === LAYOUT_TYPES.CONDENSED conversationDisplayType === LAYOUT_TYPES.CONDENSED
? LAYOUT_TYPES.EXPANDED ? LAYOUT_TYPES.EXPANDED
: LAYOUT_TYPES.CONDENSED; : LAYOUT_TYPES.CONDENSED;
this.updateUISettings({ conversation_display_type: newViewType }); this.updateUISettings({
conversation_display_type: newViewType,
previously_used_conversation_display_type: newViewType,
});
}, },
fetchConversationIfUnavailable() { fetchConversationIfUnavailable() {
if (!this.conversationId) { if (!this.conversationId) {

View file

@ -109,14 +109,7 @@ export default {
flex-shrink: 0; flex-shrink: 0;
overflow: hidden; overflow: hidden;
padding: var(--space-small); padding: var(--space-small);
@include breakpoint(xlarge down) {
position: absolute;
}
@include breakpoint(xlarge up) {
position: unset; position: unset;
}
&:hover { &:hover {
overflow: auto; overflow: auto;