Skip to content

Commit

Permalink
chore: Improves styling for conversation header (#1167)
Browse files Browse the repository at this point in the history
Co-authored-by: Pranav Raj S <pranav@thoughtwoot.com>
  • Loading branch information
nithindavid and pranavrajs committed Sep 3, 2020
1 parent dfb533d commit 9b23a11
Show file tree
Hide file tree
Showing 7 changed files with 77 additions and 39 deletions.
8 changes: 8 additions & 0 deletions app/javascript/dashboard/assets/scss/_helper-classes.scss
Expand Up @@ -69,3 +69,11 @@ select {
border-top-left-radius: 0 !important;
}
}

.justify-space-between {
justify-content: space-between;
}

.w-100 {
width: 100%;
}
10 changes: 1 addition & 9 deletions app/javascript/dashboard/assets/scss/_mixins.scss
@@ -1,3 +1,4 @@
@import '~dashboard/assets/scss/variables';
@import '~widget/assets/scss/mixins';

$spinner-before-border-color: rgba(255, 255, 255, 0.7);
Expand Down Expand Up @@ -235,12 +236,3 @@ $spinner-before-border-color: rgba(255, 255, 255, 0.7);
text-overflow: ellipsis;
white-space: nowrap;
}


.justify-space-between {
justify-content: space-between;
}

.w-100 {
width: 100%;
}
16 changes: 16 additions & 0 deletions app/javascript/dashboard/assets/scss/widgets/_conv-header.scss
Expand Up @@ -41,6 +41,10 @@
@include flex;
@include flex-align($x: center, $y: middle);

&.hide {
visibility: hidden;
}

.user--name {
@include margin(0);
font-size: $font-size-medium;
Expand Down Expand Up @@ -83,3 +87,15 @@
}
}
}


.header-actions-wrap {
display: flex;
flex-direction: row;
flex-grow: 1;
justify-content: flex-end;

&.has-open-sidebar {
justify-content: flex-end;
}
}
@@ -1,6 +1,6 @@
<template>
<div class="conv-header">
<div v-if="!isContactPanelOpen" class="user">
<div class="user" :class="{ hide: isContactPanelOpen }">
<Thumbnail
:src="currentContact.thumbnail"
size="40px"
Expand All @@ -25,8 +25,8 @@
</div>
</div>
<div
class="flex-container"
:class="{ 'justify-space-between w-100': isContactPanelOpen }"
class="header-actions-wrap"
:class="{ 'has-open-sidebar': isContactPanelOpen }"
>
<div class="multiselect-box ion-headphone">
<multiselect
Expand Down
Expand Up @@ -5,9 +5,8 @@
:status="currentChat.status"
/>
<woot-button
class="success more--button"
icon="ion-more"
:class="buttonClass"
class="clear more--button"
icon="ion-android-more-vertical"
@click="toggleConversationActions"
/>
<div
Expand All @@ -18,17 +17,15 @@
>
<button
v-if="!currentChat.muted"
class="button small clear row nice alert small-6 action--button"
class="button small clear row alert small-6 action--button"
@click="mute"
>
<i class="icon ion-volume-mute" />
<span>{{ $t('CONTACT_PANEL.MUTE_CONTACT') }}</span>
</button>
<button
class="button small clear row nice small-6 action--button"
class="button small clear row small-6 action--button"
@click="toggleEmailActionsModal"
>
<i class="icon ion-ios-copy" />
{{ $t('CONTACT_PANEL.SEND_TRANSCRIPT') }}
</button>
</div>
Expand All @@ -46,7 +43,6 @@ import { mixin as clickaway } from 'vue-clickaway';
import alertMixin from 'shared/mixins/alertMixin';
import EmailTranscriptModal from './EmailTranscriptModal';
import ResolveAction from '../../buttons/ResolveAction';
import wootConstants from '../../../constants';
export default {
components: {
Expand All @@ -64,12 +60,6 @@ export default {
...mapGetters({
currentChat: 'getSelectedChat',
}),
buttonClass() {
return this.currentChat.status !== wootConstants.STATUS_TYPE.OPEN
? 'warning'
: 'success';
},
},
methods: {
mute() {
Expand All @@ -91,23 +81,43 @@ export default {
};
</script>
<style scoped lang="scss">
@import '~dashboard/assets/scss/mixins';
.more--button {
align-items: center;
display: flex;
margin-left: var(--space-smaller);
margin-left: var(--space-small);
padding: var(--space-small);
&.clear.more--button {
color: var(--color-body);
}
}
.actions--container {
position: relative;
}
.dropdown-pane {
right: 0;
@include elegant-card;
@include border-light;
right: -12px;
top: 48px;
border: 1px solid var(--s-100);
border-radius: var(--space-smaller);
width: auto;
&::before {
@include arrow(top, var(--color-border-light), 14px);
top: -14px;
position: absolute;
right: 6px;
}
&::after {
@include arrow(top, white, var(--space-slab));
top: -12px;
position: absolute;
right: var(--space-small);
}
}
.dropdown-pane--open {
Expand All @@ -119,10 +129,11 @@ export default {
display: flex;
align-items: center;
width: 100%;
padding: var(--space-small) 0;
padding: var(--space-small) var(--space-smaller);
font-size: var(--font-size-small);
.icon {
margin-right: var(--space-small);
margin-right: var(--space-smaller);
min-width: var(--space-normal);
}
}
Expand Down
Expand Up @@ -3,7 +3,7 @@
<div class="contact--info">
<thumbnail
:src="contact.thumbnail"
size="48px"
size="64px"
:badge="channelType"
:username="contact.name"
:status="contact.availability_status"
Expand Down
23 changes: 17 additions & 6 deletions app/javascript/shared/assets/stylesheets/colors.scss
@@ -1,7 +1,7 @@
:root {
--white: #fff;

--w-50: #E3F2FF;
--w-50: #E3F2FF;
--w-100: #BBDDFF;
--w-200: #8FC9FF;
--w-300: #61B3FF;
Expand All @@ -12,7 +12,7 @@
--w-800: #2161CA;
--w-900: #1F41AB;

--g-50: #E6F8E6;
--g-50: #E6F8E6;
--g-100: #C4EEC2;
--g-200: #9DE29A;
--g-300: #6FD86F;
Expand All @@ -23,7 +23,7 @@
--g-800: #009000;
--g-900: #007000;

--y-50: #FFFEE8;
--y-50: #FFFEE8;
--y-100: #FFFAC5;
--y-200: #FFF69E;
--y-300: #FEF176;
Expand All @@ -34,7 +34,7 @@
--y-800: #FDAD2A;
--y-900: #F9841B;

--s-50: #E7EEFB;
--s-50: #E7EEFB;
--s-100: #C8D6E6;
--s-200: #ABBACE;
--s-300: #8C9EB6;
Expand All @@ -45,7 +45,7 @@
--s-800: #314155;
--s-900: #1F2D3D;

--b-50:#F8F9FE;
--b-50: #F8F9FE;
--b-100: #F2F3F7;
--b-200: #E9EAEF;
--b-300: #DADBDF;
Expand All @@ -56,7 +56,7 @@
--b-800: #3C3D40;
--b-900: #1B1C1F;

--r-50: #FFEBEE;
--r-50: #FFEBEE;
--r-100: #FFCCD1;
--r-200: #F69898;
--r-300: #EF6F6F;
Expand All @@ -66,4 +66,15 @@
--r-700: #DE1E27;
--r-800: #D11320;
--r-900: #C30011;

// Common color aliases
--color-heading: #1f2d3d;
--color-body: #3c4858;

--color-border: #e0e6ed;
--color-border-light: #f0f4f5;
--color-border-dark: #cad0d4;

--color-background: #f4f6fb;
--color-background-light: #f9fafc;
}

0 comments on commit 9b23a11

Please sign in to comment.